Live data from Hacker News

A Modern JavaScript Tutorial

javascript.info

141–150 of 299 posts

Re: A Modern JavaScript Tutorial

#141

Earlier quoted context omitted.

I think many JS developers are also somewhat blind to the breadth of types of sites that are written, and so don't understand how valuable a type system can be on the web. Most websites are what I'd call "broad and shallow". For any individual action the corresponding code path is small. Most code in these sites is easy to write and easy to debug in vanilla JS. Typescript adds boilerplate and compiler times for type…

I'd guess I'd have to question why you need 10K lines of code for a single web page - perhaps you need to break up your SPA?

The fact you ask this question gets at my point I think.

For several years I've been writing a large computer algebra system(CAS) that runs on a webpage. Every time the user puts some input into a text box the CAS runs. Depending on the input it may run as many as ~40k lines of code. There are no coherent lines upon which to split the CAS as far as anyone developing it can tell.

The CAS must run on the browser both to deliver on real time performance requirements and to keep server costs manageable (certain inputs will get even high end CPUs humming).

If breaking this SPA up is possible, it's not apparent even to engineers with >10 years of experience developing highly complex applications.

Other similarly complex applications run on the web, even if it's unusual.

Re: A Modern JavaScript Tutorial

#142
post #128

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

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 JavaScript programs.”

Those were the fun days! :)

Re: A Modern JavaScript Tutorial

#143
post #112

Earlier quoted context omitted.

What text editor did you use before? I think the biggest advantage is an IDE, not the language itself.

As a daily user of IntelliJ IDEA—which, IME, has the best autocomplete and code suggestions of any IDE for dynamically typed languages—there is a world of a difference between the quality of suggestions for a codebase using TypeScript and one written in vanilla JS. Without concrete types, the IDE often has to guess the possible type(s) that a value can have, whereas with TS, there is (generally) no such ambiguity.

I don't really experience this issue and I use Web storm which is basically the same thing. I find that the dynamic type hinting plus the combination of using JS Doc formatted comments rarely leaves me with any ambiguity when writing vanilla JavaScript.

Re: A Modern JavaScript Tutorial

#145

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…

Because your question reads as a relatively transparent thinly veiled insult, like you're questioning his ability to be curious about the world, and contributes very little to the discussion.

Re: A Modern JavaScript Tutorial

#146
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 misunderstanding, then I can’t possibly recommend this book).

Re: A Modern JavaScript Tutorial

#147
post #128

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

I've run into that in a few places and it always baffles me that people would intentionally choose to add even more gotchas to javascript. Don't get me wrong, I think aesthetics in code are important but not to the point of deliberately increasing the chance of hard to find bugs.

Re: A Modern JavaScript Tutorial

#149

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…

yes, it's a whole chapter written ironically. I too find this to be misleading.

Re: A Modern JavaScript Tutorial

#150
post #85
post #43

I'm surprised I haven't seen this before - it's been under very active development since 2015 and has 11,000+ stars on GitHub: https://github.com/javascript-tutorial/en.javascript.info/gr...

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 that are excited about it, either from hearing about it the first time or from knowing it in the past, and these people write positive comments about it, then others who come across the post may be encouraged to check it out and to upvote it too.

- “Micro zeitgeist”. If it’s about a topic that recently hit the front page and it adds something new about that, it could luck out. Why luck in this case? Because you probably don’t know ahead of submitting that people will care to read even more about some topic even if it was popular the day before. Perhaps instead people are tired of the topic.

- The other things submitted the same day did not gain enough traction to push this thing away.

- Evergreen topics that have not gotten traction in a while but that people care about.

- Topics that people in university and college are currently learning about so it catches their attention. I dunno how big the amount of people currently in university is versus people that are in jobs. But I remember that I learned about HN from some other students in a student union I was in back then. And I don’t know how students HN reading habits are compared to people in jobs either. I remember reading HN a lot when at the university. But I still read HN a lot. These days I read HN in the morning, the evening and at night though, not when I am working. But even if you have a job you might read HN in the lunch break, or perhaps you have some downtime where you are waiting for something at work and you read HN for a while.

There are other possible factors too that I have thought about in the past but these are the ones I can think of right now.

Please note that all of what I am saying here is only my thoughts based on my own habits and from what I’ve heard other people say and what I’ve seen.

Post reply on HN