Hacker News new | ask | show | jobs
by stevekwan 4858 days ago
I hear you completely. But understand that my intent here was not to write idiomatic code, it was to write code that an outsider to JavaScript would understand. I worry that the {} syntax, while simple/elegant/preferred, may be somewhat less obvious to a new person who is unfamiliar with JavaScript's object literals. In any event, I've updated the article to include both ways.

Regarding variable hoisting, I am trying to keep this article short, concise, and focused on the big offenders when it comes to gotchas. The only reason I didn't discuss hoisting is because I felt it would introduce too many concepts at once. To me, hoisting is kind of "level 2," whereas understanding why var is required is "level 1."

And on a side note, I appreciate all the feedback you're providing here - I really do. That's why it's on GitHub and not some blog somewhere. But I would suggest that we separate personal attacks from code criticisms. If you don't like my approach with this article or you find something that's flat-out incorrect, by all means tell me. As a human I am prone to make mistakes - maybe moreso than others. :)

But please avoid making value judgments about a person you don't even know, such as calling them an ignorant. It's bad enough when people behave this way on the internet, but if that kind of mentality starts to seep into your "real world" life too, it'll start having serious effects on team relations and employability.

1 comments

I'm sorry for my personal stakes at you. And honestly I have to say I'm biased against javascript articles, because I'm so used to find a strong lack of experience and knowledge in them. I appreciate your answer, and please pardon my rudeness.

At the same time you could make a "level 1" article a lot more adherent to reality. For example, you could completely jump over that "function creation" section entirely, and simply do a clear explanation of what an expression is in JavaScript, and how to spot them.

Again, thank you for your personal advices, and thank you for your politeness (as opposed to my manners).