For all the pressure and tumult at my job that last few months, here’s one good result: I’m writing the best code I’ve ever written. I feel like I’ve leveled as a programmer (this seems to happen every 6 mos. to a year with me as I integrate things I’ve been learning) and can now do up to 186 points of damage with a single line of code.
I just spent the evening finishing off a huge feature set that had been my main focus the last 2 months or so. Tonight it was just cleaning up code finishing off a few loose ends, but I was able to sit back and look at my code and say, woah, that’s beautiful.
It’s a bit like Denny Diaz says about the mu chord: you have to practice it until you can do it without thinking about it. So it’s been with me and lots of best practices and design patterns that I used to work hard to implement and now they just sort of come to me as my first idea on how to approach things.
A few specific things I’ve really been focused on down in the details dancing with the devil. One is to never repeat any code. Ever. Everyone copies and pastes blocks of codes, and I used to be much more tolerant of it. Now whenever I temped to do that, I look at the block and make it into its own method and call it from wherever I was going to paste it. The other thing is I’ve been breaking methods up and writing shorter and shorter methods. I’ve had as a rule of thumb that if a method doesn’t fit on a screen its too long. Now I’m thinking more and more that in many cases over half a screen is too long.