Category Archives: Coding

Eloquent JavaScript: A Modern Introduction to Programming

It’s amazing how much JavaScript has changed over the years. What was once mainly used for creating pop-up windows, rollover images and the like is now an integral part of the modern web, making web applications like GMail and Twitter possible. I first learned JavaScript from the old No Star Press title The Book of JavaScript, published back in 2000. As was typical back in those days, it began with a good into to variables, functions and loops, then taught you how to do common tricks like open new windows and manipulate HTML framesets.

For nostalgia’s sake, and because I enjoyed it’s older predecessor, I jumped at the chance to read No Starch’s fresh new book, Eloquent JavaScript: A Modern Introduction to Programming. Upon opening it for the first time, it was pleasant to see that No Starch uses the same characteristic typesetting and layout.

Marijn Haverbeke takes an unusual approach for a JavaScript book. Instead of focusing on scripting web pages, he teaches you how to program, and JavaScript just happens to be the language. The book, in addition to covering the usual “here’s how to do arrays and stuff,” features more advanced topics like recursion, object-oriented programming, modularity, and other interesting bits of programming theory. It’s examples are even more advanced than is normal, one chapter focusing on how to split input text into paragraphs and extract relevant data from the sentences.

The book also has a wonderful introduction, one that captures the spirit of programming quite well (besides making you feel like a “mighty wizard”).

To some of us, writing computer programs is a fascinating game. A program is a building of thought. It is costless to build, it is weightless, and it grows easily under our typing hands. If we are not careful, its size and complexity will grow out of control, confusing even the person who created it. This is the main problem of programming: keeping programs under control. When a program works, it is beautiful. The art of programming is the skill of controlling complexity. The great program is subdued, made simple in its complexity.

All in all, a JavaScript book and programming primer that stands apart from the rest. A good book for people who want to learn more than how to copy code snippets, and an interesting read more those who already know what they’re doing.

HTML5 Gets a Logo

The W3C has put up a microsite with the new logo for HTML5. It looks pretty good, certainly better than its predecessors, even if it does have a bit of the “Web 2.0″ look that is finally starting to lose its novelty. I like…

The Pragmatic Guide to JavaScript

There are plenty of books that teach JavaScript from a basic introductory angle. The Pragmatic Guide to JavaScript is a bit different. It’s a lightweight guide (around 130 pages) for those of us who already know a programming language or two. Instead of covering…

Speed Up Your Site With Head JS

Head JS is a 2.3 kilobyte script that makes it easy to asynchronously load your JavaScript files to prevent blocking. It allows the browser to load the web page separately from the scripts, so the rendering process isn’t held up by the download. Non-blocking…

It’s Safe to Use the HTML5 Doctype Today

If you’ve taken a look at Google’s source code lately (and really, who hasn’t?) you may have noticed that they’re already using the HTML5 doctype instead of either HTML4 or XHTML. It’s certainly much easier to type that then hunt down and paste in…

iOS UIFileSharingEnabled Property List Flag

Here’s a tip for you iOS developers. Have you ever noticed how some apps let you copy files back and forth between their Documents directories and your computer from within iTunes? It’s very easy to implement it yourself. As a matter of fact, it’s…

HTML5 May Not Be XHTML, But That’s No Excuse for Sloppiness

I was reading an interesting post about HTML5 and the failure of XHTML strict parsing recently, and it reminded me of an issue I have with the HTML5 spec. It really bothers me that the HTML5 spec permits the use of quoteless attribute values…

A Few Resources to Get Started With iPhone App Development

Want to write an iPhone app? Assuming you have a couple of necessary prerequisites, namely a Mac and an iPhone or iPod Touch, it’s not too hard to get started. It is best if you have some programming experience, as even I had a…

Generate QR Codes On-the-Fly With the Google Chart API

You’ve probably seen a QR code before, even if you didn’t know what it was at the time. It’s a little square matrix barcode that can be read by either a specialized scanner or a cellphone with the right software. UPS puts QR codes…

What is the Best Comment in Source Code You Have Ever Encountered?

Here’s a fun Stack Overflow thread from last year: What is the best comment in source code you have ever encountered? It’s eighteen pages of code snippets with amusing comments, ranging from simple warnings like “// Magic. Do not touch.” to cleverly-named objects: It’s…