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

Hmmm - I think that the #1 single most important thing to improve my programming happened more than 10 years ago when I read the GoF
Design Patterns book
Although my skills have greatly improved since then by learning TDD, database design, IOC, DI, Agile processes, etc.

But those have all been a lot of small steps - the GoF book was a huge leap.

Taking the AP Computer Science courses in high school helped me the most out of anything.

I say that because prior to that I was self taught and would code in QBASIC as a hobby. I mostly just did my own thing, paying no attention to coding practices or readability. But in computer science I was taught C++ and the fundamentals of OOP.

Obviously I've done a lot to improve my skills since then, but some level of formal training can be extremely helpful to provide a little structure in your coding style. And on top of that I'm glad I had a good teacher to learn from.

A number of years ago, after I started listening to each show during my commute, this podcast really unlocked a whole world of knowledge that expanded my understanding of software development, patterns, architecture, books, and the Microsoft community in general.

Reverse engineering. Looking inside massive compiled proprietary applications, and web applications from only the client side gives you a great view of how things are currently being done in the real world. Also teaches you what to avoid when programming.

Mentioned several times and voted up, but without a doubt - working with smart(er) people and better developers has had the most impact for me.
It gave me a chance to learn from them something I didn't know or how to do better what I already did know and motivated to work on my craft as a developer.

Also, there's a great book by Chad Fowler - "Passionate Programmer" - covers very well a lot of points discussed here, and I think very relevant to the discussion.

Coincidentally, my 2nd one would be being passionate about / liking what you're working on - nothing as motivating as labor of love. Once this happens, you do want to make your end product better, and this leads to trying better yourself as a developer.

I have some dissatisfactions against many inefficiencies in the internet world.
These inefficiencies are usually gone if you start paying some money to the service provider, eg. stockcharts.com, where it provides more services..
But being a cheap guy, I started my own pet projects trying to mimic the provided services.

Sorry if this answer is a duplicate (as I did not read most of the old answers with score less than 2) - in any case it combines some stuff from others (yes, I did upvote them):

Look back at your old code, and rewrite it (from scratch if it is horrible enough)

Read about design patterns and notice the ones you are prone to

do not re-invent the wheel. Ever. If there is a perfectly good freely available library for something USE IT, do not re-write it (unless you can convince the original programmer to accept your re-writing as the next major version). Using good libraries written by other people will teach you more than writing a shoddy one yourself.

One thing that really improved my programming skills was watching and applying Misko Hevery's Clean Code Talks from the Google Tech Talks (available on Youtube, here's a playlist). They're presented in Java, but instill principles that can be applied to any OO language.

By getting into test-first-design I realised that code maintenance and maintainability was multitudes more important than just getting the first working version out. By applying TFD & TDD my code became cleaner, easier to maintain and had far fewer bugs than my non-TDD/hacked code.

I agree with the other comments about reading other people's code to improve your own coding, but one beneficial method was to print out some open source code and look over it with your development team and perform some code analysis. Find ways to improve certain code, find ways of refactoring the code to be more efficient and easier to understand. Look acutely at the variable and method names chosen in that code. Do the names of the variables and methods explain their function? Ask questions!

One of the most effective things for me was one of my undergrad classes where we worked with functional languages, logic programming and constraint programming (in my case it was ML, Prolog, and the prof's own constraint language). With languages like Java and C# being all the rage today, it's easy to have a one track mind when it comes to programming, but I found it extremely beneficial to learn something totally different.

The other big thing for me was working with others that have more experience. When I was working as an intern I learned a LOT by reading code of the most experienced developers. Also learned by having the more experienced developers rewriting my poor code, so I saw first hand better ways to accomplish what I was trying to write.

1) Learned to use a good text editor for everything (Emacs)! You can become so much more efficient if you never have to take your hands away from the keyboard! Keybindings have made me a faster programmer!
2) Learned to use Bash to it's full capability. I can do things twice as fast because I do not have to code everything. I can write two small programs and send the output of one as the input to another using pipes. It is surprising how many good programmers don't know how much time can be saved using the shell.

Learn to justify (in your head) other people's code. It's just too easy to hit programmer's block because of existing code is written badly and needs refactoring. Instead of immediately re-writing and re-testing everything, try to find some perspective from which that code would seem more reasonable. Your perception of code depends a lot on how you look at it. It can be hopelessly bad, or be slightly out-of-date at the same time.

Example: for a long time I hated visual studio .sln and .vcproj files "poluting" my folder structure. It bugged me that my main folder should start with some application specific configuration files. I saw other people's projects that had folder structures like:

ProjectA\
ProjectA\
ProjectA.vcproj
...
ProjectA.sln

And it made sence to me, simple and elegant. But still, for own "ultimate" projects, it was too poluting...

Well, finally I found a perspective, from which this folder structure made sence - think of it as a generic file listing. Those .sln and .vcproj are just some standard, that is common enough to be chosen for declaring all the files in all subfolders. Kind a like declaration of functions in c++ header files. It's just there for Your convenience, and at the same time it can be used for pre-compiling executable binaries from c++ code. Sure, it's xml-format is improssible to read or modify, but for now we can ignore that. As long as it saves time for us to start new projects we can live with it.

I implemented User Threads, a mutex library, and an I/O library for the 3rd homework assignment in the Operating Systems course I took last semester. It basically required us to implement a major part of the kernel from scratch (the whole thing was supposed to run in user space, and we weren't allowed to make any changes to the actual kernel) and managing all the data structures, scheduling issues, concurrency corner cases, and hacking around the native scheduling mechanisms was a very difficult task. After finishing it I definitely felt a noticeable "level up" in my programming skills.

Testing. It made me think about my design, which wasn’t much modular at the time, everything bound together by singletons and similar stuff. Testing forced me to uncouple the code, which was a huge change I am still getting the benefits of.