Writing great code that is not only functional and bug-free but also leverages all aspects of its environment to run efficiently is something all of us would aspire to. Randall Hyde is hoping to make that road a bit easier beginning with the first book in a series of four entitled Write Great Code, Understanding the Machine.

Hyde is taking on a topic that continues to lie at the core of all development, the foundations of computer architecture. In this case Hyde is predominantly speaking to those on x86 platforms, though the fundamentals carry over to Power PC and others. Previous to this series one would be initiated into programming by way of training courses, how-to books and trial and error.

However, the author is hoping he delivered the equivilant of a university course on systems architecture for the programmer without needing to first learn assembly language.

Prior to the world wide web becoming a central element in professional development, programmers traversed a traditional road of learning a procedural language, perhaps in university or through trial and error on their own, such as C. However, since the late 1990’s, many a developer’s first taste of code has been Perl, PHP or Python.

In some cases missing the functional building blocks of programming and the code’s interaction with the hardware elements of processor, memory and more may be invisible obstacles to writing great code. In my own experience, Code Complete was a book similar to Hyde’s effort that took me to the next level of thinking about code prior to writing it. Hyde’s book is challenging me on a whole new level.

According to Randall Hyde, it is this new generation of developer’s his book is aiming to reach – “Because this is the group of programmers who’ve probably never seen this material elsewhere,” he told SitePoint.

Before some might suggest the books may stray to far from relevance to web development languages, Hyde says three of the four volumes will directly address developer’s who choose to stay with the interpreted languages of the web.

“Volumes I, III, and IV will be applicable to those wanted to stick with [Perl, PHP and the like]. Volume II will be of little interest — since it covers how compilers generate code, which is N/A to script/interpreted languages,” Hyde added.

Volume I covers basic machine data types, basic machine architecture, I/O, and other such topics which are relatively independent of the language.

“The book uses examples in C, Pascal, Assembly, and Basic, but someone with familiarity with *any* imperative language will understand what’s going on,” Hyde said.

While the first volume does not deal heavily with object-oriented development, which is an item of interest to LAMP programmers, there is a discussion of how objects are implemented at the machine level and their costs.

Significant to me was the focus on providing an understanding of how computers execute code – which causes one to pause and consider the organization of one’s applications.

A parting comment from Hyde: “No matter what language facility a programmer uses, understanding how the machine represents data, executes code, and processes I/O is crucial to those who want to write great code.”