Live data from Hacker News

“Code” 2nd Edition

charlespetzold.com

111–120 of 176 posts

Re: “Code” 2nd Edition

#113
post #111

Charles Petzold has a blog? With an actual RSS feed? I swear this is the first new blog I've added to my RSS feed reader in over a year.

Seconded - it's fabulous to find that not only is he writing, but writing posts with titles like:

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.

Re: “Code” 2nd Edition

#114

"Programming Windows" exposed the simplicity behind the Windows architecture. If you had even a smattering of C experience, Petzold could get you writing Windows applications the same day you opened his book. He triggered an explosion of software development. There are excellent books for novice Linux programmers, but unfortunately, nothing compared to Petzold's clear and direct presentation. .

"Simplicity of the Windows architecture"? I wish I had read his book, because I read many other bad books and Win32 always felt so complicated.

Re: “Code” 2nd Edition

#115
post #71
post #55

Earlier quoted context omitted.

What makes this book great is that it more or less only assumes you know how an on-off switch works. Then he goes on to teach you how a (although rather primitive) CPU works and how you would program it. 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 w…

> assumes you know how an on-off switch works. Really he explains how that works too. It's reasoning from first principles at its finest. I wish school curricula were so well-designed.

The best and most useful in a long-term classes that i took in college were first-principle-taught classes, even if they weren't directly related to any work i did at the time (or ended up doing in the future).

The one I remember dearly was CS2110 at Georgia Tech. Most undergrads shuddered when they heard of that course and tried to avoid it, but it legitimately opened up my eyes to how computers "really" work. The class started all the way from logic gates, to building your own 8-bit APU using those logic gates (in a simulator), to writing some assembly code, to programming a gameboy game, to implementing your own malloc. And the continuation of that course, CS2200, was great too, which started with using logic gates and basic APUs (the kind you implemented yourself in CS2110) to build a primitive CPU pipeline (in a simulator as well).

I cannot ovestress how useful that understanding (no matter how basic it was) ended up being later on in my career, despite me doing mostly webdev for the first 5 or so years out of college. It basically turned my knowledge from "i know how to write code" to "I understand what I am actually doing on all levels of the stack (even if that knowledge is rather simplistic for the lower levels of that stack)". Came in pretty handy when I discovered a bug in one of the early versions of the TypeScript transpiler as I was writing my webdev code. Pretty certain I would've been completely stumped by my code not working if I didn't have an intuition for digging in that direction (which i definitely wouldn't have had, if it wasn't for that class).

Everything in that class was building up so well off what was learned earlier in the class, I was wowed. I actually felt like i understood how those things were naturally "discovered" for the first time back in the day. Basically, it was the difference between "here is a formula, here is what it does, here is how you should understand it" and "here is what you know, here is a concern you might want to think about next, oh congrats, you just 'discovered' this well-known concept following the same train of logic that led to it being originally 'discovered'".

Re: “Code” 2nd Edition

#116

Earlier quoted context omitted.

When the book “builds” a computer, I’m assuming that’s a virtual computer? If so, what language does it use?

If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code : https://www.nand2tetris.org/ . Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?

Re: “Code” 2nd Edition

#117
post #22

Earlier quoted context omitted.

Uh, as someone with too many years of programming behind me to imagine that, can you mention some concrete things that you found arbitrary or completely mysterious, and that the booked cleared up for you? Thanks.

I'm not the OP, but some personal examples: - 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 th…

> why is it called 2's complement?

And why the apostrophes in two's complement and ones' complement are in different places.

Re: “Code” 2nd Edition

#118

Earlier quoted context omitted.

If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code : https://www.nand2tetris.org/ . Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?

You program in HDL using the Nand2Tetris software suite [1]. Super fun - I went through the book on my vacation last year. Highly recommended.

[1] https://www.nand2tetris.org/software

Re: “Code” 2nd Edition

#119
post #5

This book (1st edition, at least) is astonishing. Perhaps the best book for coders that I’ve ever read. I recommend it to all the HN crowd. 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.

The content is something we learn in universities, even deeper. I think it's good for self taught programmers

Maybe where you went, but that definitely wasn’t the case in my CS degree. Code is really great and he’s a better teacher than most of the professors I had.

Re: “Code” 2nd Edition

#120

Earlier quoted context omitted.

If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code : https://www.nand2tetris.org/ . Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?

Nand2tetris uses its own version of Hardware Description Language (HDL). You will also write a compiler for it's own language called Hack.
Post reply on HN