Looking back at my career and life as a programmer, there were plenty of different ways I improved my programming skills - reading code, writing code, reading books, listening to podcasts, watching screencasts and more.

My question is: What is the most effective thing you have done that improved your programming skills? What would you recommend to others that want to improve?

I do expect varied answers here and no single "one size fits all" answer - I would like to know what worked for different people.

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

18

Practice, practice, practice. And never be satisfied with the first thing that comes to mind.
–
Mark RansomSep 3 '10 at 5:28

2

+1 for Mark Ransom...The difficulty comes when you're still not satisfied with the 100th thing that came to mind!
–
Stimul8dOct 21 '10 at 8:11

I know it seems really gratuitous and potentially reputation whoring, but if you separated those items out to one per answer people could vote up which ones they agreed with, allowing for a more specific end vote "solution" of this question.
–
davebugSep 16 '08 at 23:10

117

Watch how smarter people handle mistakes - that's when I learn the most from them
–
Mike RobinsonFeb 2 '09 at 21:38

82

if this is a list in no particular order, shouldn't it be an unordered list rather than an ordered one? :P
–
Jon WAug 31 '09 at 19:03

3

I agree with mmyers - just because you disagree with someone doesn't mean you're ignoring them. Actually, it's the opposite - in order to disagree with them you're actually paying attention to them.
–
Cristián RomoOct 10 '09 at 21:46

15

I don't cart-blanche disagree with everything Joel says, I think much of the time he has some interesting things to say. My comment was tongue in cheek. There's a lot of stuff that I agree with when it comes to Joel, but about once a month he makes me shake my head and ask "What? Are you serious?!". Which I love, as I find those the most challenging things that force me to really check my position and what I believe.
–
cranleyOct 19 '09 at 17:14

Fairly early in my career, I was an expert with a particular database and programming language. Unfortunately, that particular database lost the 'database wars', and I discovered that my career options were ... limited. After that I consciously decided that I would never let myself become boxed in like that again. So I studied everything I could get my hands on: Windows, Unix, C, C++, Java, C#, Perl, Python, Access, SQL Server, Oracle, Informix, MySQL, etc. Whatever tools and technologies are new or unusual, I became the 'go-to-guy' -- "Ask Craig, if he doesn't know it, he'll learn it." As a result I've worked on all sorts of projects, from embedded systems for environmental telemetry to command and control systems for missile defense.

The only problem I've ever had is with companies that insist on pidgeon-holing me into a specialty, when my specialty is being a generalist. [EDIT: Also known as a Polymath or Renaissance Man or multi-specialist.]

Something to keep in mind ... what's the half-life of knowledge in high tech? 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.

"Jack of all trades, master of none, though often better than a master of one." -Adam Savage
–
jmsSep 19 '08 at 6:08

9

Excellent advice, up voted. The "orphan tech" in my past was my 8-bit Atari, which lost out to the C64. I reached the same conclusion though - to quote Heinlein, "specialization is for insects."
–
Sherm PendleyOct 23 '08 at 20:48

17

There are always tradeoffs, and there's only 86,400 seconds in a day -- you'll have to decide how you want to spend them. In my case, I've chosen to spend extra hours (above and beyond my 'work' hours) to learn things that I thought were interesting or were going to be in demand in the future; you'll need to make your own choices.
–
Craig TraderJun 16 '09 at 16:23

I always thought of my self as a pretty hot-shot programmer. Then a new guy, call him Aaron, was hired into our team. Aaron was obviously much better than me in most areas. He was younger than me, too. He made me realize I hadn't really improved much in the past years. I was an ad-hoc hacker, and a mediocre one at that.

This alerted me to consciously try to improve myself and especially the quality of code I write.

Aaron lead me to learn a lot of things. He taught me how most of the code I write will have to be maintained and extended for at least several years, so I should write the code with that in mind. I should write automatic tests for my code. Aaron was always talking about how I should never stop at the first working version, but refactor and refine until the code is elegant. I've discovered that the languages and tools I was using had a lot of room for improvement.

The most important thing I learned from Aaron was to never stop learning.

After a couple of years, Aaron left the company. I felt empty. The past years with him had lifted me to whole new levels of skill, and I realized I was now much better than the rest of the team. They were still writing bad code, and doing the same mistakes as before. I tried to teach them, but they had no interest to learn. In fact, they were annoyed that someone would be so arrogant to tell them what mistakes they were doing.

So, a few months later, I left the company as well. I moved to a smaller company with a very talented team. Everyone there wanted to learn more, and I loved it.

I'm glad I met Aaron. Without him, I'd probably still be working at the old company with the old gang, going nowhere, and thinking too much of myself.

That typically works both ways. I've come into a few companies now as an 'Aaron' and found that once I get the other coders energized that they start to give me a run for my money and encourage me to redouble my own efforts. Great post!
–
EchostormOct 24 '08 at 11:46

28

+1 for "Aaron was always talking about how I should never stop at the first working version, but refactor and refine until the code is elegant"
–
iceangel89Jun 16 '09 at 11:17

17

"never stop at the first working version"??? - when are you supposed to get the rest of your work done? :)
–
Ronnie OverbyOct 2 '09 at 3:10

4

I've attempted to be Aaron, sometimes it works, but sometimes I'm wrong. "Those who cannot learn from history are doomed to repeat it." It's good to keep our minds open to new ideas, but it's bad to listen a n00b over those who've already made the mistakes for you. Everyone needs some skepticism, as we learn from asking questions of ourselves and others.
–
Dan BeamDec 21 '09 at 3:58

27

The problem is too many people think they are "Aaron"
–
cinqoTimoAug 21 '10 at 17:46

AND one of the best ways to learn what NOT to do :)
–
AviDSep 21 '08 at 10:46

9

You can see how they do something. Maybe they do it in a better way than you?
–
JontaNov 19 '08 at 14:52

4

I had to dig into a really old and completely undocumented project, document it, fix some bugs in it, and port it to a new system. I learned a lot, and not all of it was what not to do. Though I did learn the value of comments.
–
SydiusDec 9 '08 at 6:56

Seriously, my brain works a whole lot better when I'm in shape. Problems become easier and less overwhelming, goofing off is much less of a temptation, and working through things step-by-step doesn't seem like such an arduous task.

The sad fact that a majority of people don't exercise or even stretch at all on any sort of regular basis is a huge problem in today's world.
–
SneakynessDec 3 '09 at 7:29

5

I'll extend this, if I may, to any amount of physical excursion. Sometimes, when I've not done much manual work for a while, I start to crave physical tiredness. It's kinda novel when you're so used to being mentally drained and it helps you break out when you're just thinking yourself round in circles.
–
Stimul8dOct 21 '10 at 8:20

1

yes that's the big problem today. we don't have the time especially in pakistan where the working hours are lot more
–
maz3ttNov 27 '10 at 7:45

Programming. Working on interesting projects. There is NOTHING like getting in and working on stuff. Especially under pressure. I always tell anyone who asks me how to program - just find a cool project (even if you have to make it up) and work on it.

Exactly. The single best way to become a better coder is to code. You can learn all you want from books, podcasts and co-workers, but you have to apply it before you really understand it. Code more, and code more different stuff. Because you don't learn much from repeating the same old trick.
–
mcvJan 12 '10 at 16:30

An instructor at the university told me about the opening when I was still a student. I stayed for nearly a year (part time) after I graduated.
–
Bill the LizardOct 1 '08 at 20:05

29

As Douglas Adams writes in "Dirk Gentley's Holistic Detective Agency": "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."
–
JontaNov 19 '08 at 14:58

2

Too True. Teaching photography made me a better photographer. Not much of a coder tho :(
–
CAD blokeNov 20 '08 at 6:41

I'm a big fan of the "learn one programming language every year" system. One year gives you enough time to get past the "okay, I know the syntax, so now I know the language" bias, and forces you to go a little farther and understand what's beneficial in that language, and program in a style native to that language (By which I mean, you don't end up writing java applications using Ruby syntax). Each language will change the way you think about programming- I knew how to use recursion, but thinking in recursion didn't happen until I took a class on prolog (I imagine a functional language like ML would have the same effect).

Start a Pet project. My personal equation for a good pet project is, something you have experience with + something you don't = app you would find useful. For instance, Migratr (my own caffeinated-weekend-turned-ongoing project) started out as "I know c#, but I've never coded against a web API. And I want to move all my photos to Zooomr". It could just as easily have been "I've coded against web API's before, but I don't know C#"

Publishing your pet project is an amazing educational experience in itself. Suddenly all the things practically nobody teaches but everybody's supposed to know (for me it was setting up your own testing system, getting the most out of version control systems, how to pace yourself when nobody else is setting your deadlines, how to interact with your users and how to know when to say "no" to feature requests), all that stuff bubbles to the surface and forces you to self-educate on a level you weren't before- at least not by idly reading flamewars on dzone about the pros/cons of the "foo" vs "bar" way of doing things.

Doing these two things covers both ends of the spectrum. Learning a new language will make you a better coder. The pet project will make you a better developer:P

Taught myself assembly. Did it on an old 6502 chip when I was 13? 14? Too long ago. But I can't think of anything that will improve your development more than getting down to the bit level.

Learning assembly gives you insight into the way computers 'think' on a fundamentally lower level, and the elegance at this level is surprising... there are no wasted motions, no 'disposing' of data. Developing at this level will teach you efficiency and hone your critical thinking and logic skills. It will also cure you of any sloppy habits you have fairly quickly!

The 65xx chip had three registers (the accumulator, X, and Y) and no machine level instructions for multiply or divide. I remember coding a routine to calculate battle damage, looking through the book, and suddenly realizing that I would have to write my own math library. Spent a couple of weeks scribbling 1's and 0's all over my notebook, trying to figure out what 'divide' and 'decimal places' really meant.

I've studied C++, pascal, .NET, many others since then... but none of them have taught me as much, intrigued me as much, or left me with the sense of 'wow' that assembly on my old commodore did.

Seriously, there are books, there are coding katas, there are sites like this, but I believe that the best way to improve as a developer is to work on real project, with real fickle customers with real, ever-changing requirements with real engineering problems. There's no substitute for experience.

If you want to get better at something, there is nothing better than doing it.
–
Jeff SiverSep 12 '10 at 21:03

4

+1 -- This reminds me of Finding Forrester: "The first key to writing is... to write"
–
LorenzoSep 12 '10 at 21:45

2

There's no other answer. You can't really say you know what you're doing until you've written a non-trivial pile of code and stuck with it through a few product iterations with the business guys + the customers. You don't /really/ know how good your code is until it's time to make it change to meet new requirements.
–
bluczSep 12 '10 at 22:27

1

Definitely the best thing I did to improve my programming was getting a job.
–
Matt EllenSep 13 '10 at 15:25

I think the most important thing you can do is make a conscious effort to improve. There's no single silver bullet, you have to keep looking for new sources of information, new experiences, and more practice.

And the second most important thing, think about what you're doing, why you're doing it, and how you can do it better. Same thing with previous projects. Look back at what you've done, and how you might do it differently now. Think about what could have been done better, or where you could still improve on it.

I see two great examples of this at work every day. I have one coworker who loves to learn, and wants to be the best developer he can. He's uses any downtime to read blogs, read books, discuss programming techniques, and ask tons of questions. He's also very noticeably improved in just the past year. Another coworker does his job, and does it fairly well. But that's all he does. He sticks with what he knows, doesn't make much effort to improve, doesn't work on any projects outside of his existing ones, and after 4 years, he has the exact same skill set and programming ability that he had when I met him.

Typing for a programmer is essential. Everyone has had a "programmer" coworker who typed using exactly two fingers and had to look at the keyboard for everything. Not fun. Learning to touch type give a huge boost to your productivity as a programmer.

Touch Typing is the most important skill. The greatest crimes in programming have been committed by those trying to save a few keystrokes.
–
James CurranSep 23 '08 at 16:45

5

This beats all the other answers, in my opinion. Typing saves tons of time, which means you can spend more time entering code and trying it out. It means you can type in the examples in a book instead of just nodding your head, moving on, and forgetting. Trying to be a programmer with hunt-and-peck is like trying to be a concert pianist by tickling the ivories with your feet.
–
KyralessaAug 26 '09 at 18:22

2

I have seen people hit 15 up arrows to recover a 2 character command. Pretty sad. It's like some kids without an IDE... completely incompetent.
–
xcrampsSep 2 '09 at 16:09

7

To be contrary here, I never learned to touch type. I tried learning once, but immediately started getting pain in my wrists, resting them on the desk to assume the proper hand positions was putting pressure on the all-important carpal tunnel. So I figure my pick typing at least has some ergonomic advantages. And I've been doing it for so long, I only glance intermittently at the keyboard, so no real productivity loss. Most of my time is not spent entering chars anyway, it's spent reading code and figuring out how to best solve the problems as they come.
–
EloffNov 12 '09 at 2:39

2

The hand positions are not important - the important thing is that you can type without having to look. On my laptop I do not rest my wrists.
–
user1249Nov 21 '09 at 9:19

You can read all the books, code, and open source projects you like, but you need to understand the end-user aspect of software development. You need to step out of the echo chamber. So I'll address a couple non-technical points that will help your technical career.

Step away from the keyboard and interact with the end-user and see, through their eyes, how they use the software. End users are typically not technical, so they see software as a magical piece of work, while you see software as a logical set of steps. The two worlds are completely different. So what seems easy and logical to you may seem cryptic and intimidating to others.

Test, test, test. A lot of the software I've seen in large corporations use test cases. Hell, they use JUnit, xUnit, and all the other unit testing languages out there. But the problem I've seen is that most programmers never see what their software looks like in Production. Learn how users (or systems, if these are batch jobs) interact with your application, library, or interface to find out what kind of abhorrent information they throw at it. This will help you generate good test cases and stop assuming your program will always be fed the correct set of data.

I find TopCoder a little problematic. OK, it makes you better at thinking about algorithms, but you are forced to work with bad style (all code in one class) and under time pressure, so you probably won't comment and test. Perhaps Project Euler is the better choice.
–
hstoerrDec 10 '08 at 16:12

3

You're not forced to work with bad style; you can have as many classes as you like. Also, you had better test if you want to pass consistently, since a solution that fails a single edge case gets zero points.
–
mquanderFeb 13 '09 at 19:39

2

@hstoerr - not to mention the fact that competitors are rewarded for making their code difficult to read (their solution is harder to challenge)
–
Shane FulmerMay 18 '10 at 14:27

7

(sorry if this sounds offensive) I find people who don't like Topcoder (or other similar contests) try to invent reasons why doing them will make you a terrible programmer. Its ok if you don't like them. But making up spurious reasons is IMHO not helpful. No serious contestant at TC intentionally obfuscate code (it is actually grounds for disqualification if caught). I see lots of people who don't compete write bad code all the time. Algorithm contests do not aim to teach good coding habits (learn that from somewhere else), rather they aim to teach/develop something much deeper.
–
MAKNov 3 '10 at 12:45

2

TopCoder is way to show yourself how much better you could become.
–
Thomas AhleFeb 6 '11 at 2:07

Go all out: create your own project, your milestones, your resources, dependencies, requirements, and test plan. It will force you not only to improve your programming skills to operate within specific parameters, but will also serve to highlight exactly where you most need to improve. Make regular updates about your progress, whether through a blog or more formal project updates, so that you can see exactly where you've been and where you hope to go.

I think constantly questioning what you are doing is the biggest thing. Never think that your code is perfect, always strive to improve it.

It seems like I've had 2 or 3 times when I thought my code was perfect, then realized I had a long way to go.

I guess the biggest thing was when I started seeing my code itself as consumed by other programmers and not a machine. It's easy to write code your machine can process, but it's tough writing DRY, understandable code.

And I don't mean just understanding "What does this line do", I mean making it trivial to figure out "How does this class fit in with all the other classes" while making the classes interface so well-formed that it's virtually impossible to misuse it.

They say that 70% of good code is error checking and handling. When I started programming that way, my code got a lot better. Thinking about what can go wrong and then handling it right away has made a huge difference. It feels like doing all that checking is just getting in the way of getting the code up and running, but it shortens the time from start to finish by a factor of 2 to 4.

My coding skill improved a lot when I started wondering before implementing something how am I going to document this thing.

"Thing" here should have all the possible granularity. From the method to the whole product. For instance at the method level it prevents adding a method in the API that doesn't fit, or is unclear, before actually writing it. And if I really need to implement a method I cannot document (easily), it's a sign there is a design problem somewhere...

Automatically, the attitude "if I can't explain it, I don't write it" filters out bad code and conversely once I know how to document correctly a thing, it becomes simpler and cleaner to implement.

Personal Projects: Ever since I started programming I have been doing personal projects. Ranging from little games, image processing, steganography, implementing file type specifications, implementing various protocols from scratch, or implementing various programs over time.

Reading books: I decided to read and follow through various books in my spare time. There are a lot of well written books by experts just sitting around waiting to be read. The depth you can get from a book is unmatched by for example reading various forum posts.

This is usually my chronological order of learning any new technology:

Regularly read good blogs (Atwood, Martin Fowler, etc.), Keep up-to-date with technology news, Follow stuff about interesting new technology. These steps will let me decide if I find anything interesting to further explore.

Read the right book or any other resource to learn for your level (e.g. for beginners if you want to learn design patterns, I would suggest 'Head First Design Patterns'). I have also specific preferences for books.

Roll out a toy project or two using the thing I learned. I don't worry about the usefulness of the project. My intention is just to exploit my learning. (e.g. A calculator project for OOP would be fine)

I would see if I could use the stuff at work. (e.g. Though we don't use subversion at work, I use it as my local repository, I used Ruby for a task which would otherwise be too monotonous, and time consuming)

This is the best part which I think most people miss out. Knowledge sharing sessions.Give a session or two to fellow team members for example. I believe teaching is one of the best ways to really learn the technology. I guarantee your level of understanding of the technology will become multi-fold, whether you audience gets it or not. :-)

Hack on some open source project for a few months; the larger the better. When you're interacting with some highly opinionated, geographically diverse people who don't know you, you can't help but learn from your mistakes far faster - I think it's a certain embarassment factor. Plus, if you identify one or two really smart people, then you can glean valuable insight, if not pure knowledge, from them.