The author's attitude really doesn't make it easy to get on board with him either.
81 karma · joined June 4, 2011
The author's attitude really doesn't make it easy to get on board with him either.
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.
Like you said, bad code is somewhat inevitable when you drop a classically-trained OOP programming into JavaScript. And that specifically is not a fault of the language. But I think we can all do a better job of pointing newbies in the right direction.
I hear your point, but this kind of language is no way to get it across.
1) As others have said, if your site's purpose is more discoverability than navigability, then this layout may work for you.
2) This layout can work if you have the discipline to pare down on everything else. I've found that using Pinterest-style layouts has forced us to really reconsider whether content on our page needs to be there, since everything becomes so prominent. In some ways it's helped us flatten our IA.
I recommend being liberal with adding people you meet on LinkedIn. That's not to say you should be spammy or add people you don't know, but if you meet someone at a conference tell them you'll look for them on LinkedIn.
Once you've grown your network of contacts, be sure to update regularly and with useful content! But not TOO regularly.
Also bear in mind that with LinkedIn, you are catering to working professionals. I prefer to update my profile early on weekdays, because I suspect that'll get my changes to the most eyeballs.
I really dislike interviews that rely heavily on academic-type questions that delve into language obscurities. I want someone who can solve problems and explain their thought process. I'm not interested in hiring someone because of their memory for trivia. I have Google for that.
As far as coding challenges go, these can be OK, but most of the time they seem to center around weird logic problems that have very little in common with what a software engineer does day-to-day. They also put people on the spot in a stressful situation, and people will perform quite differently in this light than when they are actually working.
The best interviews I've ever attended feel like a conversation. You are sitting down with the candidate, there is a give and take, and you are talking as if the candidate is already a member of your team. You talk about problems you're facing and how you can resolve them. It's much more comfortable for the interviewee and gives you far better insight into how they'll perform on the job.
I also definitely care who views my profile, as it can be used as a good icebreaker. Whenever someone interesting has viewed my profile, I immediately reach out to them. Odds are they wanted to learn about me for a reason. Maybe I can help them with something.
Responsive is great if your site is mainly concerned with serving up content, like a news site or blog. But if your mobile users have significantly different use cases than your desktop users (as is sometimes the case with applications), it may make sense to serve up a separate app entirely.
Not to mention that it's still really hard to optimize responsive to the point where it performs as well on mobile as m.domain.com sites
Once you know which pitfalls to avoid it's possible to write some really elegant code, but the mere presence of those pitfalls causes a ton of problems when you bring in engineers from other programming languages.
I find it kind of concerning that when someone criticizes JavaScript, everyone's first response is, "he must not have any experience with the language." That's an unfounded personal attack and ignores the crux of the argument.
Look, we love JavaScript, but it doesn't do us any good to pretend it's perfect. It'd be much easier to ramp up new engineers on the language if we admitted its flaws and made efforts to educate "the right way."
Truth be told, if someone wants an explanation of some of JS's weirdness, there are far better articles out there they can Google to meet that need. :)
But from my experience, someone who is coming into JS for the first time is probably not setting up a complicated object hierarchy - they're probably just trying to figure out how to bind some events to a DOM element and get some basic UI functionality. And they probably don't need to use the this keyword as much as they think they have to.
I completely agree that this could be a bad decision on my part, or at least a very controversial one. But I'd rather have truly new JavaScript developers focus on things like encapsulation and closures before they get too far into the this keyword and constructor/prototype.
So please don't interpret my calling these issues out as whining. Just trying to make new people aware that they are there. :)
If, on the other hand, I am legitimately WHINING and not realizing it, also feel free to tell me where so I can fix it. Thanks!
I see a few of you already have, so thanks!
There are a ton of comments down below with a ton of criticisms and suggestions. I will attempt to summarize and respond to the key ones here:
#1: The list is missing a lot of very well-known JavaScript gotchas.
That's intended. My goal here is not to provide a complete, comprehensive list of all known quirks with the language - those exist in far better fashion on the web already. Rather, my goal is to create a simple list of issues that I KNOW will trip up newbies out of the gate.
Oddness with truthiness, undefined and arrays is definitely irksome, but from my experience people tend not to run into those problems until they've already written a good chunk of JS. On the other hand, issues like var, confusion over closures, and the this keyword come up very quickly - almost immediately.
#2: The list seems very negative and biased against JavaScript.
My apologies, as that was not the intent at all. JS is great. But it is also extremely flawed and there are some things flat-out wrong with the language. I'm definitely not the only person who says this, either. :)
It's a great language to work in and you can do some wonderful things with it once you grok it, but if we're going to be completely objective, we have to admit that it has some definite problems that make it hard to learn.
#3: This seems full of preferences, not hard-and fast rules.
That's definitely by design as well. I circulate this list out to my team and so it has my fingerprints all over it.
If this is a real sticking point with you guys and you feel it would be better having that stuff removed, please send me some pull requests and I'll be happy to review.
#4: The author comes across as snarky and unhelpful.
That's just a personality flaw and I apologize for it. :) I didn't want this piece to be dry and I injected a bit of voice. If you feel it's actually detracting from the article, please feel free to shoot me some examples and I'll clean it up.