Live data from Hacker News

A Modern JavaScript Tutorial

javascript.info

201–210 of 299 posts

Re: A Modern JavaScript Tutorial

#201

Earlier quoted context omitted.

I think this is a little harsh. The comment does point out a feature on the topic site. I'm personally glad that they brought it up because as an English speaker I didn't see this feature exposed. Internationalisation is a complex yet required feature for large websites these days, and a clever feature like this to find translations is great!

> I think this is a little harsh Only if you read the question and assume that it is something besides a question. How does a person ask the question that I asked and mark it unambiguously as a question, not a statement (and do it without unnecessary baggage)? How do I convince people to answer the question instead of reply the way you did, to something you received instead of what I asked? Is that question not toler…

Yes, I think you should assume something else.

I provided a reply above from my point of view: I use a computer that has English as a primary language, my Chrome install is also English and I don't live in Ukraine. And of course, I have never added Ukrainian language in my Chrome settings. And yet it "guessed" that I speak Ukrainian. The key bit here is that browsers may modify the list of languages even after you go to the settings and remove all languages except for English (for the record, Chrome also "forgets" that I told it never to translate Ukrainian after I remove Ukrainian from the Accept-Language settings, which is annoying).

So, I guess you are a native English speaker and simply never had any exposure to this "customer journey". I hope my explanation gives you a glimpse into why an experienced software engineer may be still surprised to see a website detect a language they are not using in the system.

Re: A Modern JavaScript Tutorial

#202
post #168

Earlier quoted context omitted.

Is file a file object? A file path? All three are “the template”. So, they use polish-ish notation: the template as []byte, template as string, and template as *template.Template.

In just two hours we discovered so much! Let's keep digging.

I’m not sure I follow. Is two hours a long time or a short time?

I use Go a lot, so I’m used to it’s conventions. b for bytes is obvious to me because I know ReadFile returns bytes (not a file handle or a buffer), but I can see why if you lack context, it can look odd. OTOH, I don’t use Rust, so when I read snippets with 'a lifetimes, they always look “wrong” to me.

Re: A Modern JavaScript Tutorial

#203
post #128

Remember when some people advocated not using semicolons to end statements? Good times... https://javascript.info/structure

I don't know whether I use them or not, to be honest (and I just finished a project in js). My code looks like whatever the almost-default (tab-width: 4) output of prettier is.

It's nice to not waste a single braincycle on these things anymore.

Re: A Modern JavaScript Tutorial

#204
post #132

Earlier quoted context omitted.

That strikes me as perfectly readable. t for template, b for bytes, and s for string. What else would you call them?

Sure, what bothers me is how inconsistent it is. Function parameter of type Template is `t` but local variable of type Template is `tmpl`.

Yes, I would have named the other one returnTmpl or something.

Re: A Modern JavaScript Tutorial

#205
post #181
post #71

Earlier quoted context omitted.

> - for in loop - for of loop It's 2020 and you still use loops? ;-) source: https://github.com/buildo/eslint-plugin-no-loops

Disallowing for..of iterators is the reason I cannot use or recommend the Airbnb lint preset. A very nice example of an anno 2014-2017 cargo cult that clearly hasn't held up. https://github.com/airbnb/javascript/issues/1271

Don't worry, there's plenty of 2020 cargo culting to replace it.

Re: A Modern JavaScript Tutorial

#206

Earlier quoted context omitted.

That recommendation strikes me as much closer to an attempt to make a statement with a rhetorical question than the question I actually asked. Even the most charitable assumption of good faith would most likely yield a response lacking detail and devoid of any insights that I was after.

You could add that "I'm asking because the process of typing an off-topic comment on a forum and waiting for replies strikes me as an inefficient way to get an answer to this question, and I'm genuinely trying to understand that thought process." I highly doubt it would have performed worse than your strategy, which at best resulted in a derail about tone, and at worst scared off the person you were asking and others…

> It seems clear that you find niceties and pleasantries to be not genuine or unnecessary

Wrong. It seems clear you all like making assumptions and treating them as unshakeable truth.

I scarcely think that your suggested wording (your second attempt, keep in mind) would have satisfied even you without this conversational backdrop providing context.

> I highly doubt it would have performed worse than your strategy,

Those aren't the goalposts we're shooting for. You've subtly given yourself an easier target to hit than the one that was presented.

Re: A Modern JavaScript Tutorial

#207
post #188

JavaScript has some really nice features that this tutorial does not mention 1) First class functions 2) Prototype 3) Function scope 4) What async means and how to master it Those I think is essential in order to understand JavaScript.

This website covers every nitty gritty detail of javascript, even DOM specific aspects like https://javascript.info/bubbling-and-capturing (just look at how well it is written). I would be highly surprised if it did not even mention those javascript basics. A brief look at its table of contents shows that indeed it mentions those, and I am baffled why the other commentor is getting downvoted for calling you out.

Re: A Modern JavaScript Tutorial

#208

Earlier quoted context omitted.

> I think this is a little harsh Only if you read the question and assume that it is something besides a question. How does a person ask the question that I asked and mark it unambiguously as a question, not a statement (and do it without unnecessary baggage)? How do I convince people to answer the question instead of reply the way you did, to something you received instead of what I asked? Is that question not toler…

Yes, I think you should assume something else. I provided a reply above from my point of view: I use a computer that has English as a primary language, my Chrome install is also English and I don't live in Ukraine. And of course, I have never added Ukrainian language in my Chrome settings. And yet it "guessed" that I speak Ukrainian. The key bit here is that browsers may modify the list of languages even after you go…

I think you replied to the wrong thread.

Re: A Modern JavaScript Tutorial

#209
post #188

JavaScript has some really nice features that this tutorial does not mention 1) First class functions 2) Prototype 3) Function scope 4) What async means and how to master it Those I think is essential in order to understand JavaScript.

What are you talking about? Did you even take a look at the table of contents?

I didn’t downvote, but calling people out for not reading the article — even if it seems blindingly true — is against HN rules and always gets downvoted.

Re: A Modern JavaScript Tutorial

#210
post #85

Earlier quoted context omitted.

Even more surprising, it's been submitted umpteen times before: https://news.ycombinator.com/from?site=javascript.info I sometimes wonder what are the dynamics that trigger the snowball on HN.

I think time of day, novelty, luck, and whether any mods notice the post and decide to give it a second wind. By novelty I mean something that is easily recognized as new and important. It doesn’t help that something is new if no one catches the point of reading about it. Could be a bad title or a bad article. Or bad luck. In terms of good luck I mean a couple of specific things especially: - If a few people see it t…

To agree with and concretise what your saying - I think (without actually somehow checking) my most popular submissions have all been something that I was led to by another thing(s) I was reading on HN at the time.

Whether conscious or not (probably mostly conscious) I think they simply had the same temporal relevance for other people as they did for me.

All that said, I don't know what it would be in this case. I expect I'll find it useful though, being not really a JS person who does need to write some JS and would rather maintain decent JS than awful.

What it seems to lack, which I find a sticking point whenever I consider some greenfield personal project, is the dizzying array of 'tooling stuff' that JS has, and how it does or doesn't fit together, etc. There's just all sorts of weird layers and not quite equivalents and can be equivalents but could also be used togethers, half the stuff it's not even clear what it is or if it's necessary at all.

I really hope wasm brings more different options (hard to phrase that to not sound hypocritical!) one day; that we just have some tiny JS shim that everyone uses, and other than that it's totally arbitrary which language and ecosystem you use, JS an option, but no more obvious than anything else.

Post reply on HN