Talk to me intelligently

When you teach, you clarify doubts of the participants. While you are clarifying the doubts, you start having your own doubts, which make you go deeper into the subject. And the best way to clear deep doubts is to read a good book on the related subject. Internet is good for some quick and dirty research but if you want to do some serious reading you better get hold of a good book.

My aim was to know more about the interaction between the code you write and the processor. Essentially I needed a book which explained to a software engineering student some of the electronics and computer organization stuff. With this in mind I was browsing the bookshelves in Landmark, Chennai when I chanced about a book titled, “Write Great Code: Vol.1 – Understanding the machine.” Written by Randall Hyde. I quickly flipped through and since it had most of what I was looking for, I bought it.

Generally you can bifurcate the technical books in two categories. One is what is written for the student of that subject. This could be a text book or something close to a text. Here it is taken for granted that the person reading has an idea of what he / she is getting into. The other category is technical books written for people who are not students of that subject, but would like to know more on that subject. It is in the second category that I have problems. Basically when a technical subject is being explained to a person who is not involved in that subject, the author assumes that the person reading is absolutely dumb!! It is almost as if saying that if you are not a student of this subject, you ought to be dumb!! I am OK with book like “.. for Dummies” series. Atleast they categorically state who their audience are.  Whereas many of the other books don’t state this assumption and can get on your nerves when you read them, for they start explaining to you at 2+2 is equal to 4. Well, not exactly that, but you get the drift, right?

So it was a pleasure to discover this book by Randall Hyde. As I said, this book is focused on a software engineer who wants to write high performance code. According to my friends, this is a breed which is slowly dying. One, because of project pressures people end up coding the fastest possible way and not the most efficient way. Two, with more and more languages giving you objects and high abstracted entities, your efficiency lies only in selecting the right templates / objects / whatever.  The book is focused on explaining to the reader about the underlying architecture of the machine and how your code can take advantage and become highly performant.

Starting from Binary Numbers, through Bit Operations, Character Representation, How Memory is Organized, the CPU Architecture, Instruction Set Architecture and Input / Output, Randall gives you a very nice view of the internals of a computer. A few things about this book impressed me. First, it talks to you intelligently. It assumes that you are a fairly intelligent person and not someone having an IQ of a caterpillar. Second, the writing style is very fluid. Third is the economy of words. It is possible to pack so much into a 400 page book because Randall doesn’t waste words. Reminds me of an Inorganic Chemistry text we had, authored by J.D.Lee, which had similar economy of words.

If you read the full book, you will end up understanding quite a bit of jargon which you have heard and probably used as well. Stuff like say Pipelining. You probably have a vague idea of what it means but this book makes it very clear. Similarly you would get a good idea about how memory is accessed, what are the instruction sets, what registers do what etc. It also has detailed chapters onI/O, Filesystems and Device Drivers.  It also tells you how compilers work. You can always say that these details are available in various text books and you would be right. But you will need to read a lot of textbooks to get all this knowledge. This is not a book which replaces the text book but rather a high level electronics view keeping the software programmer in mind. At end of each chapter, references to the relevant standard texts are given.

If you are someone interested in knowing the internals of a computer system to the extant of using that knowledge to you advantage while coding, this is the book for you. I would definitely recommend it to all computer science students. This is a very comprehensive book which talks to you intelligently and you will definitely benefit from it.

This entry was posted in Linux, Platforms and tagged , , . Bookmark the permalink.

5 Responses to Talk to me intelligently

  1. Ramesh N R says:

    Suresh,
    Nice summary and I always believed that one needs to have a good understanding of how what you write in a high level language actually gets executed at the machine level. That perspective really helps not just in writing good code, but also when you need to debug some weird behavior. At least that has been my personal experience. If one has done a good course on Microprocessors, written some assembly code, and studied Computer organization, followed by a good course on Compilers, this understanding slowly evolves. As you said to get this holistic understanding one needs to cover these 3 areas with multiple good books and hands on experimentation. It is nice to know that this book bridges all these and provides a good way to get this understanding..

    Thanks for the post and introducing this book.. will borrow it from you sometime.. As you said, I hope our universities start prescribing such books in the curriculum at least as reference texts for CS/IT majors. Will recommend this where I can..

    Best Regards,
    N.R. Ramesh.

  2. admin says:

    Ramesh,

    I definitely expected you to comment :) since you have straddled both the worlds. As you rightly say, it is imperative for many programmers to understand what happens at a low level.

    Do borrow the book from me, read it and let me know you views. As you said, if you find it good we should go ahead and suggest to colleges to use this as a reference.

  3. Ravi Natarajan says:

    Not sure which world you live in Suresh:-)

    My understanding of the great Indian programmer is that, by the time they really get a hang of their first computing language, they have already become a manager!

    He is now into a different sort of pipelining :-) If he is not a programmer doing something useful (the only true computing profession is a programmer – everything else is frills) he calls himself an architect. I spoke to one of my programmers who used to work for me some 15 years ago recently. He told me that he spends most of his time drawing pictures in Visio – that’s life of an architect!

    The programming position is still alive in the West. Being a manager does not have the social status here as it is in India. Unfortunately, such committed souls are getting replaced quickly by Indian programmers who have spent less than 2 years as full-time programmers. Most Indian programmers, working in India I have worked with, do not have a deep understanding of data structures and programming discipline though they all claim to have a CS degree.

    Maybe I am too skeptical. The only true product that has come out recently from India is the zoho products written by high school passed guys. I think that is the best model. Get talent out of high school and resurrect the pride of being a programmer. Forget the engg kids from any institution.

    My 2 cents.

    Ravi Natarajan

  4. admin says:

    Ravi,

    It does look like we are from a different planet when we talk about good programmers, isn’t it :)

    What you express is something which lot of senior folks in India and other places express routinely. My friends like Ramesh, who had commented here, are trying their best to work with various universities and rectify this issue. As you very rightly point out, the prestige of being a ‘manager’ outweighs the joy of writing good programs for many people. The situation is definitely different in Canada / US / Europe, where the ‘manager’ tag doesn’t carry too much weight. Infact a contact of mine, who was once my client, has been doing just bug fixing for the last 25 yrs. There is no way such deep knowledge can be replaced with people with couple of years experience but it routinely happens.

    I don’t think you are being skeptical. If we need to correct a situation, we need to first accept that such a situation exists.

  5. Hi Suresh
    Comprehensive review. Thanks.
    It looks to me you have taken a chance and ended up with good book.
    If it was any specific process to glean such a first rate book, share with your readers!.
    Cheers,
    madhu