Variables vs. Arrays vs. Objects

August 16, 2012

Having recently worked with a couple of groups developing games, I’ve found myself explaining nuances of programming concepts. Here’s one such topic I find I must cover with new developers: when to use a variable vs. an array vs. an object. I whipped up this quick video to explain the difference, and since summer picnic season is upon us, I leveraged some related food and props appropriately…

Stay hungry, my programmers!


Explaining 4 Key Programming Concepts with Household Items

April 19, 2012

I’ve often found myself providing others with simple explanations of fundamental programming concepts. While I’m by no means committed to writing an Ultimate Programming Primer, my work on The Ultimate PC Primer got me thinking: what analogies, stories, or props would I use to explain the basics of programming/scripting to total newcomers?

First, newcomers need to understand that programming or scripting is the discipline of writing instructions for a computer to follow. In order to be useful, the instructions must conform to a language the computer can understand. Simple scripting (like Javascript for the Web) often involves taking information in textual or numerical form, structuring it, manipulating it, and producing output (like textual or numerical information, or even animation). In short, scripting is providing the recipe (as I call software in The Ultimate PC Primer) for a computer to “cook” something up.

Learning how to write a “virtual recipe” can be difficult, since computer languages, as with real spoken and written languages, require correct grammar. In fact, computers are unforgiving with grammar, and usually they’re not smart enough to guess at what you mean. So, programming is challenging due to the precision required as well as the foreign nature of the structural concepts. And that’s why comparing the intangible to something physical — something from the real world — is often so handy.

Here’s how I explain four of the most common computer scripting/programming concepts to newcomers trying to grasp them, leveraging a few common household items. (Since I haven’t included photos of each of these, be sure to see the video at the bottom of this post to grasp the power of the visuals.) Read the rest of this entry »