Live data from Hacker News

A Modern JavaScript Tutorial

javascript.info

71–80 of 299 posts

Re: A Modern JavaScript Tutorial

#71
post #40

Earlier quoted context omitted.

Disagree. I've been writing JavaScript for twenty years, and I'm very aware that there's a lot of "new" stuff that I need to brush up on. When I saw it call itself "modern" I instantly assumed that it would be covering the kind of information I need to know.

I, as a JS dev of 10+ years, wouldn't consider this "modern". I didn't see - for in loop - for of loop as a couple examples, and those have been around for at least a few years now. There's probably more missing too. To what the above person said. The usage of "modern" or "latest" or similar is going to fall behind and make for bad searching.

> - for in loop - for of loop

It's 2020 and you still use loops? ;-)

source: https://github.com/buildo/eslint-plugin-no-loops

Re: A Modern JavaScript Tutorial

#74

Earlier quoted context omitted.

Is your next thought after having your curiosity piqued not, "I should look at what headers my browser is sending", or "I should type 'browser language headers' into a search engine"? I'm trying to understand what sort of things lead people instead to think, "I should type a question about 'browser language headers' into a comment box on an off-topic thread, wait for a response, and then go back and check what the re…

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 tolerable (it got flagged) but the other commenter's is fine?

Re: A Modern JavaScript Tutorial

#75
post #69

Isn’t step 1 of “modern JavaScript” to install TypeScript? :)

Amazing how many JS devs I meet (or work with) that are against the very idea of Typescript.

Because it fails to meet the 'it's the platform stupid' maxim.

ie languages aren't nearly quite so important as the platform.

Stuff wasn't written in js because early js was a brilliant language - it was because the platform - the web - was brilliant.

Many have written 'better' languages that compile to js - https://github.com/jashkenas/coffeescript/wiki/List-of-langu...

and while typescript is one of the better, more supported ones, isn't it just another one?

Surely in the end it just adds complexity and fragmentation of the ecosystem?

Re: A Modern JavaScript Tutorial

#76

Thanks for sharing. I found this quote very appropriated: In older scripts, you may also find another keyword: var instead of let

True for reading legacy JS. For newer code, you can still identify noobies (and "experts") by the conspicuous usage of let instead of const.

Re: A Modern JavaScript Tutorial

#77
post #10

Earlier quoted context omitted.

That page has an 'irony warning' so just watch out for those on other pages! It might just be my sense of humour (I'm the sort of person that doesn't need an '/s' tag and feels that it shouldn't be necessary if you told the joke properly ), but it was pretty obvious to me even without the irony warning that the page was intended as a joke. It looks like it was heavily inspired by the classic 'Tao of Programming' [0].…

I am with you on not wanting or needing to see /s ... but on a tutorial, where people actually struggle to understand anything at first read, using unmarked irony is maybe not the most helpful for them. Oh and a second thought on /s. For some time I only got my news through satire sites like the onion. And after I switched back to "real news" sites, I could not believe it was not satire. I mean come on, the world and…

Yeah, when we live in a world where people legitimately believe that Bill Gates is trying to use COVID vaccines to install microchips into people, you can't always be sure that someone giving an insane opinion isn being ironic or sarcastic.

Re: A Modern JavaScript Tutorial

#78
post #5

The default way promises are used is now async/await. `.then()` should not be introduced as anything more than 'you may find this in older codebases'.

(async () => { set(await get()); })(); get().then(r => set(r)); Ignoring error handling I'll often choose the second option.

Much cleaner. You can go even further by using point-free style:

    get().then(set)
It's the try/catch blocks that make async/await truly worse than native promises. I use them sparingly because so often the .then syntax is both clearer and terser.

Re: A Modern JavaScript Tutorial

#79
post #66

Earlier quoted context omitted.

Wow. I was hoping, at some point things would improve a bit.

Agreed. I find myself using a pretty small subset of the language which definitely doesn't include the class keyword. Doubt I'll ever find it useful.

Yeah, like many people, I ended up making my own inheritance routines. Then when class came out, I was half rejoicing, half regretting to put up the work. But well, no thanks. I rather keep using my own far from perfect way of things.

Re: A Modern JavaScript Tutorial

#80

Earlier quoted context omitted.

I am with you on not wanting or needing to see /s ... but on a tutorial, where people actually struggle to understand anything at first read, using unmarked irony is maybe not the most helpful for them. Oh and a second thought on /s. For some time I only got my news through satire sites like the onion. And after I switched back to "real news" sites, I could not believe it was not satire. I mean come on, the world and…

Yeah, when we live in a world where people legitimately believe that Bill Gates is trying to use COVID vaccines to install microchips into people, you can't always be sure that someone giving an insane opinion isn being ironic or sarcastic.

I mean, we allways had flat earthers (even though I couldn't believe they were serious either, when I first stumbled upon them).

But this new level is a bit unsettling.

Post reply on HN