JavaScript is More Complex and Important than You Realize

DZone 's Guide to

JavaScript is More Complex and Important than You Realize

· Web Dev Zone ·
Free Resource

Kudos to Michael Woloszynowicz for pointing out that the JavaScript experience on the resumes of most people is worthless. If you tried to interview most people on JavaScript beyond the basic stuff, it would be a one-sided monologue. To be fair, these developers are much better at the language they consider their primary one and JavaScript often comes as an afterthought. There are several frameworks that hide the complexity of pure JavaScript and allow you to code much of the functionality you need.

I was reminded of the power of modern JavaScript recently when working on a Google Chrome extension that required, among other things, DOM manipulation and cross-site Ajax requests. In a sense, it was like “Inception” as it required going three levels in injecting HTML elements into a web page that I hadn’t created, making Ajax calls and then using the callback to inject more content and elements into the previously injected elements (you have to visualize where you were before you made the call). I initially tried to use JQuery, but on hitting some roadblocks, decided to go bare metal. It was more hard work than I anticipated, but became fun as I figured things out. Of course, I was able to cheat a bit as the code had to run only on Google Chrome.

Anyways, looking back on my feelings about JavaScript in the past, I have been very wrong. Because of the multitude of browsers out there, writing JavaScript was a mess. It was very difficult to write and test for different browsers and their versions. Possible, but difficult. You had to decide not to support some browsers, write to the most common denominator, or detect different browsers and code accordingly. CSS had similar issues too. In retrospect, something like JQuery was inevitable.

Also, there was a point when Internet Explorer ruled the browser world. Then, we didn’t have many examples of how JavaScript could change the user experience beyond drop-down menus and (misguided) client-side validation. I didn’t think that we would again see a browser war. But that was proved wrong with healthy competition among Firefox, Chrome, IE, Safari and Opera. More powerful computers, browsers, JavaScript compilers, frameworks, ACID tests, etc. have created greater momentum for JavaScript. I was recently stunned by how fast Microsoft released an IE 10 Preview that is much faster than Chrome, something that would have been unimaginable in the IE 6 days.

Today, JavaScript is a way different beast. You can simplify your development while increasing the power of your application. Better performance, responsive screens, visually appealing user interfaces. You can export the functionality of your web application to other web sites. Forget Flash – use JavaScript. And so on.

Of course, all this power doesn’t come free. There are new things you need to learn. But while it is more complex than you think it is, it is not more complex than you can handle. As Michael suggests, start doing some coding. I would suggest thinking of some problem that will probably take you around 20-40 hours to complete, so that you cannot complete it in one sitting. This will allow you to get stuck in some coding challenge, and think about it while you are away from your computer, thus allowing yourself to understand the concepts better. There is no better way to learn new things than hitting a roadblock and then finding a solution.

From http://www.thoughtclusters.com/2011/04/javascript-is-more-complex-and-important-than-you-realize/


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}