How to be a good programmer...My tips

This article has been cross posted from my personal blog : 

At the very onset, let me make it clear that I DO NOT consider myself a good programmer. I rate my coding skills as average and I am still learning and have a long way to go before I am even slightly pleased with my programming skills. Yes I am better than quite a few people when it comes to programming, but thats merely because they are lazy and like to sit on idly all day and never bother about programming. Their horrible skills make my less horrible skills look marvellous. I have performed abysmally in ICPC and have never done well in any coding contest worth mentioning (I DO NOT consider college level contests worth mentioning). I havent succeeded yet in Google Summer of Code and my Imagine Cup moderate success (and glorious failure) isn't much to write home about.

So most of the tips I will mention below are lessons learnt from failed endeavours, they are what I have wanted to be and I am not. So lets dive in.

1.Decide why you want to become a good programmer: Is it because you want a job, preferably in a high paying software firm? Great. Then you are set to reach NOWHERE. All good programmers I know are good because they loved what they did. Develop interest in programming. See, programming is the only branch in engineering where you can straightway apply what you learn. Your dad may have a car but he certainly wont allow you to tweak the V2 or swap it for a v6 just to see what happens. But with computers you can do whatever you want. You want to simulate a virus? Cool. Install a virtual OS and run it. Then, when you are done, remove the virtual hard disk. If you are good at what you do, you will get paid and surely get that dream job. Yes, even I want to work in a big software company. But thats not because of the fat paycheck. Its because of the work they do. Because of the exposure I will have. Have you ever bothered to find out what all these companies do and the enabling technologies behind their products or the kind of R&D they do? Jobs will come. Dont make yourself a sucker for one. Sachin is not a great cricketer today because he decided to play cricket to earn money and get dozens of endoresements.

2. Programming languages: Very often people equate good coding skills with number of programming langauges known. Thats just damn untrue. While knowing a lot of programming language is good and sometimes, even, essential; it is more important that you know one or two lanugages very well. I 'know' and have used more than a dozen programming languages and yet C and Java are the ones I am truly comfortable at. Thats sad of course. I really wanted to be good at Assembly and Lisp as well. Never got the time or chance to develop those skills. To be good at a language takes years (at least 2 years). Being good at a language means, you understand where it is best used and where using that language makes no damn sense. On the other hand, knowing a language takes anywhere from 3 days to a week. If you are a beginner, learn C first. Don't buy Yashawant Kanetkar. Buy the book "The C Programming Language" by Brian W Kernighan and Dennis M Ritchie (If you don't know who they are, do this 1. Slap yourself 2. Google their names). This book is not the easiest but is the best. Its a small book but it is the most powerful. Generations of programmers have been brought up on it. And if you think this book is tough for you, please do not harbour any misplaced desires of being a good programmer and do not waste your time by reading this post further. Programming is an art (not a science. Yes you read it correctly), and like any art it requires painstaking effort.

Some people suggest Python as the first language to be learnt. Python is certainly a good language and is easy too. But you will have to rely mostly on the internet for help as not many around you would know Python. Also C has the broadest usage among all programming languages. Also please DO NOT use Turbo C. Its so damn outdated. Use GCC. If you are in Windows download Dev C++. It has GCC

Read this (small) essay by Peter Norvig Teach yourself programming in 10 years . Again, do a Google [ ;-) ]search and find out who Peter Norvig is.

3. Algorithms: Any good programmer has a good understanding of algorithms. Its not necessary that you know each algo by heart (in fact good programmers never learn things by rote) but you must understand when to use what. Algos will broaden your understanding and give you new ways to tackle problems. Another important thing is Data Structures. Its more important than algo. Once you have chosen (or developed) the correct data structure, the algorithm becomes self evident. For algo, read the book "Introduction to Algorithm" by Thomas H Cormen et al. You may also refer Andy Tanenbaum's "Data Structures in C and C++". Also if you have desires to participate in coding contests (the respectable ones), "The Art of Programming Vol I to V" by Donald E Knuth are mandatory. Also may be "Concrete Mathematics" by Donald Knuth. Again reading does not mean remembering everything. Just try and understand whats written.

4. Coding contests: Coding contests are good for developing your algorithmic skills and they make you think fast. Its a good idea to participate in ACM ICPC or Then there are coding contests (like Sun's Code for Freedom, Google's Summer of Code, Microsoft's Imagine Cup) where you develop a complete software. Such contests are spread over many months. Both require different sort of skills. You may be good in one and bad in another and yet you could be a good programmer. Contests like ICPC require lot of practice, fast thinking and you are expected to keep algos at the back of your mind. CFF, GSoC, on the other hand, requires creativity and focus spread over a long period of time. You dont have to come up with solutions too fast and you dont have to mug up algos. ICPC is like T10 while CFF,GSoc and Imagine Cup are like Test Matches. I would suggest you to participate in both types and then decide if you want to focus on either or both.

5. Participating in FOSS projects: You MUST participate in some free software projects. There are just too many. I am working on SCALASCA right now and then I will move on to Sun Grid Engine and Sun xVM Hypervisor and contribute code there. You learn a lot from these. You get to see a lot of code and learn the best practices. And did I mention, it looks good on your CV too. Most people catch cold feet when they go through some of the prerequities of such projects. Take Thunderbird for example. You would need to know a lot of C/C++ and Javascript (for developing modules). Now don't wait till the day you are an expert in these languages before contributing. Programming is an art, don't waste time sharpening your pencil when you should be drawing. You can ask me for directions.

6. Design Patterns: Any art is learnt by emulating. And therefore, you must emulate the best. Design Patterns are tried and tested architectural (of the software kind) solutions to some commonly encountered software design issues. And therefore, a basic knowledge of some common design patters in needed if you are planning to develop something that is even moderately complex. I suggest "Head First Design Patterns" from Oreilly as the first step.

7. Learning by emulation: Emulate the best. And this is possible by reading books written by the best and/or going through code from some of the best free software projects. I would urge anyone serious about programming to read the book "The Art of Unix Programming" by Eric S Raymond (dont forget to first slap yourself for not knowing who Eric Raymond is and then googling his name). You are not a programmer if you have not read that book. Period.

Now let me address a few common grouses

a. I dont find any interest in computers and want to do an MBA:Mainly a statement often repeated by Second Year(sophomore) students. Thats really your problem. I did not ask you to take Computers or even to join Engineering. You did not know, or bothered to find out, what you were getting into when you took up this branch of engineering and I am pretty sure you have NOT bothered to find out what awaits you in a MBA course either. I am also quite sure that 2 years after an MBA (if not earlier) you will also say pretty much the same thing about your job. Well what can I say. All the best :)

b. I dont like reading the books (or any books for that matter) that you mentioned above: Well this is not yet the world of Matrix where I can just feed in programming skills to your brain. Dont force yourself to read them. You can't . Do it only if you want to. And if you don't, please forget about being a good programmer. May be its time for you to use the excuse mentioned above (point a).

c. Give me one programming language that does all: There is none. Each has a different purpose. And thats how things are gonna remain buddy.

d. I want to a 'real' project: Thats great. You can do two things:1. Start one of your own 2. Join a FOSS project. But most people are not happy with this. They expect me to 'give' them a project, one thats easy (read, should not involve anything other than C and the only files you need to include should be stdio.h, conio.h (yes people here still use Turbo C) and may be string.h and math.h) and I should tell them what to learn. When people say this,they expect to go on a Autopilot ride.

e. I will learn X programming language by this sem/year/decade :There is no way you can sit with a book and learn a language. You need to do some real work with it, develop some real software and not just do those exercises in the book (that is necessary of course but not sufficient). Most of the languages I have learnt are because I was forced to do so as part of some project. Just pick up the basics in a day or two and then apply it to a real life project. Need ideas? Come to me.

Finally as Larry Wall says in Programming Perl : "We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris."

Laziness:So that you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer

Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer

Hubris: Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about. Hence, the third great virtue of a programmer.

So get set on your way to become a great programmer, the likes of Richard Stallman, Rithcie, Brian, Raymond, Torvalds. All the best.



Posted by Mia Rizza P. Palaypayon on October 07, 2009 at 05:48 AM IST #

Very practical stuff you have mentioned

Posted by Manjit Sarma on November 13, 2009 at 12:35 AM IST #

The above article was quiet useful...Thanks for mentioning the books as I am a beginner and was very confused from where to start with.. I hope it will help me a lot.....Being a student of electronics and communication , I always wanted to be a good programmer and wanted to learn more.....
Thanks for ur help....

Rohit Joshi

Posted by Rohit Joshi on November 20, 2009 at 05:48 PM IST #

sir i'm very much impressed with ur tips.... i need ur help
i'm a 5th sem MCA student ... getting ready to do 6th sem project...
mu problem is most of my friends are planning to do project on .net ... but i'm don't have much interested in high level programming ... i'm a real hard fan of low level programming... always playing inside RAM, Processors .... so if i get mastery in c .... do i get a good job as
i'm ready to dedicate my whole life for doing something new....
i have a dream to implement genetics and programming together to do something new ....i need ur help

Posted by RAJENDRA on November 23, 2009 at 05:15 PM IST #

@Rajendra: I am flattered by your comments.Now regarding low level programming. I will be honest, I havent done much assembly coding so I am probably not the right person to advice you on how to go about it. But yes, I can say a few things. Firstly, low level programming is not just C but also assembly.You will also need to understand at the least 8051,8085,8086 and 80x86 architecture and the instruction set for the same. Plus the understand of how device drivers work and how to write device drivers.

If I am not wrong, I think MCA degree do not cover all these.MCA is about writing computer applications and hence getting into assembly and device drivers does not make sense. So if you are keen on it, I will strongly suggest you to do a MS/M.Tech in computer science. It will open up a world of opportunities for you.

Posted by Sandip Dev on November 24, 2009 at 01:25 AM IST #

The article above was great, inspiring and practical! i am too an average programmer, i have never learnt code for my CS Engg. Exams(I am in 2nd Year currently) and i always write code spontaneously. My problem is that for some programs i cannot think of solutions immediately! Currently i am having a hard time implementing AVL and B Trees ;). What i need help with are the following questions:-
1)What all programming languages should i learn ?
2)Which field should i do my CS MS/M.Tech in ?
3)I love computer technology and especially love games and would like to write my own games, any pointers for that ?
4)I also am preparing for GRE, any suggestions regarding GRE ?
5)Though i am fairly proficient in C, i still haven't read "The C Programming Language" by D.Ritchie and Kernigham, should i really read it ;)?
6)I suck at time bound programming! how can i improve that ?

Karan Pratap Singh
CSE 2nd Yr
University Institute of Engineering and Technology, Punjab University

Posted by Karan Pratap Singh on November 29, 2009 at 04:47 PM IST #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again....

Posted by links london jewelry on November 29, 2009 at 11:22 PM IST #

1)What all programming languages should i learn ?
That entirely depends on what you want to do and what you are doing. I have generally learnt a feew languages because I needed them for some work or the other...I never really learnt a language to learn a language

2)Which field should i do my CS MS/M.Tech in ?
Again it depends on your inclinations. Give it some time. Try your hand at a lot of things and then decide what u like best...In fact u really dont need to zero in on your area of interest until Masters..once their think about it....

3)I love computer technology and especially love games and would like to write my own games, any pointers for that ?
I really haven't done any game programming. But yes, I can say this much. Game programming involves a lot of things, the visuals, the AI are to name a few. OpenGL and DirectX are the two main libraries here. OpenGL runs on both Unix and Windows while DirectX is strictly Microsoft...

4)I also am preparing for GRE, any suggestions regarding GRE ?
No I am not the right person. I appeared for CAT this year..Might appear for GRE next year.

5)Though i am fairly proficient in C, i still haven't read "The C Programming Language" by D.Ritchie and Kernigham, should i really read it ;)?
Yes...If C is a religion, that book is its Bible.

6)I suck at time bound programming! how can i improve that ?
Simple. Practice. Try at

Posted by Sandip Dev on December 02, 2009 at 03:41 PM IST #

Thanks a lot Sir
that really was helpfull.
i have some more questions :)
1)i really wanna do MS from Stanford University(Dont like MIT that much ;))?
do you know any senior that is doing MS in stanford ?
can you ask them about what counts in an MS application and what type of research or training is helpful?What do stanford people look for in a student while accepting offers ?

2)any good books for learning C++? java? and what about DBMS?and algorithm analysis and design ?for OS galvin or tanenbaum ?

3)Regarding my choice for future research, i am really confused because whatever i study related to computers, i really enjoy it.i got into CSE because i had genuine interest in computers and programming since i was in 3rd class(remember LOGO ?).so it is difficult to choose 1 fild.

Karan Pratap Singh
CSE 2nd Yr
University Institute of Engineering and Technology, Punjab University

Posted by Karan Pratap Singh on December 03, 2009 at 10:31 AM IST #

Great post.,you should hv also mentioned herbert schild for amateurs

Posted by Ritham on December 04, 2009 at 02:47 PM IST #


Am doin ma final year CSE..!!! Searching for innovative projects on fields like Ai,Web technology..!! Hope you will suggest me a topic...!!


Posted by Sriram on December 04, 2009 at 04:08 PM IST #

Im a MCA student. I think m an average programmer and I want to improve my algorithms to the best in optimization and on every thing. When ever I try to write to code programs I simply became confused at last what happens is that I cannot submit my code in time. But my friend calls me as rapid programmer but I don't think so... Is there any way to make logically good and optimized algorithms plz hlp me....

Posted by Indrajith on January 03, 2010 at 04:09 AM IST #

sir if u dont mind can i put this artical on my personal blog...

Posted by Rajendra on January 03, 2010 at 02:35 PM IST #

@Indrajit: I am not really an expert in algo but from my limited experience I can say that the only way to improve your algorithmic skills is to practice more, speed will build up eventually. Try solving the various problems at topcoder, codechef, SPOJ, ACM uVA and others. Also read some good books on the subject.

@Rajendra: Yes you may do that. But please include a header "This post appeared in". In case you make changes to my post and then put it on your blog add the header "This post has been adapted from the post"

@Sriram:Well all the fields you mentioned are too broad. So may be if you can narrow it down,I might be able to suggest something. Though I have to warn you that I am probably the worst person from whom you can seek any help on academics. ;-)

Posted by Sandip Dev on January 04, 2010 at 08:33 AM IST #

i am very new in programming language.can u give me some tips or suggestions to how to start and develop myself in programming language?

Posted by guest on January 26, 2010 at 03:02 AM IST #

i am very new in programming language.i dont know how to think to solve a problem by programming language.can u give me some tips to develop myself and how to start to solve o programme.

Posted by shampachowdhury on January 26, 2010 at 03:13 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

Hi. I am Sandip Dev. I am a student of Computer Engineering at SVNIT (NIT-Surat). My passions are coding, listening to music, reading and learning new things. I am also the Chairperson of the ACM Chapter of my college and Sun Campus Ambassador here.


« July 2016