Live data from Hacker News

“Code” 2nd Edition

charlespetzold.com

31–40 of 176 posts

Re: “Code” 2nd Edition

#31
post #22
post #10

This book was absolutely essential when I was first sinking my teeth into software programming. Things that seemed either arbitrary or completely mysterious suddenly made sense now that I had a contextual understanding of how computers worked . Without having that knowledge, I think my career would have been vastly more difficult and frustrating. While I understand many “get started programming” books/tutorials put a…

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.

That's a great question. I started out as a programmer having been a casual computer user through my childhood/teenage years. I never took apart computers or ventured into how they worked. Thus, when I decided to pursue this as a career, I had a lot of catch up to do. Here's a couple of things off the top of my head:

- 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.

Re: “Code” 2nd Edition

#32
post #26

Earlier quoted context omitted.

Same. I think some of us learn best by having a map of the territory and an understanding of how everything all fits together first. Having that better helps us deep-dive into and master specific areas. This one single book provides that map.

Absolutely. I tend to be mystified and lost without some way to place what I'm doing in some larger context, even if that context is super-vague or wrong in technical ways. Had several teachers who utterly refused to provide that, repeating "it'll all make sense eventually." Well, it did, after I got better teachers.

That's a great observation about teachers. I was fully convinced in late middle school that I was an idiot who had no hope to achieve good grades or a grasp of subjects. Then suddenly I found myself getting As in high school without a real change in effort/routines. I attribute that in large part to learning the "why" behind various subjects via new teachers.

Re: “Code” 2nd Edition

#33
post #22
post #10

This book was absolutely essential when I was first sinking my teeth into software programming. Things that seemed either arbitrary or completely mysterious suddenly made sense now that I had a contextual understanding of how computers worked . Without having that knowledge, I think my career would have been vastly more difficult and frustrating. While I understand many “get started programming” books/tutorials put a…

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 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.

Re: “Code” 2nd Edition

#34
post #14

Great book -- read it when I was a teenager -- but one thing that I think makes the book a bit harder to explain to smaller kids these days is the use of relays for explaining lots of things. Its a great concept to explain things but it does tend to cause a bit of confusing for younger kids who may not have played with electromagnets as much as kids from 20-30 years ago. Not sure what to replace relays with but maybe…

My kids played a lot with "relays" in Minecraft using Redstone. Not quite the same, though!

Ha that's a great idea.. sounds like a good idea for a coding book.. hey so you know minecraft.. use that knowledge to learn how computers work..

Re: “Code” 2nd Edition

#35
I majored in electronics (more than a decade ago) but always worked in software development. Does it still make sense to purchase it? I am eager to buy it, just need the push. :)

Re: “Code” 2nd Edition

#36
post #14

Great book -- read it when I was a teenager -- but one thing that I think makes the book a bit harder to explain to smaller kids these days is the use of relays for explaining lots of things. Its a great concept to explain things but it does tend to cause a bit of confusing for younger kids who may not have played with electromagnets as much as kids from 20-30 years ago. Not sure what to replace relays with but maybe…

very easily substitute using FETs. Essentially the same as relays and BJTs but much easier to control logic FETs than BJTs.

But that would introduce more complexity (polarity, biasing, etc) that would distract from the initial purpose. With a relay they should only learn how connecting a battery to pins 1 and 2 closes the contacts on 3 and 4. Using relays with more throws they can also learn the basics of logic gates, flip flops, etc. I believe that relays still have a place for educational purposes.

Re: “Code” 2nd Edition

#37
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…

That's a great list anyway, thanks!

Re: “Code” 2nd Edition

#38
post #19
post #8

My favorite Petzold book is 'Programming Windows 95'

I got the Fifth Edition. A book that's served me well. Learning the Win32 API, holding open doors, improvised weapon, it does it all.

My sample has a gigantic splat on its back because I threw it at some insect many years ago and it was positively crushed by The Petzold's impact force. Never cleaned that off because it added to the aesthetic of raggedness.

Re: “Code” 2nd Edition

#39
post #31
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.

That's a great question. I started out as a programmer having been a casual computer user through my childhood/teenage years. I never took apart computers or ventured into how they worked. Thus, when I decided to pursue this as a career, I had a lot of catch up to do. Here's a couple of things off the top of my head: - The terminal was completely foreign to me. Why is it structured so? How are permissions set? Octal?…

Thanks for sharing! I can (of course) understand that many of these things seem arbitrary, but would never have been able to come up with the list on my own. :)

Re: “Code” 2nd Edition

#40

Looking back it's really strange that nowhere in our CS/Soft Eng. curriculum is it covered exactly what is meant by the term "abstraction" when it comes to how a computer works. That it's all, after all, shuffling of electrons (underlying MOSFET chemistry notwithstanding) and signals is the missing link. There's other books out there, and Ben Eater's website, that indepth show how to construct processor, gates, store…

When I was in school 'computer engineering' was the degree you wanted for that level of understanding. It was a blend of 50/50 computer science and electrical engineering. You'd learn enough analog EE to understand transistors and enough digital EE to understand logic and computer architecture (this is really where you learn the gory details of how a CPU works internally). Then you'd focus on enough CS to flesh out l…

Still is as you describe. Just graduated from a CompE program.
Post reply on HN