Buchhandlung Neugebauer

Suche

Write Great Code. Vol.2

Write Great Code. Vol.2

Thinking Low-Level, Writing High-Level | Randall Hyde

Taschenbuch
2020 No Starch Press
Auflage: 2nd ed.
656 Seiten; 38 mm x 179 mm
ISBN: 978-1-71850-038-9

Rezension verfassen

€ 63,30

  • führen wir nicht mehr
  • Versandkostenfrei innerhalb Österreich
  • Als E-BOOK (EPUB) erhältlich
Introduction

Chapter 1: Thinking Low-Level, Writing High-Level
Chapter 2: Shouldn t You Learn Assembly Language?
Chapter 3: 80x86 Assembly for the HLL Programmer
Chapter 4: Compiler Operation and Code Generation
Chapter 5: Tools for Analyzing Compiler Output
Chapter 6: Constants and High-Level Languages
Chapter 7: Variables in a High-Level Language
Chapter 8: Array Data Types
Chapter 9: Pointer Data Types
Chapter 10: String Data Types
Chapter 11: Record, Union, and Class Data Types
Chapter 12: Arithmetic and Logical Expressions
Chapter 13: Control Structures and Programmatic Decisions
Chapter 14: Iterative Control Structures
Chapter 15: Functions and Procedures

Afterword: Engineering Software
Glossary


Besprechung
Praise for the first edition of Write Great Code, Volume 2:

"Set aside some money and buy this book, or get a friend to buy it and get it from them while still in the store. When you get home, read it TWICE so that you master what is in these pages. Then read it again."
DevCity

"Write Great Code Volume 2 exceeds its goal of helping developers pay more attention to application performance when writing applications in high-level languages. This book is a must for any high-level application developer.
Free Software Magazine

"As a high-level-language programmer, if you want to know what's really going on with your programs, you need to spend a little time learning assembly language and you won't find an easier introduction."
DevX

"This is a good book. A very very good book. Frankly, I'm blown away at the quality of writing."
Toronto Ruby User Group

Langtext
Thinking Low-Level, Writing High-Level, the second volume in the landmark Write Great Code series by Randall Hyde, covers high-level programming languages (such as Swift and Java) as well as code generation on 64-bit CPUsARM, the Java Virtual Machine, and the Microsoft Common Runtime.

Today's programming languages offer productivity and portability, but also make it easy to write sloppy code that isn't optimized for a compiler. Thinking Low-Level, Writing High-Level will teach you to craft source code that results in good machine code once it's run through a compiler.

You'll learn:
  • How to analyze the output of a compiler to verify that your code generates good machine code
  • The types of machine code statements that compilers generate for common control structures, so you can choose the best statements when writing HLL code
  • Enough assembly language to read compiler output
  • How compilers convert various constant and variable objects into machine data

  • With an understanding of how compilers work, you'll be able to write source code that they can translate into elegant machine code.

    NEW TO THIS EDITION, COVERAGE OF:
  • Programming languages like Swift and Java
  • Code generation on modern 64-bit CPUs
  • ARM processors on mobile phones and tablets
  • Stack-based architectures like the Java Virtual Machine
  • Modern language systems like the Microsoft Common Language Runtime


  • INTRODUCTION

    There are many aspects of great code far too many to describe properly in a single book. Therefore, this second volume of the Write Great Code series concentrates on one important part of great code: performance. As computer systems have increased in performance from MHz, to hundreds of MHz, to GHz, the performance of computer software has taken a back seat to other concerns. Today, it is not at all uncommon for software engineers to exclaim, You should never optimize your code! Funny, you don t hear too many computer application users making such statements.

    Although this book describes how to write efficient code, it is not a book about optimization. Optimization is a phase near the end of the software development cycle in which software engineers determine why their code does not meet performance specifications and then massage the code to achieve those specifications. But unfortunately, if no thought is put into the performance of the application until the optimization phase, it s unlikely that optimization will prove practical. The time to ensure that an application has reasonable performance characteristics is at the beginning, during the design and implementation phases. Optimization can fine-tune the performance of a system, but it can rarely deliver a miracle.

    Although the quote is often attributed to Donald Knuth, who popularized it, it was Tony Hoare who originally said, Premature optimization is the root of all evil. This statement has long been the rallying cry of software engineers who avoid any thought of application performance until the very end of the software-development cycle at which point the optimization phase is typically ignored for economic or time-to-market reasons. However, Hoare did not say, Concern about application performance during the early stages of an application s development is the root of all evil. He specifically said premature optimization, which, back then, meant counting cycles and instructions in assembly language code not the type of coding you want to do during initial program design, when the code base is rather fluid. So, Hoare s comments were on the mark. The following excerpt from a short essay by Charles Cook (www.cookcomputing.com/blog/archives/ 000084.html) describes the problem with reading too much into this statement:

    I ve always thought this quote has all too often led software designers into serious mistakes because it has been applied to a different problem domain to what was intended.

    The full version of the quote is We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. and I agree with this. It s usually not worth spending a lot of time micro-optimizing code before it s obvious where the performance bottlenecks are. But, conversely, when designing software at a system level, performance issues should always be considered from the beginning. A good software developer will do this automatically, having developed a feel for where performance issues will cause problems. An inexperienced developer will not bother, misguidedly believing that a bit of fine tuning at a later stage will fix any problems.

    Hoare was really saying that software engineers should worry about other issues, like good algorithm design and good implementations of those algorithms, before they worry about traditional optimizations, like how many CPU cycles a particular statement requires for execution.

    Although you could certainly apply many of this book s concepts during an optimization phase, most of the techniques here really need to be done during initial coding. If you put them off until you reach code complete, it s unlikely they will ever find their way into your software. It s just too much work

    Randall Hyde is the author of The Art of Assembly Language, one of the most highly recommended resources on assembly, and the three volume Write Great Code series (all No Starch Press). He is also the co-author of The Waite Group's MASM 6.0 Bible. He has written for Dr. Dobb's Journal and Byte, as well as professional and academic journals.