Lurker News
A quote by Kent Beck: I'm not a great programmer; I'm just a good programmer with great habits.

So what are the habits I should cultivate to be a great programmer or even a good one? What are the bad habits that I should drop?

Comments (183) 79 threads

Earlier comments
bencollier492 replies#
"Don't surprise me". The best code doesn't make you double-take when you're reading it.
cwilkes#
Thanks for making that so succinct. I can't count the number of times I've run into code like that. I used to have scorn for devs that handed code over like that but I've since turned around to thinking that this is mostly due to time crunches. Maybe something worked and then it didn't so they hacked in something and moved on. Also I have the benefit of seeing this for the first time and not glossing over it with a mental "oh yeah that junk, let me get to the next issue" So my advice would be like the scouting / camping / hiking saying of leave it better than you found it.
noway421#
Ah the "WTF per minute" metric.
DrNuke#
From my 25+ years experience, the main quality for being called great is getting sh*t done. It is never easy because of distorted but still very human mental (tinkering, overthinking, underthinking), physical (laziness, low morale, disorders) and relational (team dynamics, managers, politics) habits.
DanielBMarkham1 reply#
1. Don't "give up" when trying something new and cut-and-paste and thrash around blindly sticking things places. It takes just as long to learn why things work the way they do as it does to slash and burn -- and you'll pick up something useful along the way

2. Check your ego at the door. A good friend begins a class he teaches having coders say "I'm a programmer and I make mistakes"
3. I've seen a lot of simple systems that did useful things that grew into complex systems. I've never seen a system that started off complex being anything but a huge PITA for everybody involved. Keep It Simple, Stupid
4. Learn all the major programming paradigms and be able to solve problems in all of them. In my opinion, this is the first step to being any kind of programmer at all, much less a great one
5. We write code to help people. We write code alongside other people. People are a critical component, yet we hardly talk about them. Programming is about 95% social, 5% technical. But reading the latest industry news, you'd never think that. Keep your focus on the people, not the tech. Knowing and manipulating the tech is how you get in the game. How your work impacts real people is how you master it. You should be a professional and write clean code, but nobody cares about your standards if you're not getting along with others or making something somebody actually wants
6. Study mistakes and disasters. In every true professional field, folks spend a lot of time picking over and thinking about things when they go wrong. You should do the same. A big part of success is simple failure avoidance
7. Pair/mob program and use TDD if you're deep in OO or complex/mutable code. Nothing shows you how much you still have to learn like making what looks like a simple change and watching dozens of tests go red
8. Keep learning more about text processing and command line utilities. There are a ton of people right now writing complex code for things that can be done in a few lines of shell scripting. Don't try to solve everything in the shell, but know that a little bit of code can replace a ton of work if you know what you're doing.
9. Pick 2 or 3 IDE shortcuts and practice them each week. The less you touch your mouse and the more you can do work without moving your hands the faster you'll be. (This is one I need to work on)
10. Hang out with people that are better than you and pay attention. Greatness tends to rub off over time.

tome#
> 3. I've seen a lot of simple systems that did useful things that grew into complex systems. I've never seen a system that started off complex being anything but a huge PITA for everybody involved. Keep It Simple, Stupid

Seems to be Gall's law:
https://en.wikipedia.org/wiki/John_Gall_(author)#Gall.27s_la...

dep_b#
Refactoring is like the Fight Club. Never talk about Refactoring. Instead do it all the time while implementing new features instead of saving it up until the building falls apart.

Load more comments