> According to your browser language headers, you know Chinese. Please help to translate the tutorial into your language! Thank you! I'm curious. How are my language preferences exposed through HTTP headers? I think this was a charming way to request volunteers for translation, but I was a bit taken aback.
A Modern JavaScript Tutorial
21–30 of 299 posts
Re: A Modern JavaScript Tutorial
#22The ninja code section is pure sarcasm, right? I'm not sure now which sections are and aren't.
Golang's landscape is full of one letter variables and abbreviations and it's not great.
Re: A Modern JavaScript Tutorial
#23> According to your browser language headers, you know Chinese. Please help to translate the tutorial into your language! Thank you! I'm curious. How are my language preferences exposed through HTTP headers? I think this was a charming way to request volunteers for translation, but I was a bit taken aback.
Re: A Modern JavaScript Tutorial
#24> According to your browser language headers, you know Chinese. Please help to translate the tutorial into your language! Thank you! I'm curious. How are my language preferences exposed through HTTP headers? I think this was a charming way to request volunteers for translation, but I was a bit taken aback.
Re: A Modern JavaScript Tutorial
#25The ninja code section is pure sarcasm, right? I'm not sure now which sections are and aren't.
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].…
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 the internet was always full of dumb people, but when even very high ranking people and institution say really out of the world things in all seriousness - I came to the conclusion, marking irony as irony is sadly sometimes important, in those interesting times we live ...
Re: A Modern JavaScript Tutorial
#26> According to your browser language headers, you know Chinese. Please help to translate the tutorial into your language! Thank you! I'm curious. How are my language preferences exposed through HTTP headers? I think this was a charming way to request volunteers for translation, but I was a bit taken aback.
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…
Re: A Modern JavaScript Tutorial
#27The 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'.
Maybe some codebases mandate it, but it's very common to use either style when it makes the most sense. The classic syntax is by no means deprecated or superseded by async/await.
Re: A Modern JavaScript Tutorial
#28Earlier quoted context omitted.
No, just experience with a lot of codebases. Here's a simple question to ask yourself: what if non-IO operations allowed you to use the .then() syntax? If you have the choice to use: 1 + 1.then(function(result) { ... } vs const result = 1 + 1 Which would you choose?
Using then() doesn't pause execution of the callsite function, while await does. Surely that's a relevant difference here? It doesn't seem unreasonable to use then() to express: "Run this anonymous function whenever the async thing completes. Meanwhile let's do this other stuff right now."
Re: A Modern JavaScript Tutorial
#29The 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'.
> 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'. No, because you might have to write explicit promises in the browser with async API that are callback based. You need to understand how promises work to use async/await at first place anyway. Just like it's better to understand how prototypal inheritance works in JS…
About that, does JS class inheritance now work like classes in java for example? Or is it still just syntactic sugar for the prototype inheritance? By your wording, I assume the later?
Re: A Modern JavaScript Tutorial
#30But seriously, calling it 'modern' is pointless. It's not adding anything valuable and its just going to become out of date (and thus wrong).