On JavaScript, Objects and Inheritance…

Over the past few months I have dedicated myself to learning JavaScript. By this, I mean, not just being able to use JavaScript, which I have done for many years, but learning the language. To me, this meant stepping beyond doing some DOM-scripting in jQuery for some cool effects, but rather learning the core concepts of the language. For someone who spent many years trying to perfect an understanding of object-oriented programming principles, this can be a tough transition (not that I had OOP principles perfected either). The JavaScript language is not just syntactically different, but fundamentally different – being prototype-based among many other things.

As the JavaScript community continues to grow, there seems to have been much debate about these differences. Some people try to recreate things from classical OOP in JavaScript, like classical inheritance and strict(er) typing. Still others argue that by doing this, you ignore what makes JavaScript uniquely powerful. We’ve covered a little bit of both ends on the ADC, starting with Keith Peters’ popular article “JavaScript object creation: Learning to live without ‘new.’” More recently, I wrote about doing “Pseudo-classical object-oriented programming in JavaScript with Minion.” The latter focuses on one of many libraries that allow you to create objects that mimic classical inheritance and allow for more traditional namespacing and extending of objects. To be clear, I am not taking a side in the debate – something I don’t feel quite qualified to do at the moment. However, I do think it is an important topic and worth exploring both sides of the debate. I plan to continue to cover on the ADC in various forms whether it be in examining languages like CoffeeScript to other libraries/frameworks that offer differing “solutions” to these issues to covering fundamental language concepts in JavaScript.

Hopefully, you find these topics as fascinating and thought-provoking as I do. As always, I welcome your feedback on items we publish on the ADC as well as ideas for topics you’d like to see (and, remember, we even have a forum dedicated to getting your feedback).

Comments are closed.