Live data from Hacker News

Tips to Become a Better JavaScript Developer

justinchmura.com

11–20 of 46 posts

Re: Tips to Become a Better JavaScript Developer

#11
Tip #4 Ditch the jQuery Crutch: "If you can accomplish the same thing by using vanilla JavaScript, 90% of the time, it’s more efficient to do so."

No. Just no. It is not more efficient to do so 90% of the time. jQuery is mature and battle proven. It is already doing what it can do with an efficient way, which comes with years of experience.

Saying, write your vanilla javascript and ditch jQuery, your implementation will be more efficient, is a no-no. Especially in javascript world!

Re: Tips to Become a Better JavaScript Developer

#14

I dislike when people say that good developers don't use libraries like jQuery. The main reason I use them is because I'm lazy. I'd much rather write $("#id") than document.getElementById("id"). I rarely write any javascript code that is so resource constrained that the extra time added by jQuery is not acceptable.

The actual quote was:

>>What I’m saying is don’t rely heavily on jQuery, or any other library, without having some sort of understanding of how that library is accomplishing it’s tasks.

Which I think is fair. (However, I don't agree with his assertion that using vanilla JS will be more efficient - in most cases, it won't.)

Re: Tips to Become a Better JavaScript Developer

#15

Second example in tip #2 is dead wrong. JavaScript does NOT do Dymanic Scoping. I suspect he didn't even bother to run the code. His example throws an error when I try it: "ReferenceError: x is not defined" (as expected). blind-leading-the-blind etc.

The first example is wrong as well I believe - there is never a function call of bar.

Re: Tips to Become a Better JavaScript Developer

#16
post #5
post #2

Shouldn't this be titled something more like "five things every competent Javascript developer must know"?

No, because I think one of them is kind of wrong (you can be competent and still use jQuery) and three of them are better off replaced by "use jshint". Also, you'd be surprised how many otherwise competent javascript programmers don't understand this and simply avoid it most of the time. Heck, I wrote some pretty ridiculously awesome (and robust) stuff without really understanding this , and it's quite possible someo…

It is possible, but in some cases it may result with inefficient code as JS engines use constructor functions for optimization heuristics.

Re: Tips to Become a Better JavaScript Developer

#18

Second example in tip #2 is dead wrong. JavaScript does NOT do Dymanic Scoping. I suspect he didn't even bother to run the code. His example throws an error when I try it: "ReferenceError: x is not defined" (as expected). blind-leading-the-blind etc.

I had to read that paragraph several times to see if they said "But Javascript doesn't do this." Nope, not in there at all.

Re: Tips to Become a Better JavaScript Developer

#19
post #15

Second example in tip #2 is dead wrong. JavaScript does NOT do Dymanic Scoping. I suspect he didn't even bother to run the code. His example throws an error when I try it: "ReferenceError: x is not defined" (as expected). blind-leading-the-blind etc.

The first example is wrong as well I believe - there is never a function call of bar.

I came here to say this.

Re: Tips to Become a Better JavaScript Developer

#20
post #15

Second example in tip #2 is dead wrong. JavaScript does NOT do Dymanic Scoping. I suspect he didn't even bother to run the code. His example throws an error when I try it: "ReferenceError: x is not defined" (as expected). blind-leading-the-blind etc.

The first example is wrong as well I believe - there is never a function call of bar.

[deleted]
Post reply on HN