05.01.2013 Views

hide - Understanding jQuery

hide - Understanding jQuery

hide - Understanding jQuery

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Learning JavaScript Object Definitions<br />

When I was learning to write programs for the PC back in late 1990s, I have chosen C++ as my<br />

first programming language. Back then, you had to understand things like the command line<br />

and knowing what IDE (Integrated Development Environment) to use. In other words, you<br />

couldn’t just type up some code into Notepad and expect Windows to execute your program.<br />

The code had to be first compiled and only then executed. This is still how compiled languages<br />

like C++ work today.<br />

But HTML and JavaScript are much more accessible. In fact, their popularity among web programmers<br />

can be accredited to how easy it is to get started with them. The browser does the<br />

compiling and execution of your program. You just write the code.<br />

In order to run a C++ application on a Windows computer, the program has to be first compiled,<br />

built into an executable file that the Operating System understands and then launched<br />

by executing the file. The browser such as Internet Explorer, Firefox and Chrome are all examples<br />

of a desktop application that was compiled and built into an executable file first. When<br />

you click on its icon to launch the browser, you are executing the file that has been built by<br />

developers of the browser.<br />

But JavaScript and HTML code run directly inside the browser. There is nothing to compile or<br />

build. The program executes after it is processed (compiled and built into machine code) by<br />

the browser. This makes it incredibly easy for anyone to start writing JavaScript code. But that<br />

can be dangerous.<br />

Very often people jump into memorizing what a line of code looks like from online tutorials<br />

and books and then try to recreate it in their own programs with different parameters. But this<br />

approach to learning a language leads to confusion in the long run because of the lack of understanding<br />

internal mechanics of a language.<br />

Even though the process of writing the code was made easy by the automatic JIT (Just In<br />

Time) compilation right inside the browser, the problem still arises when it comes to learning<br />

53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!