JavaScript: The Good Parts

JavaScript

In my quest to master the craft of programming I have committed to learning something new every few months. Some time ago I realized that the JavaScript ecosystem has been booming and maturing with more and more noteworthy frameworks and libraries to look at. Projects like Ember and Angular make front-end development completely different from hacking the DOM with a list of jQuery modifications. To understand them one has to grasp a new philosophical approach to writing JavaScript and also realize what this programming language really offers. While on the task of getting hang of the basics with the frameworks I found myself relearning the way I thought about the language under them. I became a beginner yet again after seeing the gaps in my basic understanding of JavaScript. Next goal I took upon myself was relearning the language and I found synchronization with Douglas Crockford's ideas.

Crockford notes that JavaScript is both the world's most misunderstood and the world's most popular programming language at the same time. It is added in all of the major browsers and while it took luck and coincidence getting there we can not neglect its reach and success in the web environment. There are however several things wrong with the language and many poor design decisions were shipped in a hurry at Netscape 20 years ago. But a developer must not use the bad parts in JavaScript, the language has very good parts and to understand both sides a book called JavaScript: The Good Parts is often recommended.

The Bad

  • global variables
  • semicolon insertion
  • unhelpful typeof operator
  • evil eval
  • with statement
  • type coercions on comparison statements
  • '+' adding and concatenating
  • too many values evaluating to false

The Good

  • anonymous functions
  • dynamic objects
  • object, array and regexp literals
  • json
  • loose typing
  • prototypal inheritance

The Book

The book is short but dense. I enjoyed the concrete to-the-point style, clear arguments for and against features of the language. Found myself agreeing to listings of both parts and definitely improved as a programmer while reading. Only parts of the book I did not find valuable were railroad graphs explaining the syntax grammar.

So should you read it? If you think you may feel as I did before picking it up or you think you know JavaScript but it regularly bites you and makes you believe that it is a shitty language - you need to read it. If you are totally new to programming or JavaScript you are not ready since you have not formed your opinions on the topic yet and should add the book to your to-read-list to get back to it later. If you really are a guru then you have probably read it already or don't really have to. If you are not sure which way you fall watch the authors amazing talk on the topic first and then get the book.

Having not read any other books on JavaScript I can not confirm that this is the best one but I am sure you are not going wrong if you pick it up.

Comments !

social