Saturday, October 1, 2011

How to Become a Better Programmer

Here then, in no particular order, are twelve positive things that you can do, at any point in your career, to improve your programming skills. These will also have the added benefit of injecting additional passion into your programming ...

1. Never Stop Learning and Reading

Consciously try to improve yourself and the quality of code you write. Think about what you're doing, why you're doing it, and how you can do it better.  Look back at what you've done on previous projects, and how you might do it differently now, or where you could still improve on it.

  • Read books, not just websites.
  • Read for self-improvement, not just for the latest project.
  • Read about improving your trade, not just about the latest technology.

2. Work With People Smarter Than Yourself

Working with smarter and/or more experienced developers will teach you a great deal. You can learn a lot by reading their code, watching their practices and listening to their opinions and stories. Also, you should always listen to what others have to say, regardless of whether they're junior, intermediate, senior or guru-level developers.

3. Become a Polymath (or 'Jack-of-all-Trades')

Decide to be a 'Jack-of-all-Trades' - also known as a Polymath, Polyglot, Generalist, Renaissance Man or Multi-specialist. This will allow you to avoid becoming 'pigeon-holed' into one specialty, which can stagnate your programming skills, as well as hurt your future employment prospects if your 'specialty' suddenly becomes yesterday's technology. Something to keep in mind is 'the half-life of knowledge' law of technology; it tracks with Moore's Law: half of everything you know will be obsolete in 18-24 months. An expert who chooses the wrong discipline can easily be undermined by the press of technology; a generalist only has to add some more skills and remember the lessons of the past in applying those skills.

4. Read and Document Other People's Code

Read and attempt to understand code written by others. Plus, write documentation for code written by other people. Writing code is significantly easier than reading someone else's code and figuring out what it does. You can see how they do something - maybe they do it in a better way than you. And sometimes this can be one of the best ways to learn how not to do something.

5. Get Programming Experience on a Real Project

There is nothing like getting in and coding, especially under pressure - work on a real project, with real fickle customers, with real, ever-changing requirements and with real engineering problems.

6. Teach Others About Programming

Take a part-time job tutoring computer science students at a local university or college. This will force you to understand something at a completely different level,  since you have to explain it to someone else. As Douglas Adams wrote, "the best way is to try and explain it to someone else. That forces you to sort it out in your mind. And the more slow and dim-witted your pupil, the more you have to break things down into more and more simple ideas."

7. Learn One New Programming Language Every Year

One year gives you enough time to get past the basics - it pushes you towards understanding what's beneficial in that language, and to be able to program in a style native to that language. Each language will change the way you think about programming, and how they do things, to compare that to what you already know.

8. Complete One New Pet Project Every Year

Start a "pet" project and follow it to completion and delivery. A good pet project will push your boundaries and keep you interested; it may be something you have experience with and enjoy plus something you don't know about. E.g. if you know something about game development but don't know Ruby, a good pet project may be to develop a game written in Ruby.

9. Learn Assembly Language

Learning a low level language like assembly gives you insight into the way computers 'think' without any high-level abstractions; the elegance at this level is surprising. There are no wasted motions, no disposing of data, and bugs can have a far greater impact. Developing at this level will teach you efficiency and hone your critical thinking and logic skills.

10. See Your Application From the End User's Perspective

Step out of the echo chamber and improve your understanding of the end-user aspect of software development. Interact with the end-user to see, through their eyes, how they use your software. End users are typically not technical, and they often see software as a magical piece of work, while you see software as a logical set of steps. The two worlds are completely different - what seems easy and logical to you may seem cryptic and inscrutable to others.  You can also find out what kind of 'abhorrent' information they throw at your application. This will help you generate good test cases and stop assuming your program will always be fed the correct set of data.

11. Start a Physical Exercise Program

You work a whole lot better when you're in good physical shape - problems become easier and less overwhelming, wasting time is much less of a temptation, you can think clearer, and working through things step by step doesn't seem an arduous task. An old one but here it is: "Sound body, sound mind.". Regularly devote a bit of time to physical exercise - riding a bike, walking, running, swimming, whatever suits you best.

12. Learn Touch Typing

Typing for a programmer is essential. Everyone has had a coworker who typed using just two fingers and had to look at the keyboard for everything before pecking out their code one letter at a time! Learning to touch type is a quick and effective way to give your productivity a boost as a programmer.

Follow @dodgy_coder

Subscribe to posts via RSS

6 comments:

  1. Thanks for the brilliant advice, I am a programmer/developer but my programming skills are failing me, however your advice just gave me the boost I dearly needed. Thanx!!

    ReplyDelete
  2. Nice post ... I'm always reading books and have done the things your mention. I think there's an interesting balance between being a Polyglot and a negative aspect - not finishing or following through. Note this might not always be the case but enough to matter. For example, I read well over the passionate programmer minimum (whatever that was I forget). However, I never got through the Code Complete 2 tome of about 900 pages. As for the worth, let's just say that for every boring "already know that" page there's a great gem in the next so I strongly recommend (although there's probably at least a dozen must read programmer books huh!). Anyway, so I've recommitted myself to getting through it - even 5-10 pages if that's all I can do on a particular day. I've put it on my iPhone, iPad, MacBook, and have a broken down dead tree copy (man the binding on that book sucks!).

    Guess what, I'm today at the half way point! So I guess my point is that even experienced developers have to keep "checking themselves" ;-)

    ReplyDelete
    Replies
    1. Hi Rob, thanks for your comments. I also sometimes have problems finishing off and following through with side projects. I find it useful if I'm able to incorporate some small part of what I've learned in my day job, whether a new prog. language or a new testing method or something else.

      Delete
  3. This is a very nice post. Keep it up!

    ReplyDelete