Live data from Hacker News

Ask HN: What habits made you a better programmer?

news.ycombinator.com

31–40 of 103 posts

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

#31

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 workin…

I think it's more "think about what you wish to accomplish with the piece of code that you're about to write". Are you trying to write something that will satisfy users' desires? Then you darn well better think about every aspect of those desires, and make sure that the code you write satisfies them. Or are you trying to learn what users' desires are, or how the technology you have available will help you satisfy them? In that case, you may be better off just diving in and coding, but you should think about the question you want answered before you code.

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

#32
post #20

Taking a nap. Seriously, the most difficult problems I've faced have been solved easily just after taking a quick nap (30 - 40 mins). Most of the time it comes to the point that there's no solutions in the horizon, I'm pulling my hair out and biting on my keyboard and then, a quick nap later most of the problem is solved in 20 mins when I sit in front of my computer again. It's got probably something to do with uncon…

I can't agree with this enough, though I've found that the sweet spot for me is a 20-minute power nap. Any longer than that and I feel groggy rather than refreshed when I wake up and start coding again.

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

#34

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 workin…

I think you're both right. Some people do like the grandparent suggests and map their strategies out in advance. I personally do better with Brooks's "build one to throw away" approach. I like this better because I can't work with a plan like others do. I need to have implemented something before I can understand it. Others work better with a different approach. To each their own.

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

#35

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 unt…

1) is very important for me too. Many people will say 'oh don't take your code so personally' but that just doesn't work for me. When I write something I want to be proud of it and I'm going to feel bad if it doesn't work even if it wasn't my fault or responsibility.

Also agree on 3) If a user asks for something 'stupid' you can't just shoo them away. There's a reason they asked and your job is to find out what that reason was - and to come up with a solution for your client that fits the rest of the system. The client may not know what they want but they do know that there's a problem that needs to be addressed somehow.

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

#38

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.

with you

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

#39
post #5

Three things: learning one editor (Emacs) really well, learning new languages that force me to think differently, and as am6100 said, writing a lot of programs.

I've used emacs for 9 years.

Last week, on a whim, I went cold turkey to vim.

The result: I'm probably staying with a (heavily modded) vim.

I added the standard bash/emacs/OS X input keybindings to insertion mode.

It feels like the best of both worlds.

The moral: it's good to branch out and try new things every now and then. You might get surprised.

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

#40
post #20

Taking a nap. Seriously, the most difficult problems I've faced have been solved easily just after taking a quick nap (30 - 40 mins). Most of the time it comes to the point that there's no solutions in the horizon, I'm pulling my hair out and biting on my keyboard and then, a quick nap later most of the problem is solved in 20 mins when I sit in front of my computer again. It's got probably something to do with uncon…

Actually by taking a nap you are doing something really cool.

Let me explain:

You are actually inviting your right hemisphere(the creative side of your brain) to come out and play. The right hemisphere cannot be forced into thinking that much so by taking a nap you are actually letting the unconscious work for you.

As a really interesting side note, Thomas Edison used to take a nap whenever faced a difficult problem. He used to nap with ball-bearings in his hand and when he would fall into a deep sleep dropping the ball-bearings would wake him up, and he would wake up and tackle the problem. :)

Post reply on HN