Javascript Programming: Part 2

Basic Programming Concepts: continued

Like spoken languages (ex: French, English) programming languages have rules (grammar, spelling, etc) and meaning for certain special key words. In English the word ‘throw’ has a meaning; it means to ‘toss’, ‘pitch’, ‘fling’, something or someone.

One such ‘key word’ in JavaScript is the word ‘function’; this keyword tells the computer that this is the beginning of code (programming code) that does something, or in other words, takes an action. (Before I go on: do not make a common mistake and confuse ‘JavaScript’ with ‘Java’ – they are two totally different things!!) Here’s a made-up example for JavaScript:

function: Pop up a box and say: ‘What’s up Jimmy? ‘

This made up example (not real programming!) is telling the computer to pop open a box and say: ‘What’s up Jimmy?’

Just for the curious, I will now show you the real way to do this with Javascript:

function popupMessage()
{
	alert("What's up Jimmy?");
}

What’s that supposed to mean? I know that for many of you this is already very confusing, but hold on, it’s well worth it!

Programming languages have other words (besides ‘function’) that have special meaning – special meaning that tells the computer what to do. So when you are programming, you are using special keywords to tell the computer what to do.


You use programming to write (in other words: create or build) software (ex: Mircrosoft Word, Internet Explorer, and even Windows!) and software enables you to more easily control your computer.

Computers are really, really stupid. So stupid in fact that if you were talking to a computer directly, you would have to use a very simple language that is so slow to write, that it becomes very difficult to get anything done since you have to explain every single step to the computer. How simple you ask? So simple that even something like printing the letter ‘A’ on screen could take you days to build because of all the code you would have to write!