Protos' Musings

"In the long run men hit only what they aim at" — Thoreau

How to be a better programmer – the redux part 2

with 9 comments

“Most programmers have only a vague notion of how competent they are at what they do for a living”Steve Yegge

“Experience comes from practice”Andy Hunt

I thought I was done and dusted having wrote that previous redux post about how to be a better programmer. But my good friend Subru had posted a comment that made me (as it does most of the time) take notice and do some thinking and research about the importance of study and practice in the career of programmers. I did that since it has a direct impact on the topic I have been harping about — the talent of the programmers like me, or the lack of it.

Subru had wrote that reading a few books need not necessarily make you better. He said that observing and interacting with senior craftsmen would make you a better programmer. It is precisely this attitude and observation that I wanted to do some thinking about. I, based on my personal experience, believe that it is better to read the books than observing the masters. The reason being that you never know whether the maestro is actually doing the right thing or more importantly, it is the right thing for you at the stage or phase of your learning or career.  Plus, what if the meastro hasn’t read anything in the recent past and so is not in touch with the latest developments in the field?

I had this doubt, nay, conviction, partly because I had the good fortune of reading about Shu Ha Ri which was an appendix of the great Alistair Cockburn book Agile Software Development: the Co-operative Game, and partly because I believe Subru was wrong about the books. Shu Ha Ri teaches you that a beginner (the Shu phase) needs a framework or a rigid set of rules to follow, plus constant feedback to get through the initial learning phase. In the intermediate level (the Ha phase) one masters the rules, and learns all the tricks of the trade. In the advanced phase (the Ri phase) one needs to actually forget the rules or transcend the rules and make one’s own rules of the game.

Ok, so what am I harping about here? Well, just the fact that with practice anyone (who is not physically or mentally invalidated to even attempt the task at hand) can move from being a novice to a master. All it takes is dedication and some knowledge of how to travel the path of mastery. I am not saying this. Hear it in Kathy Sierra’s (of the Head First Java and Head First Design Patterns fame) words here. Having experienced first hand how Apple and myself could actually become far better programmers than what we were when we started out, I can vouch for it. I am not talking about the linear progression in talent that people who don’t read books enjoy. In our case, the progression was non-linear, if not exponential, and it was made possible by the simple fact that we studied (read) and we practiced what we studied — him probably more than me.

In fact some of the best minds in our industry believe what Kathy was conveying passionately. Steve Yeggey, one of the best bloggers I have read, has analyzed this topic in-depth, and later came up with an article titled “Practicing Programming” for people like you and me (the average programmer) to reflect upon and work upon to becoming a better programmer. He wrote both the articles a few years back when he was still with Amazon, and now he is with Google.

He writes in the first essay:

Bob (our average programmer) knows this guy Joe who’s just amazing. Joe’s like the best programmer Bob’s ever known…He’s a natural at it. One of them whiz kids…

In Bob’s view of the world, there are essentially three programmer skill levels: folks learning how to program, folks like Bob who know how to program, and the inevitable whizzes, but they’re few and far between. There are always a few whizzes out there, the ones who used to be child geniuses or whatever…

Bob has no incentive whatsoever to try to improve his skills: He knows he’s not as good as Joe. But Joe’s great on account of his genes, not because he practiced or studied more than Bob did, back in school. Obviously Bob can’t compete with people who were kid geniuses, and he shouldn’t exert himself unduly on their account.

It is a great rant and a rich source of stuff for us to reflect upon. At least I came back knowing more about myself and realizing I had been that Bob at many a time, and probably still am a Bob in many ways.

This is reinforced by the works of two authors I respect very highly — Andy Hunt and Dave Thomas (of the Pragmatic Programmer fame). Dave, for instance, thought deeply about the importance of study and practice. He went on to devised a set of exercises, named Code Kata, for exerting the programmer’s brain — stuff for us to chew upon to become better at what we do. And finally, here is his take on the various phases of learning and skill acquisition which is similar to the Shu Ha Ri theory, but based on the art of karate.

Of course, the real spark for this article was this great post by Jeff Atwood: “Programming: Love It or Leave It” earlier this week. From there the trail of reading (thanks to Google) led me to this rather controversial article about how to become a better programmer by not programming. I don’t think, for once, the author is 100% right. Yes, Bill Gates is right, but the point is people can improve and many people really do. As Kathy says, of course, that won’t be enough to be the gold medal winner at the Olympics, but we can be the street, council, district, state or national champions, at least.

So, the point is, IMHO, it is a far safer better to depend on books rather than trying to observe a mentor, for the simple fact that at least I have bumped into only a handful of people in India in eight years from whom I could learn something about programming. Of course there are lots of people to observe and learn about people management and the art of maintaining relationships or soft skills, but that is beside the point of this post. I accept that perhaps I am not good enough to have worked at a Google or a Microsoft, or that I was perhaps exceptionally unlucky (not to have bumped into more mentors) but the point is 90% of the software developers are not working at Google or Microsoft either. And people like me too have a right — and a duty — to improve, right?

As Peter Norvig says in the article Teach Yourself Programming in 10 years, to be really good at anything including programming requires lots of time, effort and dedication, and more importantly, we all know that if the pioneers of the Design Patterns movement hadn’t read Christopher Alexander’s work(s) on architecture, there probably would have been no Design Patterns movement. And if I hadn’t read those great books or those great blogs, there wouldn’t have been this post either!

Apple implants the programming virus in my brain

Also, I wouldn’t have started my journey of becoming better had my good friend Apple not read the K&R book and made me both feel small and admire his skills when he wrote this sometime in 1999 in my notebook:

while (*t++ = *s++);

That, for the uninitiated, is the succint way of copying a source character array into a target character array in C. Apple wrote this after asking me to write a program to copy an array, and the best I could think of was to write half a dozen lines or so to achieve the same, and without using pointers. That was the moment when my journey to get better actually started. Even after that moment, I was the guy who did his C++ project in C (at NIIT), since I couldn’t quite understand what this fuss about using objects was all about (and I was good at C thanks to the K&R book)! And it required reading The C++ Programming Language by Bjarne Stroustrup in 2000 to make me see the light, at last, and luckily, I never turned my back at lapping up a great programming book since then!

To wrap up, I would rather continue reading than either sitting idle or just (waiting for and) watching the right mentor. And I would ask every developer interested in becoming better to do the same.

Oh, and yes, lest I forget…Happy new year and thanks for reading yet another long post!


Written by Proto

January 2, 2009 at 01:43 hrs

9 Responses

Subscribe to comments with RSS.

  1. Reading books won’t do it. Observing a master won’t do it. ONLY DOING IT will do it. There is no substitute. Period. End of story.

    Think about this. You can read a million books about playing a guitar. You can watch a million hours of Steve Vai playing a guitar. After doing that, can you play a guitar? No. Conceptually, you might know everything about the guitar, music theory, etc. But putting them into practice with the strings under your fingers in real time will NEVER HAPPEN without 10000 hours of practice minimum.

    The same is true with programming, to admittedly a somewhat lesser extent, as programming is not nearly so strictly real-time. However there is a finite amount of time to work with, and you want to get the job done, preferably today, rather than tomarrow, so time pressure is not absent. To be able to code well, and quickly, while avoiding the pitfalls, and quickly digging yourself out of what pitfalls you don’t avoid is not something which can be learned from books alone. Practice is MANDATORY, just as it is with a guitar. There is no avoiding it, and to even try is to display a failing already.


    January 2, 2009 at 10:10 hrs

  2. fantastic post for the new year!
    invaluable nuggets of information strewn across this post.

    i have to agree with you – books/blogs are the most vital part in improving our level of programming…it started with K&R then it went on with Stroustrup then to Bruce Eckel then to HF series et al.

    at the end of the day its your passion self-motivation and dedication to improve rather than anything else….your org won’t change your team won’t change as you want to….

    But as Gandhi says “Be the Change you want to see”….its good to strive to be the change…some day the wind and positive vibes from you will affect atleast some of those around you…

    thanks again for this fantastic post


    January 2, 2009 at 12:36 hrs

  3. ScaryReasoner: (whoever you are :) In my defense I would like to state that nowhere had I mentioned anything about not practicing. In fact I had wrote about “do some thinking and research about the importance of study and practice in the career of programmers”.

    Yes, I wrote mostly about reading books, but that was because I find an utter lack of awareness of either the possibilities or one’s own level (or lack of it) as a professional programmer in lots of people.

    Reading is essential for mental growth..there is no escaping that. And may I ask.. without reading what the heck would you practice while programming? I mean programming is not an intuitive art form like music where you get a whiff of inspiration and out pours good or great music (don’t know whether this is possible, but we would assume that it should be possible hearing stories about Mozart and Beethoven). In programming though you can practice bad programming for hours on end, unless you are aware of the better alternatives and what constitutes good design or what is design, there is no way you can even practice and become better.


    January 2, 2009 at 20:36 hrs

  4. I too have a right to defense !!

    If one could say “without reading what the heck would you practice while programming? “, cant one say “how can one get to know what are good books” – neither is that intuitive right ? – thats where i feel a mentor comes in handy. By mentor i don’t mean a “gurukul-like” relationship – rather what i have in mind is that of a person who has been there and done that.

    You would have to do it to know it – agreed.
    You might have to read it to know “how” to do it.
    You would certainly have to be mentored/guided/assisted/helped to know what to read. Direction is what i seek in the first place – well, from my experience i really lacked this in the early part of my career.


    January 5, 2009 at 13:29 hrs

  5. Apple: a very belated thanks for the encouraging comment. I take it as a feedback that I am moving in the right direction. I feel that I am just lucky to have a few really important moments happen in my life, starting with the while loop you wrote. I hope I can be honest and humble, continue to be a good student, and write some good posts in the years ahead as well.

    Subru: Thanks for the comment. Knowing about good books is not intuitive, I agree. Having a mentor is not the answer to know the answer to your question. Internet is. I got to know about the good books from the net (the exceptions being K&R and Stroustrup. K&R was recommended by Apple and Stroustrup I read first and could repay Apple by recommending it to him). You have to read quite a bit to recognize who all are great authors/bloggers and once you have that handy, getting to know about the great books is not difficult. As I said one problem you might face is that even the so called mentors might not have read the great books, which is sad really.


    January 26, 2009 at 17:27 hrs

  6. K&R and Stroustrup – where is the C code that i asked u to write ? If u have any excuses – then u better agree with ScaryReasoner.

    From reading books u have to come reading “about” books on the net and ofcourse, blogs…I like that !!!

    Somehow, i still feel, the best of work would not come from a conventional trained thought process – in this case reading a book. It perhaps comes from out-of-the-box thinking. Books help ( i dont disagree there) ..but they have their limits – which perhaps u might agree to disagree.


    January 27, 2009 at 20:06 hrs

  7. Subru: Thanks for the comment. I think I should have been a bit more explicit about what I meant when I wrote “I got to know about the good books from the net”. I will give you an analogy. For me, deciding to buy a book or deciding which book to buy is a little similar to deciding whether to watch a movie or not, which I decide based on the review in two or three web sites I trust. Before watching a Hollywood movie, I normally check out the NewYork Times movie review []. Over a period of time, I have found this site to be the best indicator of whether a movie is watchable or not. If it is an Bollywood movie, I check the review at and apart from (out of curiosity) the TOI review. In case you don’t believe that one should spend some time checking the book or movie review out before watching the movie, then this won’t make sense to you. But at least, I can’t blindly spend 100s or 1000s on a book (like you might do on a cinema at the theatre for time pass) without first getting an idea about it, and whether other software engineers liked it or not. I will expand upon it in some other post. I think one can learn and achieve a lot in life if one can keep the mind open, and be humble enough to admit that a) no matter how much you learn, there is still more to learn, and b) no matter how good you think your way of learning is, there could be is a better way to do the learning.

    Regarding writing the C program, give me a few more days. I just need to have some motivation and interest to crack it. Plus, I haven’t written anything in C for about 8 years now. Now, before you attack that, I DO remember the lessons I learned (including pointer arithmetic) and that foundation has been quite valuable while learning and programming C++, Java, VB, Delphi and C#. I don’t have to write every day to write sentences. The good lessons just stick if you have an interest.


    January 27, 2009 at 22:49 hrs

  8. Does that mean u wud ask me for “a few more days” or “motivation” if i ask u to write “abcd…xyz” ?


    February 2, 2009 at 15:02 hrs

  9. Start a new blog for R A F A.


    February 2, 2009 at 15:05 hrs

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: