4 ms·
A programmer’s greatest enemy is getting stuck. Agreed. I often know where I want to go but can't seem to get there with code. This sucks and good programmers
by edw519 15y ago
A programmer’s greatest enemy is getting stuck.
Agreed. I often know where I want to go but can't seem to get there with code. This sucks and good programmers must find a way to get through this.
A crucial skill in programming...is the ability to recognize when they’re stuck,
Yes, and this is the only time I ever measure lines of code. Here is my metric: If I've been sitting at my computer (developing, not testing or anything else) more than one hour and LOC written or changed = 0, then I'm officially stuck, and must move to GettingUnstuck mode.
to get out of being stuck,
The most effective way I've ever found to get unstuck is to get away from the computer. I take pencils, paper, and code listings and get away, always into another room, sometimes to another building.
I have learned that the reason I'm stuck is not because I don't know how to do something; it's because I don't know what to do. What needs to be determined away from the computer; how can be determined at the computer.
and to avoid getting stuck in the first place.
This is the one time I disagree with OP. Getting stuck is not the problem; getting unstuck is. If you're not getting stuck on a regular basis, then you're probably not working on big enough problems.
Never getting stuck makes programming like almost any other vocation. For me, getting stuck and then getting unstuck and making something cool work for the first time ever is one of the best feelings you can have.
- 0x12 15y agoMy trick for getting unstuck is to start maintenance on the part where I'm stuck. Any kind of cleanup, comment clarification and so on will do. Once I'm doing that I'm doing something and moving from doing something to doing what I want to do happens more or less automatic at some point. I got this trick from working in a metal shop. We'd get stuck trying to solve a problem all the time, and whenever that happened we'd simply start cleaning up. Usually after cleaning up the 'way forward' was crystal clear. Now, of course one day there will be a problem where this will not work but for now it seems like a really good trick. The underlying mechanism is as far as I can see related to being stuck in the same cycle in your head. As soon as you start cleaning up you force yourself to look at the forest instead of the individual trees and that's where you'll find the key for moving on. ymmv, it works for me.
- Derbasti 15y agoI once was stuck for seven months. I never quite understood why my employer was OK with that. The solution however was just as you described. I needed to get away from the computer. In that case, I had to get some science/math straight. Once that was sorted, I steamrolled that roadblock in one evening. True story.