Archive for the 'JavaScript' Category

Why JavaScript is so difficult to learn

Sunday, October 19th, 2008

I have been a web developer for more than 3 years. In the process I have learned HTML/XHTML, CSS, Ajax, PHP, MySQL and a few things about HTTP and Apache. And overall this has been a fairly smooth experience. But, for some reasons that I have had troubles to pinpoint up to now, JavaScript is the language that has been difficult to learn.

Blaming it on awkward constructs misses the point

For a while I have been blaming that on some unique JavaScript features such as closures or JavaScript Object-Oriented constructs. But blaming it on those is missing the point.

What makes JavaScript so difficult to use in a browser is that you need to learn much more than just a language!
To understand JavaScript, you need to know about:
- browsers
- the DOM
- the BOM
- a UI platform
- 3 different event models
- web forms
- cookies
- Ajax

You need to learn way more than just a language

When you know all that, you can finally start learning JavaScript and its awkward constructs!
And then you’ll probably learn to use at least one JavaScript library because it will make your life much easier!
And of course you will have to worry about many other concepts such as “progressive enhancements” or “unobtrusive JavaScript”.

The worse is that I am not even kidding, you really need to understand all of the above quite well otherwise you will not make much progress in your JavaScript practice.

So, no wonder JavaScript is so difficult to learn and use well.

But here is the silverlining:
1. This is fun!
2. Once you have developed all these skills, you will have become quite valuable!

JavaScript has nothing to do with Java

Monday, January 1st, 2007

We probably have all stumbled on this one when we discovered the two names Java and JavaScript.

At both ends of the spectrum

Java? JavaScript? Probably the same language, right? Or at least very similar languages, like part of the same family, right? 

A marketing ploy

JavaScript was first developed by Netscape under the name Mocha, and later LiveScript. At that time the hot new language was Java.
I guess someone at Netscape must have thought that it would be cool to give that new language the name of JavaScript, confusing in the process generations of developers, managers and headhunters.

At the opposite ends of the spectrum

So the truth is that JavaScript has nothing to do with Java, except for the fact that both are modern software languages.

In fact if you rank current languages according to how structured they are, JavaScript will rank as one of the least typed, most dynamic, least structured, potentially dangerous and difficult to maintain and Java will rank as one of the most structured, highly typed and easier to maintain.

Why JavaScript?

Monday, November 6th, 2006

Why should you care about JavaScript? Is that because it is a cool language? What about ActionScript? What about Java?

JavaScript is in bed with the big guys!

The main reason you should care about JavaScript is that it has a unique position in web development: JavaScript is in bed with the big guys!

JavaScript is the only real programming language that is understood natively by the browsers: Internet Explorer, FireFox, Opera and Safari. It does not require any plug-in to be executed on the web page.

So, JavaScript may or may not be a great language, but it is the univeral client-side scripting language of the web! That’s why you need to learn it!