jrandm's comments

jrandm | 3 years ago | on: Ask HN: How would you make $100k fast?

> might be easier [...] just working at a bank

Reminded me of this Key & Peele sketch: https://www.youtube.com/watch?v=jgYYOUC10aM

    Robber 2: So how do we get the money?
    Robber 1: That's the beauty of it, bro. They deposit the money into our bank accounts, week after week, month after month. They're not even gonna know they're being robbed! And then 20-30 years later, we walk out the front door like nothin' even happened.

jrandm | 4 years ago | on: Ask HN: Where are the resources for complex architectures for Node.js?

My biggest pointer would be to remember that Java & JavaScript aren't named that way by coincidence. They're two different approaches to a similar problem. Java suffers from Enterprise Development (eg: Enterprise FizzBuzz[0]), JavaScript suffers from Ultimate Accessibility (eg: how many questions on Stack Overflow conflated jQuery and JS?).

> How should exceptions be managed? [...] Has there been a debate about best practice? Where can I find it?

I suggest you handle the errors you can and otherwise let it crash.[1][2] Debates in NodeJS-land have steered towards more monadic/Result-like structures and working synchronous-looking try/catch onto async/await. NodeJS and its various components are open source, you'll have a lot of luck looking around on GH for issues & PRs related to a feature -- same for the language, ECMAScript[3] officially.[4]

Since you mentioned Clojure, have you looked at ClojureScript?[5] That may be a good entry to JS authors & articles you'd enjoy.

> I have the impression that NodeJS is a bit more magical than the JVM [...] Is that correct? Where are good resources on this subject?

As other replies have mentioned, you're really talking about V8[6] for the "JSVM" executing that code. A thing I've seen throw some people for a loop is how minimalist the specification actually is.[7] The magic in NodeJS is certainly from V8 and the rate of optimizations there but also libuv,[8] what actually powers the infamous event loop.

Hope that helps!

[0]: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

[1]: Borrowing from Erlang, see Making reliable distributed systems in the presence of software errors, Joe Armstrong, page 104 "Error Handling Philosophy" https://erlang.org/download/armstrong_thesis_2003.pdf

[2]: _Most_ kinds of errors will cause the process to crash if you don't handle them, https://nodejs.org/dist/latest-v16.x/docs/api/errors.html . Promise rejections don't (yet) though it will log a warning, and callback-based APIs will always consist of an [error, data] tuple for the arguments

[3]: https://github.com/tc39/proposals

[4]: Because Oracle owns the trademark, of course: http://tarr.uspto.gov/servlet/tarr?regser=serial&entry=75026...

[5]: https://clojurescript.org/

[6]: https://v8.dev/docs

[7]: "ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the computational environment of an ECMAScript program will provide not only the objects and other facilities described in this specification but also certain environment-specific objects, whose description and behaviour are beyond the scope of this specification except to indicate that they may provide certain properties that can be accessed and certain functions that can be called from an ECMAScript program." https://tc39.es/ecma262/#sec-overview

[8]: https://github.com/libuv/libuv

jrandm | 4 years ago | on: Superhighway84 – a Usenet-inspired decentralized internet discussion system

> You can just look at pure user counts and see they are more usable/accessible overall

User counts are a poor comparison when you consider how much the pool of potential users has grown.

As points to reference, Microsoft Windows 95 sold 7 million copies in its first 5 weeks so call it ~73 million copies sold the first year.[0]

20 years later in 2015, Samsung, Apple, and Huawei combined sold ~73 million phones across 5 models.[1] Windows 10, released that same year, had Microsoft shooting for it installed on 1 billion devices within 3 years.[2]

2005 estimates 1 billion (or 16% of the global population) online. 2020 estimates 4.9 billion (or 63% of the global population) online.[3] A million users used to be a big deal not that long ago.[4]

Not that I disagree we've gotten better at some things but Outlook Express (newsgroups) and mIRC (irc) seemed plenty accessible to millions of non-technical users.

[0]: https://news.microsoft.com/announcement/launch-of-windows-95... - when searching for a number I saw first-year estimates at ~40 million

[1]: https://en.wikipedia.org/wiki/List_of_best-selling_mobile_ph...

[2]: They made it in 5, https://www.theverge.com/2020/3/16/21116762/microsoft-window...

[3]: https://www.itu.int/itu-d/reports/statistics/2021/11/15/inte...

[4]: https://en.wikipedia.org/wiki/The_Million_Dollar_Homepage ; https://www.youtube.com/watch?v=4e0n7vTLz1U

jrandm | 4 years ago | on: Math Goblins

I think most of the Monty Hall confusion comes from focusing too much on the question and the math and missing the important part: The confusing setup is part of the game! Essentially it works like this:

Host: Contestant, please choose one of the 3 doors

Contestant: I choose door #1

Host: Confusing jibber-jabber to raise tension and keep this fun to watch

Contestant: I don't know what to do!

Host: Do you think the prize is behind your selection, door #1, or behind any of the others?

Expressed this way there's no confusion but it's the exact same problem. The contestant first selected 1/3 doors and the host is offering to let Contestant keep that 1/3 or choose the other 2/3. Any obfuscation in between is intentional for the sake of the game.

jrandm | 4 years ago | on: Math Goblins

If it helps any, you're supposed to be misled by the setup.

Monty could have asked the question as "Do you want to stick with the door you chose or do you think it's in one of the other two?" and skipped even opening one of them but that wouldn't have been as fun to watch.

jrandm | 4 years ago | on: China has forbidden under-18s from playing games for more than three hours/week

> they can always lend their own account to their kids, which would disable the mechanism

Current technology means statements like this are not necessarily true (these are all referring to the same story, Chinese language link last):

https://www.theregister.com/2021/07/08/tencent_facial_recogn...

https://www.nytimes.com/2021/07/08/business/video-game-facia...

https://mp.weixin.qq.com/s/Cr17TKWQ3XcuNzDw085OLw

    > the new feature sees the company check accounts registered in adults’ names if
    > they are playing games between 10:00PM and 8:00AM.  The company will then run a
    > facial recognition test and, if it identifies someone who is not the account
    > holder, they’ll be booted offline.  “Anyone who refuses or fails face
    > verification will be treated as a minor,” according to a machine translation of
    > Tencent’s QQ post.

jrandm | 5 years ago | on: A worry junior engineers frequently have is that they ask too many questions

My favorite working situations are when asking "stupid" questions and/or burning 6-12 hours on a subject is normalized and endorsed. I don't expect to live long enough to transcend anecdote, but both are necessary to learn and that's almost always important. I certainly had this in academic environments but they were somewhat cloistered or the educators expected them to be. In jobs like sysadmin/programming 6-12 hours on a thing could be 1 day or 15.

The 30-90 minute rule is to force people to search for answers themselves. If you don't know why that's necessary, I encourage you to spend several hours answering questions on sites you browse for answers (SO, HN, reddit, IRC, twitter, discord, slack, zoom, signal, mailing lists, GH issues, bugzilla, phpbb, anything) -- it'll take less than a week. People exist that don't do basic reading or research and will expect you to do everything for them. You'll get jaded.

The downside to this environment is a sort of pathological self-reliance. That's when these rules become upper limits: to keep someone from chasing waterfalls ( https://www.youtube.com/watch?v=NoKufWbP_L4 ). Collaboration always helps, some personal research is always needed... when to mix them varies.

jrandm | 6 years ago | on: Learn D3

> This may feel like cheating, but it’s okay! Examples are not merely reusable templates but tools for learning, hinting at subjects for study. “Breaking” an example by tinkering—changing stuff and seeing what happens—helps you achieve understanding faster than passive reading.

I haven't had to use d3 in anger for some time but have an idea that means I need to re-learn it; I haven't finished yet but this is a great article. Thanks all for writing and/or sharing it.

jrandm | 6 years ago | on: What the last few weeks have been like for the CEO of Slack

> When collaborating over ambiguous topics where the potential to be misunderstood is high, you need to use the "richest" communication channel possible. Body language, facial expression

I would dispute that body language and facial expression are somehow always correctly interpreted or unambiguous, like most forms of communication.

Written word, or a series of characters in a string, as I think we in a technical forum with many programmers in particular can appreciate, can in fact remove quite a bit of ambiguity if everyone is careful about what they type.

Github has many examples of this in-progress.

jrandm | 6 years ago | on: What the last few weeks have been like for the CEO of Slack

If the pen is mightier than the sword; transferring long-form information via Twitter is like leaving hand grenades lying around.

(The above sentence is 129 characters, feel free to tweet it)

I'm not trying to disparage this person, and I suspect he might even agree based on the screenshot of the message posted in Slack, I'm just wondering why we all keep treating this like it's normal.

Slack even has posts and (public?) file sharing as part of the product he could use to distribute this information!

jrandm | 6 years ago | on: Chrome phasing out support for User-Agent

I am not sure about Edge specifically, but as someone who tries to use mostly open source software: Digital Rights Management (DRM) requirements often directly conflict with licensing related to open source software.

jrandm | 6 years ago | on: Show HN: MVP.css – Minimalist stylesheet for HTML elements

HTML 4.01 is relevant to HTML5 in that it was the direct precursor to HTML5.

Put another way, when I learned a lot of the HTML we all use every day there was no HTML5.

By agreeing with the original reply and looking into why, I saw that it was defined in a specification I have read several times (HTML 4.01[0]). I knew CODE being vague was a thing and was part of why I didn't use it much, so seeing SAMP was similar explained why it would have slipped my mind or I totally glossed over it.

Another reply pointed out that <pre> is the block-level styling element I want and that <code> or <samp> make more semantic sense inline and nested. This does make sense to me and I thought it was funny that in a technical document like an HTML specification they would note the importance of the elements in technical documents but not give any example or further explanation.

Yet another reply corrected me again, that SAMP is defined with a monospace font-family in the CSS2 specification[1]! Now I can complete why I used to be wrong and now am not: <pre> always worked by default to get a monospace font and preserve literal whitespace in rendering. <samp> may have, I'd be interested to know but not interested enough to do research into old browsers' specific rendering. The entire <samp> thing was effectively unknown to me. <code>, while similarly defined in HTML, did not have that default font set and thus would not work in a spec-compliant browser by default unless they extended the specification in that browser. That is why in my head I used to prefer <pre> over <code> and that was all; and also why I enjoy posting in communities like these!

> If I'm not mistaken, even Google amp is considered valid HTML5?

So far as I know (I haven't kept up with this level of detail in AMP) it is entirely implemented via some subset of HTML/JS/CSS: presumably any Google AMP would then include valid HTML5.

[0]: linked in my original post

[1]: https://drafts.csswg.org/css2/sample.html

jrandm | 6 years ago | on: Show HN: MVP.css – Minimalist stylesheet for HTML elements

Thank you for laying that out clearly!

I pointed out the irony of not giving an example|intended use in a technical document because if a line or two like that was in the HTML 4.01 specification I probably would have written more-correct HTML since sometime in the early-mid ~2000s. I guess I'm glad my reading comprehension has improved but it also shows pretty clearly why it's the old spec.

jrandm | 6 years ago | on: Show HN: MVP.css – Minimalist stylesheet for HTML elements

Thank you for pointing that out! <samp> does indeed have a default font-family of monospace there.

And <code> isn't defined at all! I'm not disputing this is all internally consistent or that I used to write what I'm now learning is incorrect HTML, this completely explains what I used to know about the tags and I love it:

I didn't know or forgot <samp> was a thing for whatever reason. I know HTML5 is big and I don't know it all, HTML4 is much less so and I usually do.

I always prefer <pre> when I'm writing HTML to show intentionally-monospace blocks like code or code output because <code> is inconsistent, importantly for me it meant sometimes it didn't|doesn't work. Here I now know why: The CSS2 stylesheet doesn't define anything for <code>!

Other replies have described how it makes more literal/semantic sense to nest these things together and I agree completely; many times I am surprised at how elegant these old specifications are, if indirectly.

jrandm | 6 years ago | on: Mise en Place Writing

That's an odd nit to pick and I don't think it's accurate. In case you haven't heard the term sous-chef[0]:

> Sous-chefs are in charge of making sure all kitchen equipment is in working order. [...] Under the oversight of the sous-chef, downtime should be used for prepping, cleaning and other kitchen duties.

In the body of a document titled "Mise en Place Writing," I do believe the author meant exactly that chefs[1] are the ones making sure all forms of preparation are completed, even if it means working the prep station.

In fact, I'd go so far as to say I'm certain this particular author checked a resource like a list of culinary terms or restaurant terminology[2] during a "pre-writing" phase like "Research" before using those words at all.

[0]: https://en.wikipedia.org/wiki/Sous-chef

[1]: "A chef is a trained professional cook and tradesman who is proficient in all aspects of food preparation" emphasis added by me, https://en.wikipedia.org/wiki/Chef

[2] https://en.wikipedia.org/wiki/List_of_restaurant_terminology

jrandm | 6 years ago | on: Show HN: MVP.css – Minimalist stylesheet for HTML elements

I'm guessing because they were inconsistently supported by browsers, because me too!

I was even more surprised to see it in the HTML 4.01 spec, but if you look it makes more sense. I'll quote every mention of it here but the table of contents line:

    9.2.1 Phrase elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM
    
    <!ENTITY % phrase "EM | STRONG | DFN | CODE |
                       SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
    
    SAMP:
        Designates sample output from programs, scripts, etc.
CODE is equally well defined -- neither even mention monospace!

> The other phrase elements have particular significance in technical documents

HTML never ceases to amaze me. This also explains why I still prefer <pre> even though I can never remember why it's <pre> and not <code>.

Almost forgot the link: https://www.w3.org/TR/html401/struct/text.html#h-9.2.1

page 1