Live data from Hacker News

A Modern JavaScript Tutorial

javascript.info

251–260 of 299 posts

Re: A Modern JavaScript Tutorial

#251
post #171
post #128

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

I used to be on the "always use semicolons" side of this argument. Having shipped multiple projects using both methods my verdict is clear: It doesn't matter. Why it doesn't matter you ask? Because 1) I am enforcing either decision with eslint rules and 2) i write unit tests 3) code is transpiled (thus semicolons are handled perfectly at the output). Having these three in place, I have yet to encounter a single "gotc…

"It doesn't matter" really is the perfect summation of this.

We have tooling that can solve this to prevent pointless bike shedding.

Re: A Modern JavaScript Tutorial

#252

Excellent. Wish all documentation\tutorial sites were this clean.

When you say "clean" are you referring to the formatting of the page?

Not sure what OP was referring to, but I find both the formatting and the tone of voice to be exceptionally clean and mature. I am incredibly jealous of the writer's skill to write like this.

Re: A Modern JavaScript Tutorial

#253

Earlier quoted context omitted.

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

I get CoffeeScript vibes from TypeScript, and look at where CoffeScript is now.

> and look at where CoffeScript is now

Largely absorbed by modern javascript? ;-)

Re: A Modern JavaScript Tutorial

#254
post #248

Earlier quoted context omitted.

https://news.ycombinator.com/item?id=2024328 Here’s an example great bike shed discussion from ~10y ago about whether or not to use semicolons with JavaScript. “If you don’t understand how statements in JavaScript are terminated, then you just don’t know JavaScript very well, and shouldn’t write JavaScript programs professionally without supervision, and you definitely should not tell anyone else how to write their J…

Reminds me of a CS teacher for our intro Haskell course at university who would dock points for unnecessary use of parentheses, since he considered that it showed we didn't understand order of operations or how our program was parsed.

That sounds like a bad professor. It doesn't cost anything to add parenthesis for clarity. I enjoy well written code but we're not writing literature here, it's okay to be explicit.

Re: A Modern JavaScript Tutorial

#255
Looks like a great resource. There does not seem to be anything on database connections (e.g. MySQL, PostgreSQL etc) and related topics (e.g. building a CRUD framework). Are database connections only considered in a client/server context (e.g. through Node.js)? What am I missing? How does the IndexedDB section relate to these considerations?

Re: A Modern JavaScript Tutorial

#256

There is a chapter called ‘ninja code’, which is full of terrible advice. A small example. > The ideal name for a variable is data. Use it everywhere you can. There is one small comment at the top of the chapter, which says ‘Irony detected’. Is there really a whole chapter written Ironically? It would be very easy to read this and think it was real advice. (And if it is real advice, and I’m completely misunderstandin…

> There is a chapter called ‘ninja code’, which is full of terrible advice.

How someone interprets a tongue-in-cheek chapter could be a good litmus test of their reading comprehension, grasp on the fundamentals, and (last, but not the least) basic sense of humour. I’d hate to see it removed.

If someone takes this section literally, I would be immensely curious how they reconciled in their mind that advice with what they (supposedly) read in preceding sections.

Re: A Modern JavaScript Tutorial

#257
post #254
post #248

Earlier quoted context omitted.

Reminds me of a CS teacher for our intro Haskell course at university who would dock points for unnecessary use of parentheses, since he considered that it showed we didn't understand order of operations or how our program was parsed.

That sounds like a bad professor. It doesn't cost anything to add parenthesis for clarity. I enjoy well written code but we're not writing literature here, it's okay to be explicit.

Yea it was very weird. I think most people realized that his way wasn't the right way.

Re: A Modern JavaScript Tutorial

#258
post #248

Earlier quoted context omitted.

https://news.ycombinator.com/item?id=2024328 Here’s an example great bike shed discussion from ~10y ago about whether or not to use semicolons with JavaScript. “If you don’t understand how statements in JavaScript are terminated, then you just don’t know JavaScript very well, and shouldn’t write JavaScript programs professionally without supervision, and you definitely should not tell anyone else how to write their J…

Reminds me of a CS teacher for our intro Haskell course at university who would dock points for unnecessary use of parentheses, since he considered that it showed we didn't understand order of operations or how our program was parsed.

The programming language Occam, in its time the primary language to program Transputers, did not have operator precedence, so you had to use parentheses for anything. It was a huge pain, but probably still better than avoiding the edge cases of what you describe...

https://en.wikipedia.org/wiki/Occam_(programming_language)

Re: A Modern JavaScript Tutorial

#259
post #171
post #128

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

I used to be on the "always use semicolons" side of this argument. Having shipped multiple projects using both methods my verdict is clear: It doesn't matter. Why it doesn't matter you ask? Because 1) I am enforcing either decision with eslint rules and 2) i write unit tests 3) code is transpiled (thus semicolons are handled perfectly at the output). Having these three in place, I have yet to encounter a single "gotc…

Exactly. I almost always use TS instead of JS, for example, which flags gotcha scenarios (which I usually rewrite to avoid) and inserts semicolons for me in the final code. It’s just noise in my source.

Re: A Modern JavaScript Tutorial

#260

This site is absolutely awesome and I would suggest this to new comers and experienced folks alike. It covers all things related to javascript, explains the concepts really well in a practical day to day application point of view. I might be sounding like a promoter for it, but it really added a lot of value for me personally, so just wanted to spread the good word.

I just wish it didn't have Disqus :(
Post reply on HN