Code: The Hidden Language of Computer Hardware and Software

Author: Charles Petzold
All Stack Overflow 20
This Year Hacker News 7
This Month Hacker News 1

About This Book

In CODE, they show us the ingenious ways we manipulate language and invent new means of communicating with each other. And through CODE, we see how this ingenuity and our very human compulsion to communicate have driven the technological innovations of the past two centuries.

Using everyday objects and familiar language systems such as Braille and Morse code, author Charles Petzold weaves an illuminating narrative for anyone who’s ever wondered about the secret inner life of computers and other smart machines.

It’s a cleverly illustrated and eminently comprehensible story—and along the way, you’ll discover you’ve gained a real context for understanding today’s world of PCs, digital media, and the Internet. No matter what your level of technical savvy, CODE will charm you—and perhaps even awaken the technophile within.


by fauria   2018-01-07
Chapter 22 of "Code: The Hidden Language of Computer Hardware and Software" uses CP/M to illustrate the inner workings of operating systems. I highly recommend this book overall:
by Ignyted   2017-12-06

While a formal education covers most of these questions, they are still important to brush up on every now and then. My next book I will be reading is something that I believe might fall in line with what you're looking for.

by vayn23   2017-12-06

Just to include a slightly different angle, the author of this book gives a fascinating description of how you could build analog mechanical logic gates using telegraph switches.

by DeTrueSnyder   2017-12-06

You'll do little to no traditional math but you will use Boolean Algebra all the time. A lot of what an admin does is identify parts of a process that can be automated from existing data. Since very little of the data in Salesforce is numerical you'll rarely do traditional math.

I constantly recommend this book to people transitioning into CS from other careers because it explains why Boolean Algebra is so important to how systems work and is extremely entertaining. It also doesn't have a single line of code in the whole book. It's really just about the concepts that power code and how these concepts can be applied in any system.

With all of that said, the Salesforce ecosystem is so large that you don't have to be an admin. If you like teaching but want a raise there are tons of companies that hire Salesforce trainers. They are typically salesforce admins that really enjoy working with users over development. Get your cert, get some experience then find your niche.

by userbinator   2017-10-16
Teaching CS is hard but I think the root of it is our ability to teach people how to think. Learning to program is easy compared to the problem of learning how to think algorithmically.

IMHO this is because a lot of CS courses start at a very high level with very abstract concepts, which might also be because they can't afford to start with the very basics of "how does a computer work" due to the limited time available.

On the other hand, I think CS should always start with a book like this one, which truly does start at the basics:

A large part of why beginners fail is because they expect too much of, and don't comprehend, how the machine works. I believe that once they see how this complexity is actually the result of a large number of very, very simple operations, they will have a better understanding of what it means to instruct the machine.

by relics443   2017-08-20
I still haven't read anything better than Code by Charles Petzold [1] and it's not even close.


by anonymous   2017-08-20

To multiply by any value of 2 to the power of N (i.e. 2^N) shift the bits N times to the left.

0000 0001 = 1 

times 4 = (2^2 => N = 2) = 2 bit shift : 0000 0100 = 4

times 8 = (2^3 -> N = 3) = 3 bit shift : 0010 0000 = 32


To divide shift the bits to the right.

The bits are whole 1 or 0 - you can't shift by a part of a bit thus if the number you're multiplying by is does not factor a whole value of N ie.

since: 17 = 16  + 1 
thus:  17 = 2^4 + 1

therefore: x * 17 = (x * 16) + x in other words 17 x's  

thus to multiply by 17 you have to do a 4 bit shift to the left, and then add the original number again:

==> x * 17 = (x * 2^4) + x 
==> x * 17 = (x shifted to left by 4 bits) + x 

so let x = 3 = 0000 0011 

times 16 = (2^4 => N = 2) = 4 bit shift : 0011 0000 = 48

plus the x (0000 0011)


    0011 0000  (48)  
+   0000 0011   (3)
    0011 0011  (51)

Edit: Update to original answer. Charles Petzold has written a fantastic book 'Code' that will explain all of this and more in the easiest of ways. I thoroughly recommend this.

by anonymous   2017-08-20

Two really great books come to mind.

Also, online you can read Bit Twiddling Hacks.

by anonymous   2017-08-20

For these languages, broadly, return ends the current function and returns execution flow to the calling function. You can optionally pass a value after the return statement which is the result of the current function in the context of the calling function.

For example:

void CallingFunction() {
    int x = OtherFunction();

int OtherFunction() {
    return 3;

The return statement ends OtherFunction(), i.e. any other statements after the return would not be executed, and the value of x in CallingFunction() will be 3, since that is what OtherFunction() returned.

This idea of functions and returning values is a very basic, core concept for this style of programming. As others have pointed out in the comments, you really should check out a book or find a mentor who can help you get started.

Code is a very easy to read, high-level overview of the concepts you'll need.