4 ms·
I don't have any examples of code I wrote when I was in my early 20s, but definitely I'm sure I was quite naive. Especially if you consider development process
by mikekchar 12y ago
I don't have any examples of code I wrote when I was in my early 20s, but definitely I'm sure I was quite naive. Especially if you consider development process, I had absolutely no idea what it took to build successful teams.
At around 30 I started to clue in and I can recall some designs which were actually not too bad in retrospect. Of course, a lot of the stuff that is taken for granted now (design patterns, TDD, etc) was not well known at that time and so I was exploring and learning things that few other people had experience with.
As another person posted, I'm also nearing 50. I would say that my code has improved a fair amount and I have learned a lot of other techniques which I didn't really know in my 30s (like FP). Rather than technique, though, I think the biggest thing I've learned is patience. I code very slowly compared to how I coded 20 years ago, but I think a lot more about every line. Kent Beck once said that when he wrote Smalltalk Best Practices that he started to evaluate every keystroke and to think why he was pressing that key. I find that I am doing that a lot now and it is very beneficial. The advice I give the young guys on the team the most is, "Stop typing so fast! You need to think about what you are typing" :-)
As I said, the biggest revelations for me are less about pure technique and more about how everything fits together. For example, my less experienced colleagues are often distraught over the perceived sins of the other people on the team. They worry endlessly about how to stop the "crappy programmers" (in their eyes) from "ruining" the code base. Nearly 50 year old me weighs the options and realizes that complaining/campaigning/scheming/negotiating/etc will take an order of magnitude more time than refactoring and will suck the fun out of the room. I like refactoring code and I hate arguing, and besides young people tend to be crap at cleaning (in general). So I clean things and eventually most of the others catch on -- not everybody, but it's enough.
I still get stressed out a lot and I'm hoping by the time I hit 60 I will have resolved those issues :-)