Thursday, April 30, 2009

Review of Code by Charles Petzold

My March reading assignment from my Mensa-smart and somewhat geeky boss looked to be a dreary experience and an unhappy replacement to my usual murder mystery bedtime reading. I was to read Code by Charles Petzold. It appeared that Dr. Neil had discovered my most coveted secret! I am a technically-challenged technical writer. Now I know I’m not the only one of you out there; having successfully worked in the field for over six years I have encountered many peers in the same unlikely situation, so please read on because there is hope…

You might skip over Code on the shelf these days, assuming it is hopelessly out of date like all the other programming books of the early 2000’s. Not the case with this one, for it offers a true account of the foundation of all things technical. Can a history book ever be deemed obsolete? Does math ever go out of style? Neither should this book ever go out of print.
Little did I know that the answer to the gigantic question mark in my head that I daily ignore (apparently the elephant in the room) about the magic black box that I sit in front of exists in one book! Code offers a basic walk-through of electrical engineering, and here lies the foundation of computer technology. The book begins with the most basic of scenarios (two kids with blinking flashlights) and moves through the development of the first telegraph, up to creating a basic computer.
It turns out it is all about switches! It seems that everything is about yes/no logic gates using electricity to tell little switches to turn on (1) and off (0) via the not so mysterious motherboard! Each little switch represents a bit of information, and eight bits equal a byte. A byte of information holds eight bits, or eight possibilities of 0/1 combinations, or 256 pieces of information.
I have a pair of Vivienne Westwood boots. All girls who have a pair of Vivienne Westwood boots are fashionable. Therefore, since I am a girl and I own Vivienne Westwood boots, I am fashionable. This is an AND-gate tautology, an unambiguous truth according to Boolean logic. The computer sees all things as unambiguous truths or falsehoods as determined by logic gates resulting in switches being turned on and off. AND, OR, and NOT operators (simply a way of including, excluding, or negating bits) work as conjunctions in statements, and the computer is always adding these statements together to be true or false. That is how complex messages can be communicated by binary code. (When the computer is not asked to do anything and it is idling, I wonder if it experiences existential crises like I do and wants to go shopping).
Computer languages are either low level or high level. Low level languages are easy for the computer to understand but hard for people to understand because they are written to easily convert into binary code. High level languages are easy for the programmer to understand but require a compiler and assembler to translate the high-level code to machine code (binary code). A compiler translates high-level code into assembly level code. An assembler is simply a program whose only purpose is to translate assembly code to machine code. An interpreter, by the way, is a whole different ball game – it translates one line of code at a time and doesn’t require an assembler, but it is very slow.
The book finally started getting into graphical interface and more modern specific technologies towards the end. As I see it, the computer screen is simply made up of pixels that are either on or off (1 or 0) to form images on the screen. Color screens work using bitmaps, which are tiny squares with different intensities of color as controlled through a semi-conductor that releases an electrical charge when exposed to light.
I bravely embarked on this walk with high hopes. I’m a smart girl (or so I was told when I was a teenager), and had high expectations of myself from this book. It would solve all my questions about how computers work and unravel the mysteries of coding. It did accomplish the goal mostly. I read the whole book, but could probably benefit from reading it again in a couple years. Like a good but complex movie, it contains nuances that I know I missed, and promoted flashes of insight at times that I would be hard pressed to repeat in my own words. While it didn’t teach me how to code, it did tell me why we need code and the importance of writing code correctly.
The book was readable, funny at times, and highly stimulating. Petzold writes in such a way that you are pages in before you, as a Vivienne Westwood boot owning and shopaholic girl, realize that you are supposed to be bored by this type of material, and that you’re not. I am now ready to move forward into the world of coding, and soon perhaps my developer coworkers will be coming to me with their questions!

To purchase Code by Charles Petzold, simply follow this link: http://www.amazon.com/exec/obidos/ASIN/0735611319/roodynet-20.

No comments: