Write Great Code, Volume 2 and over 2 million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
Trade in Yours
For a 6.57 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
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: Thinking Low-level, Writing High-level v. 2 [Paperback]

Randall Hyde
3.5 out of 5 stars  See all reviews (2 customer reviews)
RRP: 28.99
Price: 22.20 & FREE Delivery in the UK. Details
You Save: 6.79 (23%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 4 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Want it tomorrow, 22 Aug.? Choose Express delivery at checkout. Details

Formats

Amazon Price New from Used from
Kindle Edition 21.09  
Paperback 22.20  
Trade In this Item for up to 6.57
Trade in Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level: Thinking Low-level, Writing High-level v. 2 for an Amazon Gift Card of up to 6.57, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Book Description

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


Frequently Bought Together

Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level: Thinking Low-level, Writing High-level v. 2 + Write Great Code: Volume I: Understanding the Machine: 1 + The Art of Assembly Language
Price For All Three: 67.56

Buy the selected items together


Product details

  • Paperback: 634 pages
  • Publisher: No Starch Press; 1 edition (24 Mar 2006)
  • Language: English
  • ISBN-10: 1593270658
  • ISBN-13: 978-1593270650
  • Product Dimensions: 23.4 x 17.8 x 3.8 cm
  • Average Customer Review: 3.5 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 490,426 in Books (See Top 100 in Books)
  • See Complete Table of Contents

Product Description

About the Author

Randall Hyde is the author of Write Great Code Volumes 1 and 2 (No Starch Press) and the co-author of MASM 6.0 Bible (The Waite Group). He has written for Dr. Dobb (TM)s Journal, Byte, and various professional journals. Hyde taught assembly language at the University of California, Riverside for over a decade.

Inside This Book (Learn More)
First Sentence
This book doesn't teach anything revolutionary. Read the first page
Explore More
Concordance
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

4 star
0
3 star
0
1 star
0
3.5 out of 5 stars
3.5 out of 5 stars
Most Helpful Customer Reviews
4 of 4 people found the following review helpful
5.0 out of 5 stars Useful and relevant 4 July 2009
Format:Paperback
This is an excellent book for those interested in writing fast, efficient code. Another reviewer criticised the author for not covering scripting and VM-based languages in more depth, but missed the point that they are unsuitable for writing performance-critical code. To be fair, "Write Fast Code" might have been a more representative title. Most of the software I use in my work (audio engineering) is written in C or C++, with critical sections in assembly code. The techniques discussed in this book are very useful for this type of programming. It is well written and the author knows his subject in depth. Ideally I would have liked to see a discussion of the x86_64 architecture, but don't regard its omission as a serious problem. Few programming books warrant five stars in my opinion, but this one hits the mark.
Comment | 
Was this review helpful to you?
7 of 21 people found the following review helpful
2.0 out of 5 stars Very informative but over a decade too late 10 Aug 2006
Format:Paperback
This book provides comprehensive, in-depth information about how the compiler for a 'C' like language generates assembly code and organizes the runtime structure of an executable. For a reader seeking this information I would recommend the text unreservedly.

However the book ignores the needs of contemporary software developers by continuously referencing C, C++, Pascal and Delphi as if they were still the dominant programming languages used in industry.

Java is dismissed out of hand as inefficient and there is no mention whatsoever of C# or VB .NET, desipte the fact that these are the languages being used by the overwhelming majority of developers today.

The author provides no coverage of over a decade of research into virtual machine design, dynamic compilation and runtime optimisation. This would be fine if the book was being marketed at a specialist audience but this is not the case.

As a course text on a college computer science course this book would be excellent. But an application developer using J2EE or .NET will not become a better programmer by learning how to reverse engineer 80x86 assembly.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.5 out of 5 stars  8 reviews
43 of 47 people found the following review helpful
5.0 out of 5 stars Help your compiler write better code 15 April 2006
By Jim Anderton - Published on Amazon.com
Format:Paperback
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. It would be an understatement to say he has a good handle on this subject. Chapter 3 goes into detail on 80x86 assembly for the HLL programmer while chapter 4 looks at the Power PC. Chapter 5 looks at compiler operation and code generation. This chapter gave me major flashbacks to compiler class.

In chapter 9, the author includes a great discussion of arrays and how they are handled by various languages. Another topic, in chapter 12, that I found very interesting was the discussion of variant data types. (Us LotusScript developers mustn't forget to use 'Option Declare.') Chapter 15 includes a description of various types of loops and hammers home the importance of coding efficient loops.

We spend so much time these days trying to abstract everything and think at a high-level. That's all fine and good but we can make better high-level decisions by understanding the low-level workings of compilers. Readers who are experienced developers with a genuine interest in writing quality code will get a lot out of this book. I especially recommend it for career developers who didn't have the benefit of formal Computer Science training.

At the end of the book is a teaser for the next book in the series: Write Great Code, Volume 3: Engineering Software. In this book, Hyde will discuss "personal software engineering" and will focus on craftsmanship, art, and pride in workmanship. I'm looking forward to that one too.
22 of 23 people found the following review helpful
5.0 out of 5 stars Excellent material for serious software developers... 25 Jun 2006
By Thomas Duff - Published on Amazon.com
Format:Paperback
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. He uses a number of high-level coding examples from various languages (like C, C++, and Pascal) that should be understandable to most any IT developer. He then shows the translated code at the assembler level and explains why a particular compilation might be good or bad (depending on your requirements). Once you start to understand how (and why) your compiler "optimizes" your code, you can make more intelligent choices as far as programming constructs. There is often a dozen ways to do something, but a few of those ways will be far more efficient at the machine level than the others.

If you're writing a program that runs in a second or two, these techniques may not necessarily have an immediate practical application for you. But that hour-long program may have the same underlying problem as your first program, and it could be that a slight change in program structure at your end could dramatically reduce the run time. This is one of those books that most serious software developers should have sitting on their shelves...
5 of 6 people found the following review helpful
5.0 out of 5 stars Overall, totally worth it 21 Aug 2008
By Lance C. Hibbeler - Published on Amazon.com
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.

The tone of the text is sometimes condescending (especially in the first 5-6 chapters), with a not-so-subtle "real men only code in assembly" message. It seriously reminds me of my parents/grandparents whining about how hard they had it growing up...walking barefoot to school in the winter...and only having assembly to work with in writing programs.

So by the end of this book, I think I have met Hyde's goal for the readers. I can't sit down and write an assembly program, but I can read enough assembly to compare different versions of my high-level program to say what is better. As the subtitle suggests, I am "thinking low-level" now as I write my programs (in C...which most programmers would call low-level). I suggest "actively" reading this book and coding up a few examples with your compiler and examining the output, following along in the text. Doing that really made the material click for me.

Overall, it's a good book and definitely worth it. This is a long one though, and takes some time to digest. See you in volume 3!
2 of 2 people found the following review helpful
5.0 out of 5 stars How Software Works 6 Nov 2007
By Jeff Pike - Published on Amazon.com
Format:Paperback
How Software Works would also be a great title for this volume. Any high level construct you can think of is analyzed in-depth at a low level. This is great for those interested in reverse engineering or writing cleaner code.

This book is language and hardware neutral. Languages from Pascal to C++ to Visual Basic are covered on hardware from x86 to RISC to embedded systems. No matter what language you code in the innards are laid out for you. The author does a masterful job of the idiosyncrasies of different languages seamlessly without dwelling on the trivial. This book is heavy on assembled code, compilers, and interpreters. It's an absolutely great collection of everything you wanted to know about how software works that you really can't find elsewhere in a single volume.

Although the subject matter is probably dry for some, I found this book surprisingly easy to read due to the clarity of the writing. This is at least as good, or better than volume one. With that said, there are a number of references to volume one, and I do recommend reading volume one first unless you have a solid background in computer architecture.
4 of 5 people found the following review helpful
4.0 out of 5 stars do not ask what your compiler can do for you, but what you can do for your compiler! 9 May 2007
By Wuping Xin - Published on Amazon.com
Format:Paperback|Verified Purchase
In this RAD time when anybody who knows drag-and-drop can proudly claim himself software developer, this is the unique book for true, serious, and hardcore programmer that writes native codes. I completely agree that, in order to write efficient and optimized code, you not only need to understand what your compiler can do for you,but also you should know, at least for a minimum level, what you can do for you compiler. In this regard, this book does an excellent job explaining the magic your compiler does for you and what you can do to become part of the magic. As such, I highly recommend this book to any serious programmers.

The only thing I don't like about this book is that it appears to be giving too much space to HLA, which I suspect is a widely accepted assembly dialect that was actually used in any real-life project. And I just feel it is a waste of my time trying to understand and catch up with this HLA language. This results in my taking one star off with the final rate of 4 stars.

Other than that, this is indeed a very good book.

In a previous reivew, it is complained that Java is not touched. This is understandable while it really doesn't seem to be a problem to me. Java after compiling is translated into bytecode that has to be executed on the virtual machine. I guess that is really beyond the intended scope of this book, which is related to the world of native codes that after compiling can be directly executed by the machine.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category


Feedback