Let’s Get Started with Understanding the Machine!

Let’s Get Started with Understanding the Machine!

August 26, 2020 0 By Rosa

Last week, it finally came in the mail! The 2nd edition of Randall Hyde’s book Write Great Code – Understand the Machine. I am excited to study this book and gain more in-depth knowledge of computer organisation. So, let’s get started with understanding the machine!

Cover Photo by Umberto on Unsplash

Write Great Code

Writing great code is not as easy as it may sound. There are a lot of aspects to take into account. One of the important elements is understanding how a computer works. If you can utilise the computer’s strengths and avoid its weaknesses, I’m confident that your applications will improve.

In order to write great code, you need to know how to write efficient code, and to write efficient code, you must understand how computer systems execute programs and how abstractions in programming languages map to low-level hardware capabilities of the machine.

Randall Hyde

This quote summarises Hyde’s view on what it takes to write code. In the past, well over 20 years ago, there was only one way to learn the absolute best of coding techniques: learning the Assembly language. The reason behind that is not because of the language itself. Instead, it is because you’ll learn a ton about machine organisation.

Machine organisation is a subset of computer architecture. It covers topics such as:

  • low-level data types;
  • internal CPU organisation;
  • memory organisation;
  • peripherals;
  • computer communication.

Write Great Code – Understand the Machine covers machine organisation quite in detail, which is essential information for me to gain. Not only because it would allow me to write better code, but also because I need this knowledge to write my operating system. Everything I’ll learn from this book, I’ll share with you.

Pen, paper, book: Let's study Understand the Machine!
Pen, paper, and book: Let’s study!

Get Started with Understanding the Machine

So, what topics does Hyde cover in this book? It is quite a list, and they can all be related to the subjects of machine organisation. This list gives an outline of what the book covers. That is what I will write about in the many articles to come.

  • Basic Computer Data Representation
    • What do integers, characters, character sets and many more primal data types look like in a computer?
  • Binary Arithmetic & Bit Operations
    • How does the computer perform calculations and operations with bits only?
  • Memory (RAM)
    • How does a computer access memory, and what are the characteristics of memory performance?
  • Complex Computer Data Representation
    • What do composite data types and memory objects (e.g. pointers and arrays) look like in a computer?
  • Boolean Logic & Digital Design
    • How can I optimise the boolean expressions in if and while loops?
  • CPU Architecture
    • How can I write code in a “CPU friendly” manner?
  • CPU Instruction Set Architecture
    • Why do some statements take longer to execute than others?
  • Memory Architecture and Organisation
    • How can I write super fast executing code?
  • Computer Communication to the Outside World
    • How does the computer communicate with peripherals (e.g. hard drive and sound card)?

When I see this list of things I need to learn, it terrifies me. However, it also excites me. There is still so much out there that I’m eager to learn, but I need to go one step at the time. If you want to follow my journey, keep an eye out for more posts to come! In the meantime, I’ll get started with understanding the machine.