computer code

Whereas I was able to put my new HTML and CSS skills to immediate and continuous use, reading about JavaScript and jQuery has been, for me, more esoteric. Web developers use JavaScript and jQuery daily. But for the rest of us, they are less obviously useful. The amateur web developer may find them to be less accessible—for example, hidden in the themes and plugins installed on websites.

Nevertheless, reading a hefty book about these programs has been a fascinating journey. Here, in random order, are some things I learned from making my way through JavaScript & jQuery by Jon Duckett.

Computaz follow rulz.

Of course, I knew this before, but the book really drove the point home. Computer code never involves anything mystical; it’s always a mere sequence of characters. Code can seem mystical when a program behaves in ways you don’t understand, but there is always a reason for why the computer behaves the way it does. The programmer’s job is to find it—which brings me to my next point.

Computer programs are so complicated that not even programmers understand them.

As Duckett notes at the beginning of his chapter “Error Handling & Debugging,” “Programming is like problem solving: you are given a puzzle and not only do you have to solve it, but you also need to create the instructions that allow the computer to solve it, too. . . . When writing a long script, nobody gets everything right in their first attempt.”

This is why programmers perform a lot of tests before putting their code out into the world. It’s also why tech support people might not be able to solve your problem immediately. They need to tinker.

JavaScript and jQuery create interactivity in a website.

If you want a static page full of text and images that the user can read and look at, HTML and CSS work just fine. However, if you want the page to respond to the user differently based on what the user does, you have to give the computer precise instructions that indicate what it should do in each case: you have to provide a script. For example, a script could say that if the user does not fill in a required field (a field is a box the user can type in), an error message should appear, and the submit button should not submit any information. Another script could say that if the user clicks a delete button, something disappears, while if the user clicks a plus symbol, a field appears.

jQuery is a shortcut through the complexities of JavaScript.

JavaScript code often has to do things twice: once for most browsers and again for Internet Explorer, since IE often obeys different commands. Duplicate instructions are also often needed because many commands recognized by newer versions of the browsers are not recognized by their older versions. The purpose of jQuery is to negotiate these and other issues behind the scenes. It’s a shortcut. Developers can do the same things in jQuery as they can in JavaScript, but jQuery requires them to write fewer lines of code.

Programming languages are languages.

While there are important differences, computer languages are similar to human languages in many respects. As in written human languages, characters and combinations of characters in JavaScript and jQuery have distinct meanings, and how they are strung together matters.

As a language lover, I was intrigued to learn new meanings for old familiar characters. For example, I learned that  !  means “not,”  ||  means “or,” and  ;  means “end of statement.”

As an English speaker, I felt lucky when I realized that JavaScript and jQuery contain many similarities to my native language. For example,  if  means “if,”  .hide()  means “hide,” and  getElementById  means “potato soup” . . . kidding! It means “get element by id.”

You don’t need to know how it works, just how to interact with it.

Duckett informs the reader that, when interfacing with exterior scripts or programs, “You do not always need to know how a script or program works, as long as you know how to ask it to do something, and how to process its response.”

What a relief! There’s so much I don’t know about computers, so it’s comforting to be reminded that a lot can be accomplished with a very small subset of knowledge.


Why should non-coders care about any of this?

Computa rulz stand behind our interactions with the Internet and other technologies. Computer code is like the man behind the curtain in The Wizard of Oz. It seems awesomely, terrifyingly powerful—until you peek behind and realize that, while there are complexities, there are also relatively easy ways that you can interact and understand.

What knowledge and thoughts do you have about computaz and their rulz?