Programming Books C Java PHP Python Learn more Browse Programming Books
Write Great Code, Volume 2 and over one million other books are available for Amazon Kindle. Learn more

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player

Sell Us Your Item
For a $5.54 Gift Card
Trade in
Have one to sell? Sell yours here
Start reading Write Great Code, Volume 2 on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level [Paperback]

Randall Hyde
4.5 out of 5 stars  See all reviews (8 customer reviews)

Available from these sellers.

Free Two-Day Shipping for College Students with Amazon Student


Amazon Price New from Used from
Kindle Edition $19.77  
Paperback --  
Unknown Binding --  
Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

March 18, 2006 1593270658 978-1593270650 1

The second volume in the Write Great Code series supplies the critical information that today's computer science students don't often get from college and university courses: How to carefully choose their high-level language statements to produce efficient code. Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level, teaches software engineers how compilers translate high-level language statements and data structures into machine code. Armed with this knowledge, a software engineer can make an informed choice concerning the use of those high-level structures to help the compiler produce far better machine code--all without having to give up the productivity and portability benefits of using a high-level language.

Editorial Reviews


"Exceeds its goal of helping developers pay more attention to application performance . . . a must for any high-level application developer." -- Free Software Magazine, May 9, 2006

"If you want to know what's really going on with your programs . . . you won't find an easier introduction." -- DevX, April 14, 2006

From the Back Cover

No prior knowledge of assembly language required!

In the beginning, most software was written in assembly, the CPU’s low-level language, in order to achieve acceptable performance on relatively slow hardware. Early programmers were sparing in their use of high-level language code, knowing that a high-level language compiler would generate crummy, low-level machine code for their software. Today, however, many programmers write in high-level languages like C, C++, Pascal, Java, or BASIC. The result is often sloppy, inefficient code. You don’t need to give up the productivity and portability of high-level languages in order to produce more efficient software.

In this second volume of the Write Great Code series, you’ll learn:
• How to analyze the output of a compiler to verify that your code does, indeed, generate good machine code
• The types of machine code statements that compilers typically generate for common control structures, so you can choose the best statements when writing HLL code
• Just enough 80x86 and PowerPC assembly language to read compiler output
• How compilers convert various constant and variable objects into machine data, and how to use these objects to write faster and shorter programs

With an understanding of how compilers work, you’ll be able to write source code that they can translate into elegant machine code. That understanding starts right here, with Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level.

Product Details

  • Series: Write Great Code (Book 2)
  • Paperback: 640 pages
  • Publisher: No Starch Press; 1 edition (March 18, 2006)
  • Language: English
  • ISBN-10: 1593270658
  • ISBN-13: 978-1593270650
  • Product Dimensions: 9.2 x 7 x 1.5 inches
  • Shipping Weight: 2.3 pounds
  • Average Customer Review: 4.5 out of 5 stars  See all reviews (8 customer reviews)
  • Amazon Best Sellers Rank: #598,484 in Books (See Top 100 in Books)

Customer Reviews

Most Helpful Customer Reviews
43 of 47 people found the following review helpful
5.0 out of 5 stars Help your compiler write better code April 14, 2006
I earned my Computer Science degree several years ago. During my studies I learned languages like Assembly, Modula-2, C and C++ and even a little VB in a computer graphics class. I learned quite a bit about how computers work at the binary level and even got into some Electrical Engineering topics.

As you might expect, I don't use any of those languages in my career today. It's all Java, LotusScript, and other high-level languages for me these days. I rarely find myself shifting bits or thinking about logic gates. Does this mean my CS degree was a waste of time? Absolutely not. Although it would have been nicer if I had been learning Java... :-)

It's not the languages I learned that gave the education its value. It's the algorithms, patterns and logic that have come to my aid again and again. An understanding of what's going on inside the computer can be very helpful at times. That's why I was so interested in reading Randall Hyde's book: Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level.

This book teaches the following concepts (Chapter 1 excerpt):
- Why it's important to consider the low-level execution of your high-level programs
- How compilers generate machine code from high-level language (HLL) statements
- How compilers represent various data types using low-level, primitive, data types
- How to write your HLL code to help the compiler produce better machine code
- How to take advantage of a compiler's optimization facilities
- How to "think" in assembly language (low-level terms) while writing HLL code

The general goal of this book is to teach you how to think like a compiler so you can anticipate what the compiler will do with your code. Randall Hyde is also the author of The Art of Assembly Language.
Read more ›
Was this review helpful to you?
22 of 23 people found the following review helpful
Back in "the day", you really couldn't write high-level code without at least some exposure at some point to lower-level code, like Assembler. Now, you can pretty much be completely ignorant of what happens in your Java or VB code "under the covers". But that doesn't mean you can't benefit from understanding how your compiler turns your readable code into machine-readable operations. Randall Hyde does an excellent job in explaining all this in his book Write Great Code Volume 2: Thinking Low-Level, Writing High-Level.

Contents: Thinking Low-Level, Writing High-Level; Shouldn't You Learn Assembly Language?; 80x86 Assembly for the HLL Programmer; PowerPC Assembly for the HLL Programmer; Compiler Operations and Code Generation; Tools for Analyzing Compiler Output; Constants and High-Level Languages; Variables in a High-Level Language; Array Data Types; String Data Types; Pointer Data Types; Record, Union, and Class Data Types; Arithmetic and Logical Expressions; Control Structures and Programmatic Decisions; Iterative Control Structures; Functions and Procedures; Engineering Software; A Brief Comparison of the 80x86 and PowerPC CPU Families; Online Appendices; Index

This is the type of book that will really excite you if you're wondering why a nested if statement performs differently than a case statement. Hyde explains basic compiler theory, and applies that to how your compiler of choice decides on optimization strategies. It's impractical to get a program optimized for all factors, like code size and speed, but there are reasonable trade-offs as well as compiler options you can use to prioritize one factor over another. You also don't have to be completely conversant with Assembler in order to work through this book.
Read more ›
Comment | 
Was this review helpful to you?
5 of 6 people found the following review helpful
5.0 out of 5 stars Overall, totally worth it August 21, 2008
Format:Paperback|Verified Purchase
I read the first volume of this book, and it was a great, informative read. After volume 2, I have this to say:

This book is not a cookbook for writing better code. Hyde explains why certain programming constructs are better than others (and in what cases), and backs it up with evidence from the assembly code (that is the entire premise of the book). Finally, solid proof of (and against) what I've been hearing all along from instructors and other programmers on message boards or face-to-face communication. That in mind, it would have been nice to have a summary of the tips at the end of the chapters, or the end of the book, as a quick-reference kind of thing. These concepts are the perfect thing to consider when fine-tuning your code. I take the stance that if you fine-tune as you go, you have less work later, so I took notes as I read and have started implementing changes for the better (with evidence that it is better) in some of my coding.

Does anyone write code in Pascal anymore? Seriously? Hyde discusses examples in C/C++ and Pascal for the most part (favoring Pascal, by my estimation), so it is nice that the book is language-independent for the reader. The assembly examples in the book are in 80x86 and PowerPC...I think it would have been better to release two versions of this book, one where the assembly is 80x86 (because it is so ubiquitous, if for no other reason), and then another where the assembly is in PowerPC assembly. I didn't pick this up to become an assembly language programmer, and quite frankly, the PowerPC examples just confused me. It looks like my cat stepped on my keyboard and it appeared in print.
Read more ›
Was this review helpful to you?
Most Recent Customer Reviews
Search Customer Reviews
Search these reviews only


There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
First post:
Prompts for sign-in

Look for Similar Items by Category