It goes really well with Elements of Computing Systems (2nd ed) [2] which I kind of think of as a "lab manual" where you get to build a computer from first principles.
[1] https://www.amazon.com/Code-Language-Computer-Hardware-Softw...
[2] https://www.amazon.com/Elements-Computing-Systems-second-Pri...
Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.
He goes: electricity, relays, logic gates, circuits (like adders), CPU, RAM …
It’s been awhile so I might have missed a step or two. You’ll come away knowing how we used electricity to get from lightning bolts, to pocket computers. You will not come away with a programmable machine.
It’s not a book about implementing a particular computer - it’s more about giving you the rough thought process about how it actually works at the level of electricity and wires, and how this gets built up into something that actually calculates stuff.
It’s the first book that took me from “computers are mystical magic” to “computers are understandable magic”.
While I understand many “get started programming” books/tutorials put an emphasis on getting coding asap, I really had to stop and learn about computers before I could start coding in a well rounded way (and that’s coming from a WebDev, who doesn’t even have to deal with low-level stuff too often!).
Thank you Mr. Petzold!!!
- why is little-end / big-end a thing?
- why is volatile memory called volatile? and why can't we just keep that data around?
- what can a 64-bit computer do that a 32-bit computer can't?
- what do people mean when they say "code is data"
- what's an instruction, really?
- how did people program computers before they had screens?
- how did people program computers before they had keyboards?
- why is it called 2's complement?
And others that I can't recall right now. It's a fantastic book and I recommend it to everyone who is the slightest bit interested in how computers work.
- The terminal was completely foreign to me. Why is it structured so? How are permissions set? Octal?!?!?!
- Why do I have to specify a type in a programming language?
- What/why are all these special characters used in programming?!
- Why is a program structured in the way it is? What are the levels of abstraction working in a given program?
- What happens when I run/compile my program?
I would also say that learning a little bit of C also really helped illuminate computers for me. Not only in the sense of how they work, but also why programs use their current syntax. For example, for developers who look at Javascript for the first time seeing parenthesis, colons, curly brackets, etc all make an initial sense: they seem familiar. However, to somebody first diving in all of these characters seem totally arbitrary! Having gained a sense of how computers worked and then a very basic introduction into low-level programming, suddenly these high level languages seem much less arbitrary.
The teaching style in this book is so unbelievably good that even if you know all the ins and outs of a computer you want to read on because he explains everything in a way that you wish that you would have come up with yourself.
I suspect I have a completely different mental model than them - just a completely different casual understanding of it. I find it hard to imagine how they must see the modern world. It must seem like magic!
Note that I’m not at-all speaking about intelligence here. Just knowledge.
Anyway: for that person, I think that if they read ‘Code’, their entire understanding of the world would change, which is sort of amazing.
Had several teachers who utterly refused to provide that, repeating "it'll all make sense eventually." Well, it did, after I got better teachers.
Reading it, I felt like I actually understood how computers worked, right down to the “electricity going through wires” level and lower, and how that builds up to if-then statements, etc, in a high-level language.
Obviously everyone's experience will be different but I think of a CS education more of treating computers like an abstract machine, not a physical one.
There are excellent books for novice Linux programmers, but unfortunately, nothing compared to Petzold's clear and direct presentation.
.
I had spent many hours on BIX and CompuServe and maybe GEnie helping other Windows programmers get their start.
So I like to think that in a small way I contributed to Charles' success in educating a generation of Windows programmers.
Remember, friends, always pass it forward.
Consider creating a child process in GNU/Linux:
fork();
Vs in win32’s asinine API:
CreateProcess( NULL, // No module name (use command line) argv[1], // Command line NULL, // Process handle not inheritable NULL, // Thread handle not inheritable FALSE, // Set handle inheritance to FALSE 0, // No creation flags NULL, // Use parent's environment block NULL, // Use parent's starting directory &si, // Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_INFORMATION structure )
And in the end it turned out that it’s not worth programming windows any more. Just use Qt, Java or the awful web technology of the day and you’ll probably be better off than with whatever MS is recommending.
Do you have any suggestions in this regard?
There is also a companion website that is under construction that already has a delightful amount of interactivity, showing how binary switches, relays, and gates work:
Also: i found a book i always was too scared of starting to read (because i didn‘t want to feel like the biggest idiot trying to read it): „The Annotated Turing“. When i looked at it again after having read „Code“, i saw it was also written by Petzold. The way he wrote „code“ i know, that this will be great. I am very excited to read it when i have a few hours to fully block for it.
I think it's especially good for people like me who work in software development but don't have a computer science degree or background. Going from scratch and the very foundations of telegraphy all the way through to what opcodes really are and how code actually works in memory was an eye opener for better understanding what coding really is.
We can't just all sit at the top of the tower and wonder why is it behaving irratically! Please support by purchasing the book.
My first semester in college, I took a class in semiconductor physics. That started with the PN junction, to diodes, to transistors, to gates, to flip-flops, to clocking, to registers, adders, etc.
Later on, this made learning microprocessors straightforward, then assembler, then C, etc.
I suppose it would have been faster to go straight to programming, but I am happier knowing how it works all the way down.
I never got the Z-80 kit but I eventually got a computer with DOS, which had QBasic, where I learned to code by modding GORILLA.BAS and NIBBLES.BAS. What a weird language, there was AND and OR, but not NOR, XOR, NAND and others...
It also partly inspired my first efforts at building a scientific calculator (which would never be quite finished).
I definitely recommend it for folks who want to build context on the lower levels of computers, as a start into understanding CPUs, binary/hex, and other parts of how we tricked sand into thinking with lighting.
https://bookshop.org/books/code-the-hidden-language-of-compu...
Its definitely a bit more more expensive (~$37 vs $32) than ordering it via links in post.
All you have to do is add a '0' to the front of each ASCII sequence to make them 8 bits instead of 7 bits, and then they will be UTF-8 encoded.
I swear this is the first new blog I've added to my RSS feed reader in over a year.
http://www.charlespetzold.com/blog/2021/08/Screw-You-Microso...
no M$-lapdog, he. I learnt my Win16 from the first edition of "Programming Windows" and would have learnt my modern UI from the newest edition if MS hadn't been so busy throwing the bathwater out with the Windows Phone baby that I lost heart.
But it is useful for a lot of people who don't know how a computer really works.
I finished my Electrical and Computer Engineering undergrad in 2008 and have been a software dev ever since.
You won't learn anything new if you had computer architecture and digital logic classes. But it's an excellent refresher. And so well written that it reads more like light fiction than a technical deep dive.
"In a famous 1907 paper on relativity, Hilbert's friend Hermann Minkowski would coin the word Zaumreit or spacetime."
Zaumreit literally translates to "bridle riding" and is probably a play on words, Raumzeit means spacetime. This has puzzled me for over a decade now. How does this even happen?
I'm guessing the author remembered the word incorrectly and wrote it down that way. It's not hard to transpose two letters when you don't know the language.
So I'm really glad there is a second edition and I'm wondering if there is a new story.
We would read the book create a “clean room” implementation of a computer with Minecraft redstone.
It’s great fun! He was overjoyed when we got our first 1-bit memory cell.
As Alan Kay famously said "People who are really serious about software should make their own hardware". No need to develop a whole computer, just getting your hands dirty with more basic electronics than consumer hardware will make you a much more complete technician.
there is a hair rising line in that book in italics! almost like in a horror book like exorcist or dracula.
'turn the book on its side. can you see it?, its counting'
hair raising stuff. thanks mr petzold.
He needs to write more books, that is his Gift and Calling.
PS: Andrew Tanenbaum's Structured Computer Organization makes a very good followup to Code.
There's other books out there, and Ben Eater's website, that indepth show how to construct processor, gates, store "memory", and so on.
https://www.networksfromscratch.com/
It’s nowhere near done, but I’m steadily working on it.
So I imagine any online retailers where you might be able to preorder technical books. If you are not adverse to doing so, it can probably be pre-ordered in the coming months on Amazon, as well.
[1] blackwells.co.uk