Live data from Hacker News

Ask HN: What habits made you a better programmer?

news.ycombinator.com

21–30 of 103 posts

Re: Ask HN: What habits made you a better programmer?

#21
I do a top down view and a bottom up view, even if just in my head. How should this look and function when it's done? What base classes will I need? Which parts go in between? Also, breaking up things I have left to do into small enough parts that they can mostly be done in a single sitting (obviously there are exceptions). Then I never have to leave feeling like I accomplished nothing.

Re: Ask HN: What habits made you a better programmer?

#22
1. Embracing paranoia - enumerating everything that can go wrong with my code and testing for it. Over time, learning to think of more things that can break.

2. Writing down every question that occurs to me about the technology I am working with, at any point, specifically the behaviour of libraries and nuances of programming languages: I am not an expert in any programming language. Then chasing those questions until they are resolved.

3. When stuck with a slippery bug, attempting to reconstruct the bug in a toy program. If reconstructed, fixing it is easier. If not, I know it's not where I thought it was. Sometimes I never make it as far as actually writing the toy program; the intent is enough.

Re: Ask HN: What habits made you a better programmer?

#23
Maybe it's my undiagnosed Adult ADD, but:

* turning off Twitter & IM

* closing email and Google Reader

* headphones headphones headphones

* big ol' notepad for notes and doodles

Kill as many distractions as possible, make the ability to create & think ridiculously easy and just keep on truckin until you have something to test.

Re: Ask HN: What habits made you a better programmer?

#24
Never just shrugging some problem off with "boy that's weird." I usually can't let something go until I understand what caused an issue. It eventually became unrealistic to chase down every oddity, but I've done enough of them to learn a lot about different pitfalls.

Re: Ask HN: What habits made you a better programmer?

#25

Noticing pain points. It takes time to develop a taste for good solutions. But when you modify or write code, and you say, "this is harder than it should be," this is a code smell and there is a better way to globally solve the problem. Thinking first, writing later. When practicing for the ACM programming competitions in college, I discovered that when writing code before understanding the solution, I eventually nee…

I definitely won't disagree with anything you said in the general case, but for this:

Thinking first, writing later .... I discovered that when writing code before understanding the solution, I eventually needed to start over.

I think this may depend on how and when you think most effectively. Having the discipline to be productive in pure thought is impossibly difficult to quantify. At times I feel productive working that way, but other times just writing code helps me think through things faster. I type fast so it's not a big burden to type a lot of stuff even if I have to delete it.

Of course, sometimes just drawing things out on paper helps as well. I seem to recall Dijkstra making some criticisms of that, but for me it is often highly effective.

Re: Ask HN: What habits made you a better programmer?

#26
Prototyping semi-trivial cases. What I mean is that a solution of a problem might require some parameter so I'll just pick a value of the parameter that makes it possible to solve the problem in a brute force fashion and evolve the code base from that point. This is because I'm a visual and interactive thinker so any kind of feedback that helps me explore the problem space as soon as possible makes me at least twice as productive.

Re: Ask HN: What habits made you a better programmer?

#27
1) Being conscientious, actually caring about the work I put out. Spending that extra hour or two or four after I am 'done' with a feature, cleaning up the layout, making sure the field level validation all works, testing alternate paths, adding a few bells and whistles.

2) Learning how to communicate effectively. Keeping interested parties in the loop at all times. Not hiding mistakes or difficulties, or waiting until the last minute to let a PM know that a task is going to be late.

3) Not falling into the 'stupid user' trap. Your users aren't stupid. They know their business better than you do. You need to understand and accomodate their workflow, not the other way around.

Re: Ask HN: What habits made you a better programmer?

#28
post #24

Never just shrugging some problem off with "boy that's weird." I usually can't let something go until I understand what caused an issue. It eventually became unrealistic to chase down every oddity, but I've done enough of them to learn a lot about different pitfalls.

Funny because that's one of the things that I've learned - when to let something go as 'that's weird' and just solving the problem without spending days digging into root causes. Sometimes it's worth it, but usually it's taking time from getting other priorities accomplished.

Re: Ask HN: What habits made you a better programmer?

#29
Code review. Oddly enough, it wasn't so much the issues that were raised by the reviewers that made me a better programmer (though they certainly helped), but the knowledge that every aspect of my code could be inspected, and I'd be expected to fix it, that forced me to double- and triple-check my work before sending it off. Since that time, even when I'm working on personal projects, I find myself coding defensively, and will often write sections of code a couple times until I'm satisfied that it is unambiguous, correct, and clear.

This has helped immensely when I've gone back months later and tried to figure out what I was thinking; now, it actually makes sense!

Re: Ask HN: What habits made you a better programmer?

#30

Knowing when to stop. When you reach a seemingly impassable problem, talking it over with other people and then sleeping on it will make everything clearer come morning. If you work constantly you are a worse programmer than those who know to take breaks. These are the people who are thinking about what they're doing.

Second that - there's a definite point of diminishing returns and it's worth knowing when you're reaching that point because after that you're just wasting time, burning out, and throwing off future efforts.
Post reply on HN