Live data from Hacker News

Preparing Yourself for Modern JavaScript Development

codethinked.com

1–10 of 75 posts

Re: Preparing Yourself for Modern JavaScript Development

#2
great post, thanks.

i also highly recommend using popular frameworks and libraries, since lots of them use the tricks mentioned in your article.

Another thing that's worth noting is the JSON Object Notation: http://www.hunlock.com/blogs/Mastering_JSON_(_JavaScript_Obj...

very readable form of declaration.

Re: Preparing Yourself for Modern JavaScript Development

#4
I'd be interested if one of these articles on modularity also addressed testability. For example, the IIFE pattern in the article:

(function(window, $, undefined){ //do some work }(window, jQuery));

If instead of immediately executing this function, we kept a reference to the function, then reference it, the function can be supplied with mocks for testing. Obviously there's an issue that you'd pollute the global namespace with this named function. So what's the best practice there?

Re: Preparing Yourself for Modern JavaScript Development

#8
post #7

This is a nice, gentle introduction, but if you're going to start using modules you might as well go slightly farther and use something like RequireJS ( http://requirejs.org/ ) or Browserify ( https://github.com/substack/node-browserify ).

And then migrate to native ES6 modules when they're implemented: http://wiki.ecmascript.org/doku.php?id=harmony:modules

Re: Preparing Yourself for Modern JavaScript Development

#9

Here are a couple book recommendations for those of you looking to improve your JavaScript: "JavaScript: The Good Parts" by Douglas Crockford "JavaScript Patterns" by Stoyan Stefanov

I've been working on following the good parts for my latest project. I've started to cringe any time people talk about the prototype or using "this"

Re: Preparing Yourself for Modern JavaScript Development

#10

Here are a couple book recommendations for those of you looking to improve your JavaScript: "JavaScript: The Good Parts" by Douglas Crockford "JavaScript Patterns" by Stoyan Stefanov

I've been working on following the good parts for my latest project. I've started to cringe any time people talk about the prototype or using "this"

That's unfortunate. Properly using prototypes and "this" is the only way to do high-performance JavaScript with objects.

Get cozy with them -- they're useful.

Post reply on HN