“Code” 2nd Edition Now Available
charlespetzold.com
charlespetzold.com
"Code" is fascinating for talking about the history and the "Why", while N2T is excellent for giving you the hands-on practice at building one yourself.
Honest question. I don't have the answer or am insinuating anything.
What do I mean? Well, I also acquired all that knowledge, but through a formal university CS degree. Before starting my degree, I was also "just" tinkering and hacking. I had been "programming" for like a decade before that, different languages, solving some problems that I found interesting or practically useful. During my degree though, I got all the details. I had full courses on hardware (transistors and upwards, all the way to CPU architecture), on mathematical logic, on compilers, on programming language paradigms, on algorithms, on complexity theory, on formal methods, in-depth on C++, Java, Prolog, computer networks, databases, cryptography, real-time systems, statistics, and a few more. This also allows me to in-depth describe a "nand to tetris" process, but obviously my education has been much broader than that.
Was it necessary to take that 6-year degree? Would that have been equally well covered by a bunch of Coursera online classes and then a few years of work experience? I really don't know.
I have a small sample set of colleagues who are self-taught and though ambitious are sometimes lacking broader perspective and in-depth understanding of CS foundations (that includes my boss), and of colleagues who went through a similar degree and do have a similar perspective as me, some of them not really remembering what was taught (or not caring), so those samples go both ways. I don't really know anybody without a formal degree who has the full fundamentals groked though. That would let me to conclude that the degree is a good thing, but frankly my sample is too small to tell.
Would I like to study those details? You bet. But I came to that realization in my late thirties, after having changed careers twice, kids, marriage, the whole nine yards. I have responsibilities and am lacking the time and free headspace to sit down and study.
So a course on coursera or Udemy or whatever it is. And little by little I am patching my CS knowledge. Will it ever be as complete as that of someone who started programming in their teens and went straight for the degree? Definitely not. So I agree, if you have the luck and the opportunity to be in the situation to have a chance for a degree and take it, it’s a good thing.
At the same time, I think that it is a good thing that software development/ working with computers in some shape or form is open to people from many backgrounds, similar to the creative fields, because kn the end it is important that you can do your job, not necessarily how you acquired those skills.
Because it enriches the industry. Bringing all kinds of life experiences to the table is a good thing. It is a team sport after all. And T-shaped isn’t limited to software skills.
E.g. I might not have studied CS, but having taught adults in foreign languages for years gives me presentational and pedagogical skills that help me explain the things I do know to our junior devs, because I know how learning processes work.
So I would encourage a more optimistic view on the situation. Not asking what are your colleagues lacking, but asking what else do they know? What did they do, while you were studying CS.
But I don't think that having a degree implies that much either, that really depends on how one studies (to understand vs passing an exam). I've seen way too many software engineers who were absolutely clueless about software and engineering and even more computer science. In fact all of the worse devs I know have a degree, I came to the conclusion they signed up for whatever would give them the easiest good paying job.
Conversely the world has a lot of brilliant computer scientists and brilliant engineers who never entered university. Some are famous like Carmack, most you never heard about.
So yes: I agree that the fundamentels are extremly important. Not necessarily on the level of the individual (depending on her or his role), but for the field as a whole. For me personally the motivation to learn the fundamentals is not so much the need of a foundation to built on. Rather the opposite: When I want to do something, I start doing it and try to refine what I am doing in the process by going deeper and deeper.
I think that's a main difference. With a degree you tend to learn / get taught things upfront of which you don't know whether you'd ever need them, and you may not. You kind of trust, or hope, that what they teach you has some relevance and is useful.
Many subjects from courses I took during my degree I'd never have picked up "on the side" during my jobs that came after. But I can actually also confidently say that each and every course I took left some impressions/concepts in my head that later became useful in one way or the other. So for each course I took, had I not taken it, I'd be missing something. Of course there is opportunity cost: could I have used that time in some better way, i.e., even more efficiently? Not sure. There is also the question about the courses that I did not take because, well, there is only so much space you can cram courses into within 6 years :) but maybe there are diminishing returns as well, since many things tend to overlap.
I think the most important benefit of a university degree is not so much what specific fundamentals you are trained in, but that you get an idea of what it really means to know the fundamentals of a subject and how to get there. Later in your career, you can then use these strategies to deepen your understanding of everything that comes your way. Of course, it is easier if your education roughly matches what you will find on the job. But you never know what aspects of your training might help you later on. In my case, I would say that the many difficult debates and deep essays in philosophy prepared me much better than probably computer science might when it came to working out a plan for a software module with others and writing an accurate specification.
Most programming doesn't require that much math. I had all that you mention in my 3.5 year degree but most of it was math that is not needed/practical for most of work and individuals.
Also, for anyone needing more context on a book called "Code", MS Press has two free chapters, and the TOC, available: https://ptgmedia.pearsoncmg.com/images/9780137909100/samplep...
Not sure if asking about his take on AI will lead anywhere though as that's not really his thing. But I'll explore the area when we talk about Turing (his other book is the Annotated Turing) a bit to see if there's something on the other side that I didn't know about.
I'd be curious to learn about his work habits - have they changed over the years? Has he experienced any procrastination during his career and how he dealt with it? Any advice to those who got bored by the challenges of the modern software industry?
Only now I found that he has a blog, so it looks like I've got some new reading material: https://www.charlespetzold.com/blog/toc.html
Do you have any questions about The Annotated Turing? For me, I'm really interested in the story behind why he wrote it. As he writes in the introduction:
"Turing's original motivation in writing this paper was to solve a problem formulated by German mathematician David Hilbert ..."
I want to know Petzold's motivation for writing this. I know there's a story behind there somewhere especially given how long it took him to write the book :)
Given how old is Turing's paper and how much it was 'dissected' for the book, I would ask the following: * Any other top papers that inspired Charles (or he found them worthy of serious deep dive)? * Does he still read modern papers?
The latter is particularly interesting. I don't have academic background, but some of the people I spoke to claimed that there's lots of subpar papers produced nowadays. Obviously, amount produced in every field significantly increased lately, so it would be interesting to learn how someone with decades of experience is able to filter that out.
https://homepages.inf.ed.ac.uk/wadler/papers/propositions-as...
Page 2 gives some background in how Turing's work fit into the problems that Church and Hilbert were about.
There are a lot of tools like nandgame which would integrate well....
Same thing for adaptations for school curricula, afterschool clubs, etc....
I'm not sure the right solution here, but it'd be awesome if there were some way to build from his work for specific contexts.
I would imagine that the hard part is dealing with the publisher and getting them on board with it as well. Added to my list!
https://mitpress.mit.edu/sites/default/files/sicp/full-text/... https://web.mit.edu/6.001/6.037/sicp.pdf
It's worth noting the book comes up on most top-10 CS books and sells exceptionally well. It's been translated into countless languages.
Convincing MIT Press was apparently hard the first time, but after the book sold like hotcakes, future books were easy.
https://mitpress.mit.edu/sites/default/files/titles/content/...
That might come in handy if this winds up going somewhere.
https://groups.csail.mit.edu/mac/users/gjs/
Not everything is web-based. :)
I can guarantee the author will not be offended with either a phone call or by someone dropping by. On the other hand, he's less often in the office post-COVID, so it might take a few tries.
Hal probably knows the story better, but he's a bit less drop-in-able. Jerry is super-friendly. (Hal is friendly too, but more random contacts go to /dev/null)
Dropping by would be harder to do, but a dream interview would be to put him in a room with Guido van Rossum to talk about Python and SICP.
I now need to get over my irrational fear of cold calling someone I don't know already (heck, I don't even do that with people that I do know - it's always "what's a good time to call"?)
If you wanted to talk about robust programming, quantum gravity, differential geometry, education, or a slew of other topics....
As a footnote, I love Python, but someone like Jerry outclasses Guido intellectually. Guido really only did one thing, which is Python. Jerry has done dozens of things.
I think you misunderstand my motivations for putting the two of them in the same room. If there's one thing that I've learned over my years in this world, it's that the magic happens between people, not within any one person's mind. There are three "people" in my scenario - Guido, Jerry, and the audience. Somewhere in that conversation, an idea might be sparked.
If you put Isaac Newton in the same room as George Washington, it'd be two brilliant people, but I'm not sure they'd have much to talk about. They think about different problems.
What might be interesting, come to think of it, would be a Chat Roulette, but populated with these sorts of folks.
In practice I find this rarely to be the case unless you as the facilitator are also commensurately cognitively capable (say that three times fast), otherwise you're sort of placing an excessively undue amount of pressure on them.
I'd love to hear his thoughts on the current state of Windows: what's going well, what should be done differently.
I wonder if he gets nostalgic for that era of programming, and what stack he would choose if he was writing a Windows app today.
I’d like to know how did he get such deep knowledge of the foundations of computing and how he developed the talent for explaining complex topics in a simple way.
This will be a core part of what we'll be talking about. I continue to be amazed by people who can explain complex topics simply and Charles is near the top of my list of people who can do this well. Feynmann and Dave Cutler (if you can, find a copy of his NT kernel spec doc) are on that list too.
Thanks for the suggestion, looking forward to hearing the episode.
Has he seen any of these he thought were effective, does he think it's a useful approach?
[1] https://store.steampowered.com/app/1444480/Turing_Complete/
Some more examples:
- Silicon Zeroes, focus on clocks and speed: https://store.steampowered.com/app/684270/Silicon_Zeroes/
- Prime Mover, at a somewhat higher data packet level, freer hierarchical structure: https://store.steampowered.com/app/693700/Prime_Mover/
- ComPressure, continuous signals in steam machines! https://store.steampowered.com/app/1528120/ComPressure/
- MHRD, code in an HDL, avoids the routing issue but text can be unappealing: https://store.steampowered.com/app/576030/MHRD/
“Code” 2nd Edition
https://news.ycombinator.com/item?id=31696901 (June, with over 1k points and 170 comments)
per https://news.ycombinator.com/item?id=23071428:
> What decides whether a follow-up counts as same-ish? Whether or not it contains significant new information (SNI), meaning whether or not there is enough new information to support an interestingly different discussion.
> Because those things don't change as a particular release goes through its life-cycle of status updates, status updates don't count as SNI.
That doesn't change the kind of discussion that takes place which is why it's usually the pre-announcements that get downweighted.
Without this post, I, for one, would not have known that I could go online now to read it
Sure but that is at best, a tertiary purpose of HN. Something is always new to someone, relevant to someone, etc. The dupiness or most other on-topic-ness criteria can't really work on that basis.
I'm really interested in creating some on my own, where can I find source code for guides like https://github.com/ncase/trust?
https://www.microsoftpressstore.com/store/code-the-hidden-la...
One topic was Windows programming. I got Petzold's Programing Windows book and nearly read it cover to cover on my break, going page by page and running and reviewing the sample programs provided. I learned a lot about Windows programming and really enjoyed the read.
Topics like this can be written in a dull way, but Petzold managed to present it in a way that was enjoyable to read and easy to understand. I think that says a lot about the quality of the writing because some Windows programming details are pretty arcane!
I stopped writing Windows programs when Petzold stopped doing new editions of "Programming Windows". I'm not actually sure whether or not what was covered in his last one, Windows 8 using C# and XAML, still works on Windows 10 and 11, or if it does whether or not that is all you need.
A lot of the fundamentals covered in 5th edition is still relevant today, but it's probably easier just to look it up online.
In the mean time I've heard this is good:
https://www.amazon.com/All-New-Switch-Book-Switching-Technol...
And then there's your computer network textbooks like:
https://www.amazon.com/Computer-Networks-Andrew-S-Tanenbaum/...
I have the second edition sitting on a shelf and couldn't get anyone to buy it on ebay ;)
The Illustrated Network: How TCP/IP Works in a Modern Network https://www.amazon.com/Illustrated-Network-How-Works-Modern/...
Many CS programs just barely touch on the lower level stuff so this is widely relevant to many in the industry. Its also an easy enough read that even if you have no background, you can follow along and get an understanding of how a computer works.
I’m much less of a read than I wanted to, but this was a book I read from cover to cover almost nonstop on a xmas/new year holiday. Remarkably accessible and dense.
https://www.charlespetzold.com/blog/2022/06/Announcing-Code-...
“I’ll discuss the differences between the two editions in detail in a future blog entry. The short explanation is that I go much deeper into the workings of a CPU using the Intel 8080 as a simple example”
I’ll buy for the 70 pages or so on the 8080, for sure.
To get the PDF version I tried buying the e-book collection from InformIT, but Pearson (that runs the InformIT and Microsoft stores) no longer takes orders from people using a "@fastmail.com" e-mail.
How does what I type and program make a computer do a thing? It was an incredible read and I can’t wait for this one.
> Those problems would probably have been easy to fix, but there existed another aspect of the first edition that continued to bother me. I wanted to show the workings of an actual CPU—the central processing unit that forms the brain, heart, and soul of a computer—but the first edition didn’t quite make it. I felt that I had gotten close to this crucial breakthrough but then I had given up. Readers didn’t seem to complain, but to me it was a glaring flaw.
> That deficiency has been corrected in this second edition. That’s why it’s some 70 pages longer. Yes, it’s a longer journey, but if you come along with me through the pages of this second edition, we shall dive much deeper into the internals of the CPU. Whether this will be a more pleasurable experience for you or not, I do not know. If you feel like you’re going to drown, please come up for air. But if you make it through Chapter 24, you should feel quite proud, and you’ll be pleased to know that the remainder of the book is a breeze.
So yes, some significant difference there, but maybe not worth a repurchase unless you just want it for your library or specifically want to read his take on that material.
The first edition was really great. Excited to see the updates.
Sell prior editions of textbooks using Amazon FBA. Surprisingly a lot of Prime members buy them at decent prices - - even in some cases two editions prior. For a few years every time my library had a book sale, I'd find plenty of them for about $4 each. The hope was to sell them for $20 or more.
Figuring out which ones would sell was a bit of an art, though.
I’m sure this is software related, and I’m on the iPadOS 16 beta, so it may be less of an issue for others. On my phone it folds into the header and truncates, but on the iPad it is super obnoxious.
I hope they fix this though. I’m submitting feedback.
Unfortunately not :(I checked)
If you're fine with a digital option, Archive.org often has scans of books you can either download locally or temporarily "check out" to read on their site like a library (they back it with a physical copy). Seems like they have a scanned version of the first edition.
I also think everyone should know about Sci-Hub/LibGen/MagzDB whether they use those sites or not; most everyone on the internet is seconds away from a resurrected Library of Alexandria and can access tons of scientific papers, books (and textbooks), and magazines, and this is a great thing. They don't have everything, but still there's tons. Looks like the epub for this version is already up.
Fun fact: I actually pre-ordered this book, as it's a known classic. But I only can do that today thanks to piracy.