Live data from Hacker News

Want to write some code? Get away from your computer

blog.rtwilson.com

31–40 of 64 posts

Re: Want to write some code? Get away from your computer

#31

One of the best lessons I learnt from my first boss was: “when your code doesn’t behave as expected, don’t use the debugger, think.” Can't entirely agree. I'm not a grizzled programmer, so sometimes when I'm coding for microcontrollers the debugger winds up teaching me about some new quirk in architecture. It's often something I was aware of (endianness, some of the finer details of addressing) but had not yet actual…

It drives me nuts when people 'fix' things by making the symptom go away without understanding what causes that symptom in the first place.

[deleted]

Re: Want to write some code? Get away from your computer

#32

Earlier quoted context omitted.

It drives me nuts when people 'fix' things by making the symptom go away without understanding what causes that symptom in the first place.

When used correctly a debugger will help you unravel the root cause of a problem, I don't see using one as a route to just fixing symptoms.

A poor developer uses his tools to cover up the symptoms. A good developer fixes the root cause. The ability of the good developer to fix the root cause quickly and efficiently is bounded by the quality of their tools. If you want to claim that a good developer will find it no matter what, fine, but don't tell me the developer with better tools won't be able to do it faster; it's almost the definition of "better tool". I find it very strange how people just write off using a debugger, ever, for any purpose, and think it labels them as a better developer, as if a carpenter who refuses to use a plane under any circumstances is thus a better carpenter for resisting the temptation to easily-smoothed wood. (The fact that a plane is good for more than that is deliberately part of my point.) It isn't the best solution for every problem and I certainly don't reach for it directly, but when you need it, you need it.

Re: Want to write some code? Get away from your computer

#34

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

Same here... Just a week ago, I spent the whole night looking at code trying to find out how some mysterious data loss had occurred. Needless to say, I had been to bed half an hour before it hit me what had happened. I instantly got up and fetched my laptop to confirm that was indeed the case.

I think you are right, about letting go of all assumptions, and that helps you find the edge cases.

Re: Want to write some code? Get away from your computer

#35

One of the best lessons I learnt from my first boss was: “when your code doesn’t behave as expected, don’t use the debugger, think.” Can't entirely agree. I'm not a grizzled programmer, so sometimes when I'm coding for microcontrollers the debugger winds up teaching me about some new quirk in architecture. It's often something I was aware of (endianness, some of the finer details of addressing) but had not yet actual…

The debugger vs no debugger "problem" has been discussed through and through countless times with little result. I don't think we'll reach new insight this time. People just work differently.

Re: Want to write some code? Get away from your computer

#36

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

At one of my old jobs, some of the other employees jokingly referred to me as "the master of the arcane."

Any time they had a problem they couldn't figure out, they'd come to me and ask me to help with it.

My trick was to listen to their problem and then go take a walk. Our office was in a nice area with plenty of sidewalks. So, I'd get the details of the problem and then go take a walk for about a half hour while I thought about the issue.

After the walk I was able to sit down and my computer and implement whatever weird thing it was.

These days I do work from home (freelance) so I find myself pacing around my house while trying to figure out something odd. I think I've worn a groove in the grass at this point.

It really does do wonders for the brain.

Re: Want to write some code? Get away from your computer

#37

One of the best lessons I learnt from my first boss was: “when your code doesn’t behave as expected, don’t use the debugger, think.” Can't entirely agree. I'm not a grizzled programmer, so sometimes when I'm coding for microcontrollers the debugger winds up teaching me about some new quirk in architecture. It's often something I was aware of (endianness, some of the finer details of addressing) but had not yet actual…

I agree. There's times where you need a debugger and there's times where you don't. Learning to recognize those situations are valuable, in my opinion.

Sometimes good old pen and paper is the best solution when you find yourself getting into a bind. Other times, stepping through the code and watching what happens to the data/memory is the way to go.

Re: Want to write some code? Get away from your computer

#38
post #32

Earlier quoted context omitted.

When used correctly a debugger will help you unravel the root cause of a problem, I don't see using one as a route to just fixing symptoms.

A poor developer uses his tools to cover up the symptoms. A good developer fixes the root cause. The ability of the good developer to fix the root cause quickly and efficiently is bounded by the quality of their tools. If you want to claim that a good developer will find it no matter what, fine, but don't tell me the developer with better tools won't be able to do it faster ; it's almost the definition of "better too…

A developer who can match his peers without using a debugger while they do, is clearly a superior developer. This should be intuitively obvious.

It's just the catalyzing power of the internet that drives people to the extreme of insisting one should never, ever use a debugger. Or a plane.

Re: Want to write some code? Get away from your computer

#39

"Step Away From the Computer" or "Hammock-driven Development" by Rich Hickey (author of Clojure): http://clojure.blip.tv/file/4457042/

Thank you for this. Can't wait to start reading the book he recommended, http://en.wikipedia.org/wiki/How_to_Solve_It.

Marvin Minsky said in his influential paper Steps Toward Artificial Intelligence that "everyone should know the work of George Pólya on how to solve problems." - Wikipedia

Re: Want to write some code? Get away from your computer

#40

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

[deleted]
Post reply on HN