ChoiceHost

Language

Code: The Hidden Language of Computer Hardware and Software

The classic guide to how computers work, updated with new chapters and interactive graphics

“For me, Code was a revelation. It was the first book about programming that spoke to me. It started with a story, and it built up, layer by layer, analogy by analogy, until I understood not just the Code, but the System. Code is a book that is as much about Systems Thinking and abstractions as it is about code and programming. Code teaches us how many unseen layers there are between the computer systems that we as users look at every day and the magical silicon rocks that we infused with lightning and taught to think.”

– Scott Hanselman, Partner Program Director, Microsoft, and host of Hanselminutes

Computers are everywhere, most obviously in our laptops and smartphones, but also our cars, televisions, microwave ovens, alarm clocks, robot vacuum cleaners, and other smart appliances. Have you ever wondered what goes on inside these devices to make our lives easier but occasionally more infuriating?

For more than 20 years, readers have delighted in Charles Petzold’s illuminating story of the secret inner life of computers, and now he has revised it for this new age of computing. Cleverly illustrated and easy to understand, this is the book that cracks the mystery. You’ll discover what flashlights, black cats, seesaws, and the ride of Paul Revere can teach you about computing, and how human ingenuity and our compulsion to communicate have shaped every electronic device we use.

This new expanded edition explores more deeply the bit-by-bit and gate-by-gate construction of the heart of every smart device, the central processing unit that combines the simplest of basic operations to perform the most complex of feats. Petzold’s companion website, CodeHiddenLanguage.com, uses animated graphics of key circuits in the book to make computers even easier to comprehend.

In addition to substantially revised and updated content, new chapters include:

Chapter 18: Let’s Build a Clock!Chapter 21: The Arithmetic Logic UnitChapter 22: Registers and BussesChapter 23: CPU Control SignalsChapter 24: Jumps, Loops, and CallsChapter 28: The World Brain

From the simple ticking of clocks to the worldwide hum of the internet, Code reveals the essence of the digital revolution.


From the Publisher

Image of an encoder circuitImage of an encoder circuit

The classic guide to how computers work

This new expanded edition explores more deeply the bit-by-bit, gate-by-gate construction of the heart of every smart device—the central processing unit that combines the simplest of basic operations to perform the most complex of feats. Petzold’s companion website uses animated graphics of key circuits in the book to make computers even easier to comprehend.

In addition to substantially revised and updated content, new chapters include:

Chapter 18: Let’s Build a Clock!Chapter 21: The Arithmetic Logic UnitChapter 22: Registers and BussesChapter 23: CPU Control SignalsChapter 24: Jumps, Loops, and CallsChapter 28: The World Brain

Code, 2nd Edition, by Charles PetzoldCode, 2nd Edition, by Charles Petzold

“…the first book about programming that spoke to me.”

For me, Code was a revelation. It was the first book about programming that spoke to me. It started with a story, and it built up, layer by layer, analogy by analogy, until I understood not just the Code, but the System. Code is a book that is as much about Systems Thinking and abstractions as it is about code and programming.

Code teaches us how many unseen layers there are between the computer systems that we as users look at every day and the magical silicon rocks that we infused with lightning and taught to think.

Scott Hanselman, Partner Program Director, Microsoft, and host of Hanselminutes

Preface to the Second Edition

The first edition of this book was published in September 1999. With much delight I realized that I had finally written a book that would never need revising! This was in stark contrast to my first book, which was about programming applications for Microsoft Windows. That one had already gone through five editions in just ten years. My second book on the OS/2 Presentation Manager (the what?) became obsolete much more quickly. But Code, I was certain, would last forever.

My original idea with Code was to start with very simple concepts but slowly build to a very deep understanding of the workings of digital computers. Through this steady progression up the hill of knowledge, I would employ a minimum of metaphors, analogies, and silly illustrations, and instead use the language and symbols of the actual engineers who design and build computers. I also had a very clever trick up my sleeve: I would use ancient technologies to demonstrate universal principles under the assumption that these ancient technologies were already quite old and would never get older. It was as if I were writing a book about the internal combustion engine but based on the Ford Model T.

I still think that my approach was sound, but I was wrong in some of the details. As the years went by, the book started to show its age. Some of the cultural references became stale. Phones and fingers supplemented keyboards and mice. The internet certainly existed in 1999, but it was nothing like what it eventually became. Unicode—the text encoding that allows a uniform representation of all the world’s languages as well as emojis—got less than a page in the first edition. And JavaScript, the programming language that has become pervasive on the web, wasn’t mentioned at all.

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.

Charles Petzold

Publisher ‏ : ‎ Microsoft Press
Publication date ‏ : ‎ August 7, 2022
Edition ‏ : ‎ 2nd
Language ‏ : ‎ English
Print length ‏ : ‎ 480 pages
ISBN-10 ‏ : ‎ 0137909101
ISBN-13 ‏ : ‎ 978-0137909100
Item Weight ‏ : ‎ 1.45 pounds
Dimensions ‏ : ‎ 6 x 0.95 x 9 inches
Best Sellers Rank: #12,087 in Books (See Top 100 in Books) #1 in Unicode Encoding Standard #3 in Data Processing #8 in Software Development (Books)
Customer Reviews: 4.8 4.8 out of 5 stars 840 ratings var dpAcrHasRegisteredArcLinkClickAction; P.when(‘A’, ‘ready’).execute(function(A) { if (dpAcrHasRegisteredArcLinkClickAction !== true) { dpAcrHasRegisteredArcLinkClickAction = true; A.declarative( ‘acrLink-click-metrics’, ‘click’, { “allowLinkDefault”: true }, function (event) { if (window.ue) { ue.count(“acrLinkClickCount”, (ue.count(“acrLinkClickCount”) || 0) + 1); } } ); } }); P.when(‘A’, ‘cf’).execute(function(A) { A.declarative(‘acrStarsLink-click-metrics’, ‘click’, { “allowLinkDefault” : true }, function(event){ if(window.ue) { ue.count(“acrStarsLinkWithPopoverClickCount”, (ue.count(“acrStarsLinkWithPopoverClickCount”) || 0) + 1); } }); });

Code: The Hidden Language of Computer Hardware and Software Read More »

Server-Driven Web Apps with htmx: Any Language, Less Code, Simpler Code

htmx is a library that adds logic and server interaction to HTML; you get the effect of using a front-end SPA framework without writing front-end code. Use any server-side programming language and framework to build server applications with endpoints that simply return snippets of HTML. Dynamically update portions of the current web page from HTTP responses. Add interactivity with JavaScript and libraries such Alpine and _hyperscript. Make your apps more secure by escaping user-supplied content and specifying a Content Security Policy. Go beyond basic HTTP requests with WebSockets and server-sent events.

The htmx JavaScript library gives you a new way to craft web applications. The htmx approach differs significantly from that of the currently popular single-page application (SPA) frameworks; rather than write a bunch of JavaScript, you simply annotate HTML elements before you send them to the browser. The resulting code is easier to understand and modify, and because it downloads less to the browser and doesn’t need JSON creation and parsing, you’ll find it performs better, too.

Rethink web application design; write code in any language that simply responds to requests with htmx snippets.Dynamically update portions of the current web page directly from the server.Implement common patterns such as lazy loading, input validation, CSS transitions, active search, optimistic updates, pagination, infinite scroll, polling, and click-to-edit.Add interactivity with JavaScript and libraries such as Alpine and _hyperscript.Use the htmx JavaScript API to simplify DOM operations.Make your web apps more secure: escape user-supplied content, use Subresource Integrity hashes, and enforce a Content Security Policy.Go beyond the basic HTTP request/response pattern with WebSockets and server-sent events.

Discover a simpler way to implement web applications that emphasizes web fundamentals.

What You Need:

A modern web browser and the ability to build and run a local HTTP server using the server-side language and framework of your choice.The code examples are fully compatible with htmx 2.0.

From the brand

The Pragmatic ProgrammersThe Pragmatic Programmers

Explore our collections

The Pragmatic Programmers publishes hands-on, practical books on classic and cutting-edge software development and engineering management topics. We help professionals solve real-world problems, hone their skills, and advance their careers.

ASIN ‏ : ‎ B0D9N35GKP
Publisher ‏ : ‎ Pragmatic Bookshelf
Publication date ‏ : ‎ September 17, 2024
Edition ‏ : ‎ 1st
Language ‏ : ‎ English
Print length ‏ : ‎ 186 pages
ISBN-13 ‏ : ‎ 979-8888650769
Item Weight ‏ : ‎ 11.7 ounces
Dimensions ‏ : ‎ 7.5 x 0.4 x 9.25 inches
Best Sellers Rank: #1,138,053 in Books (See Top 100 in Books) #195 in JavaScript Programming (Books) #256 in Mobile App Development & Programming #2,634 in Programming Languages (Books)
Customer Reviews: 3.4 3.4 out of 5 stars 7 ratings var dpAcrHasRegisteredArcLinkClickAction; P.when(‘A’, ‘ready’).execute(function(A) { if (dpAcrHasRegisteredArcLinkClickAction !== true) { dpAcrHasRegisteredArcLinkClickAction = true; A.declarative( ‘acrLink-click-metrics’, ‘click’, { “allowLinkDefault”: true }, function (event) { if (window.ue) { ue.count(“acrLinkClickCount”, (ue.count(“acrLinkClickCount”) || 0) + 1); } } ); } }); P.when(‘A’, ‘cf’).execute(function(A) { A.declarative(‘acrStarsLink-click-metrics’, ‘click’, { “allowLinkDefault” : true }, function(event){ if(window.ue) { ue.count(“acrStarsLinkWithPopoverClickCount”, (ue.count(“acrStarsLinkWithPopoverClickCount”) || 0) + 1); } }); });

Server-Driven Web Apps with htmx: Any Language, Less Code, Simpler Code Read More »