Hacker News new | ask | show | jobs
by Mithaldu 4126 days ago
You know that kind of bullying where someone grabs someone else's arm and uses it to hit them in the head with their own hand, while yelling "Stop hitting yourself! Why are you hitting yourself?"?

Javascript's automagic semicolon is that, and you're the kind of person who condones it.

Yes, at the end of the day one has to learn how to deal with the automagic semicolon, if one doesn't just give up on Javascript wholesale and finds a way to write better languages. However the very presence and behavior of that code in every javascript interpreter is still a cruel misbehavior whose implementation was a mistake. It is just as cruel and as much of a mistake to imply even in the slightest way that it isn't.

The correct response is to not blame the coder who stumbles over that, but to gently let them know that yes, Javascript is a bad language, and to gracefully show them how to not fall into that trap.

1 comments

Actually that's what I said.

I wasn't blaming the coder or the language.

I was saying that it would help everyone if there was top quality online help explaining how to code around language deficiencies - the kind of deficiencies that everyone has to deal with it, because no language is perfect, and most languages are quite a lot less than perfect in at least some respects.

Be realistic. js isn't suddenly going to be rewritten with a proper semicolon patch. It's too established, and it would break too much code.

So complaining about it is a waste of everyone's time. It's like complaining about the fact that sometimes it gets cold in the winter.

It's more productive to do something practical about producing quality code that minimise possible problems, surely?

I want to make sure that you understand why i wrote that post. I saw you mentioning that the docs need to be better. I actually KNOW the problem, since we have it in Perl too, and i made a site for it. ( perl-tutorial.org )

However, your first two lines were still:

> the implied semicolon isn't the problem.

> The problem is [...] the code [...]

Which is simply not an acceptable thing to say. The first thing to do is admitting that the language is the problem, not the coders or their code. The second thing is, now they're listening instead of being disgusted at you, to tell them solutions.