Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Overcomming Programmer's Block? 403

goingware asks: "What do you do if your productivity drops to two lines of code a day, and you just sit and stare at the code and feel like you don't know how to do it anymore? On the outside, it would seem my problem is that I've got some difficult architectural issues that I'm wrangling with. I'm not sure what the right way is to approach a certain feature I'm building into my program in C++. But what my real problem is that I just sit and stare at the computer all day long feeling scared and anxious. I'm afraid to try anything out at all for fear of making a mistake. I know I could just back up the code and write any old thing and throw it away if it's wrong, but for some reason knowing that doesn't help." What do you do when you are stuck in code and your focus leaves you? This isn't something as easy as getting up from the problem for a while (although that helps), this is sounds like something closer to burn-out. What can programmers do to combat this?

"I've encountered this before, but it's not normally like me. I've been programming as a career for something like 13 years now and shipped dozens of products. I've had many obstacles before and overcome them through many and various means... means which all escape now.

Right now I feel like a clueless newbie assigned the task of re-architecting a nuclear powerplant control system.

This has really got me down. I have a product to ship. I called my client and asked to take a few days off from coding, and told her I'd be hitting the C++ books and taking a rest and trying to rejuvenate my programming creativity. She was OK with this. So part of that process is posting my question here."

This discussion has been archived. No new comments can be posted.

Overcomming the Programmer's Block?

Comments Filter:
  • by Anonymous Coward
    Head for the nearest BIIIG city, find some kinda of techno/trance club(here u could stay years with out having to think once). And paaarty.. *Grin*
  • by Anonymous Coward on Tuesday August 01, 2000 @02:42AM (#889677)
    Go to the toilet. Some of the best inspirations have come while sat on the crapper, trousers around my ankles. And if nothing comes to you, well, that dump you took was at least *one* productive thing in your day !
  • Well, for one, stop reading slashdot and reloading it every 5 minutes.. ;-P I know, it's addictive, but keep away from it.. ;-P
  • I wish I hadn't already posted, so I could moderate you for all it's worth.

    This personally hit a note with me, becouse I found myself just this morning fearing failure. Thank you for posting this, you actually helped me quite a bit putting it this way. The 3 things you posted where *exactly* what I'd started worrying as my project is about to go into production after being in a *WAY* to long test cycle..

    Anyway, thanks for the post.. ;-P
  • But what if he's blocked up that way too? Imagine the frustration!
    --

  • I like caffeine. For one thing, it does help with the occasional hundred-hour coding session (no, really: I officially logged four back-to-back all-nighters on at least three occasions back in school), which I guess is the kind of hacker bravado that you are against, and in which the rest of use are revelling. Mainly, I think (speaking just for myself, of course), it's just fun to talk like that -- we're not really quite as unhealthy as we claim to be.

    In reality, though, I don't see that caffeine really does that much at all. I remember that for a while back in school I was in the habit of grabbing a can of iced coffee on my way to class in the morning, but it was mainly that I liked the taste, and maybe for the placebo effect of "I've had caffeine, so I must be awake now" -- I didn't really feel noticeably different. I did notice a couple of times, though, that when I forgot to do it, I fell asleep in the middle of the lecture, but then, I also wasn't sleeping enough at the time. I'll grant that my general-well-being level dipped during the period about a year and a half ago when I was up to four Mountain Dews a day, but that was an extreme. Besides, the sugar was probably worse than the caffeine -- you can't just add nearly half a pound of sugar to your daily diet without consequences. I also wouldn't say it's much of an addiction -- I've gone on and off of it without really paying much attention (it just some months is, and some months is not, part of my daily routine), and I haven't missed it much, or generally noticed any difference.

    I agree with you, though, about the need for various mind-clearing activities, and your list looks pretty good. I would add, under "Go fetch a smoothie", "Go get a Mountain Dew" (like this guy [slashdot.org], except he said "Diet Coke". Ugh! Who can stand that stuff?).

    Back to the original question about "Programmer's Block", I have one other suggestion along the same lines as most of the others I've seen: a change of scenery is good, but it doesn't have to be a break from work. Try taking a laptop to a cafe or some such public place and working there for a bit. In the past couple months, I've found myself getting some of my best work done sitting in a coffee shop sipping lattes (Oops, there's that caffeine again) and coding in periods of two to four hours. Or, to remove yourself a bit more from the intricacies of the problem, you could just take a notepad and scribble down some thoughts and pseudo-code instead of staring at the actual code. You might think that the noise and people would be too distracting, but I've found that it's just a very pleasant environment to be in. Plus, you're away from the other distractions (including the Internet, and especially Slashdot) that you have in your office, house, or whatever.

    Depending on the state you're in, changing scenery like this while continuing to work at least partly on the problem, could be better than a complete break. For one thing, the work stays fresh in your mind -- you don't have to flush it and subsequently page it all back in. Also, you're working while in the relaxed state, rather than just getting away for a while and then coming back to the same thing -- Sometimes I've come back to work after a vacation (including my honeymoon, no less), taken one look around, checked my e-mail and bug list, and said, "God, I need a vacation!"


    David Gould

  • I hate to say it, but your response [well, that part of it, anyway] is essentially a well-written (I must say) [thanks] version of, "I don't have a problem with it, it must be okay for everyone!" But the truth is, caffeine, and pretty much ANY drug, doesn't have the same effect on everyone else that it will on you.

    Point taken. If nothing else, it would be related to body size and dosage; I'm fairly big (6', 175 lb.), and I guess four Mountain Dews a day, which I thought of as pretty extreme, is not that much compared to a three-pot-a-day coffee drinker. And of course you're right that different people would be affected differently, so the mere fact that it's not so bad for me doesn't mean that it isn't bad at all. On the other hand, the same argument works conversely: the original comment (magnushuckvale [slashdot.org]'s, not Rimbo [slashdot.org]'s) claimed that caffeine is "evil", but that's only true for some people and not, e.g., me. To be fair, the original comment seemed to be a bit of a "rant mode"-style exaggeration wrapped around a good point about the importance of healthy activities and a balanced lifestyle, so I won't get too hung up on the "evil" thing.

    Also, I just want to say that I had intended for the second half of my comment to be the main point, namely, the suggestion about taking a laptop to a coffee shop to get some work done. I just did so myself -- I left right after posting my previous comment, finished a problem that I've been working on for a few days, and came home to see your reply and write this. That's often a problem with the way I write my comments: I start out by rambling about some side point, and by the time I get around to my real point, people have stopped reading. Just to be nice and recursive, here I am doing it again.


    David Gould
  • by jht ( 5006 ) on Tuesday August 01, 2000 @03:15AM (#889694) Homepage Journal
    I was in just such a situation about 12 years ago - I'd graduated from writing dBASE code to writing 4th Dimension code on Macs, and I was working on a customer program. I ran into the wall, trying to code things I could have done blindfolded in dBASE.

    I studied the system for quite some time trying to get around it, and finally concluded that I'd hit my limitation as a programmer. I just couldn't make the leap to the different programming style that was needed. I resigned the contract, gave a good deal of the money back, and wound up going into networking instead. Since then, I've written only a handful of code - a couple of HyperCard apps when that first came out for fun, and a few shell scripts and Perl hacks to automate stuff. And one more "for pay" coding job - a script app written in the old Mac White Knight comm language to automate file transters for a doctor I knew. That's it.

    Needless to say, I hope that most people do not follow my example! I lucked out and was able to pick up another skill (that I turned out to be better at), when I ran into my programming limits.

    Because even then I wasn't a very good coder...

    - -Josh Turiel
  • by LizardKing ( 5245 ) on Tuesday August 01, 2000 @02:40AM (#889697)
    One thing I've noticed is that simply working longer hours doesn't normally make me more productive. There seems to be a two or three hour surge of activity, after which I have to take a break - read some newsgroups, go for a walk, whatever. In these situations the "leave it and come back to it" approach really works.

    If the problem still looks bad when I get back to it, then the next thing I do is ask a colleague for advice. In situations where there isn't another programmer around, I simply describe the problem to any willing listener. Often the simple act of talking about a problem elucidates the solution. Now this is going to sound silly, but I've even talked to my cat when working at home and sometimes had that "eureka" moment.

    If the task is simply beyond your ability, then it's time to admit it - approach your manager and say so. Grit your teeth and accept that no proprammer can do everything. Just hope that your boss understands that. If you lied about your abilities to get the job, then I've no sympathy for you (having fixed cock-ups by such people). Otherwise, if your boss is able to do his job properly, then he should be able to see this is a resource issue - not a general failing in yourself.

    I've actually quit a job because I felt the task I got given was beyond my abilities - finding some comfort in the fact that programmers are a scarce resource. While it is a drastic course of action, I felt almost europhic knowing the stress was over. So if it's not just burn-out consider getting out of the job.

    Chris
  • by Rob Kaper ( 5960 ) on Tuesday August 01, 2000 @02:48AM (#889702) Homepage
    Work on something personal. I know many bosses and companies won't let you, not even on your own time, but if you are allowed to code on your own time, do this:

    • Write a module you'll be using in a home project as well. You'll be very motivated and will make it perfect.
    • Write it in a generic way, with plenty of configurability. Basically generic enough so that you can implement it at work.
    • Implement it at work.

    This is not exactly how I do things at my work, but there have been ocassion where I have introduced code of my own into the knowledge base of work. (don't worry, I have a clause in my contract which states the company and I will share intellectual property so I won't lose a damn thing)

  • Dear Mr. Coward,

    It is no secret that the vast majority of the /. audience is athiest, non-religious or religiously hostile. I, as someone that dosen't fit that profile, realize I am certainly in the minority. That dosen't bother me, but the flippant attitude that your remarks embraced does spark my desire to respond. You have made many assumptions in your response, the largest of which is the view that no desination of a spiritual nature can be arrived at by logical thought and a search for truth. You continue by not just implying, but boldly stating your opinion that prayer is only for those with a limited imagination. In response, I will give no argument of my own, but a quote from someone you may have heard about.

    Isaac Newton: Newton often said his interest in theology surpassed his interest in science. Newton did end his Principles with:

    "This most beautiful system of sun, planets, and comets, could only proceed from the counsel and dominion of an intelligent and powerful Being...This Being governs all things, not as the soul of the world, but as Lord over all; and on account of his dominion he is wont to be called Lord God."

    This is from Christianity and the Birth of Science [ldolphin.org]. There is much more on that page if you care to take the time to read it. I do hope that you haven't closed your mind and heart to truth, it is not easy to get it opened again.

  • I'm exactly the same. I have about... I dunno.. 5 or so programs actually being coded, and several more in the pre-development/thinking-about-it stage. I just switch between them when I feel like it. Yes, there is a certain amount of work to be done on catching up with where I was before, but as you say, it a great way to find bugs. Works for me very well. Glad to know I'm not the only one who works like this. The only problem I have is trying to get to sleep when my brain is working on 5 different problems simultaneously ;)
  • In one place I worked at, we had a standing rule - if you were bogged down, it was better to just pack up and go home for the day. Get out, get some R&R and get back tomorrow to resolve the issue.

    totally. I once had a full hour commute on a rural freeway each way, which was great - I could completely forget about work on the drive home, and start transitioning into code-think while driving in the next day. When I got stuck, I would go home - it made for a 6 to 7 hour day, but I was out-coding the folks who put in 10 hour days.

    I only met one guy who was PERFECTLY productive. He worked exactly 8 hours a day, and stopped to smoke two Marlboro light 100's every two hours. At any given moment, he was working as fast as my peak speed.

  • I don't know if this applies to your problem, but I slow down as a problem becomes more complex. This is a big hint that documentation has insufficient detail - so I go back to documenting what I should be doing. This soon leads to checking parts of code against documentation, correcting errors and getting a better overview of the problem. That gives me a new map to follow and I'm off again...

    As far as burn-out goes, I enjoy programming and often do it in my spare time as well as at work. But when work becomes heavy I back off programming at home and do other things (apart from getting married, building electronics or doing DIY are fun... :-).

    If I'm not stressed, but still feel bored with programming that's normally a sign that I need to learn a new language or technique....

    Glad to hear things picked up,
    Andrew

  • by hatless ( 8275 ) on Tuesday August 01, 2000 @02:50AM (#889715)
    Doesn't anyone make flowcharts or other software and data diagrams before they launch their text editor? Assuming you're writing new code and not debugging, why are you staring at the screen? Coding anything vaguely complex off the top of your head is Not Good.

    Stop thinking in C++. Start with the big picture. Map out the problem. Then drill down to the architecture. Then drill down to the core functions of each module. Then firm up your data/object models. Next, drill down to the detailed design. Most of this should be boxes, arrows and lines, not code.

    Then, and only then, start doing serious real coding. If you wing it, you're liable to get stuck or produce something pretty unwieldy.
  • There are a lot of people who think MBTI and similar things are on the same level as astrology. What does the personality test portend for the future?
    Personality types are determined based on people's very real preferred modes of operation. Those unfamiliar with MBTI often resist being "labeled", assuming that these simple types box them in to unrealistically limited behavior. But MBTI is not meant to assert what you can't do, but rather what you tend to do most of the time.

    MBTI [geocities.com] is a tool for gaining insight into how people work, and I think it serves its purpose well. Even though most people aren't pure, prototypical specimens of any single type, I find the accuracy of MBTI representations to be remarkably on-target. Like many of my fellow Slashdot readers, I am an INTP. This typological framework has helped me to better understand and deal with personal differences.

    The best book I know of on this topic is _Personality Type: An Owner's Manual_ by Lenore Thompson. I heartily recommend it to anyone who is curious about personality type theory. Whether this knowledge can help one get past programmer's block, I don't know. But it's a surprisingly interesting subject that is worth checking out, IMHO.

  • by MAXOMENOS ( 9802 ) <mike&mikesmithfororegon,com> on Tuesday August 01, 2000 @09:20AM (#889720) Homepage

    I find it helps to stop and pray, even if just for a minute. I lean back in my chair, put my feet up on my desk and ask God for inspiration. It's helped me out of blocks many times.

    In my case, I find that a lesser banishing ritual of the pentagram helps.

    Mutatis mutandis for your own faith.

    The Tyrrany Begins.... [fearbush.com]

  • by tuffy ( 10202 ) on Tuesday August 01, 2000 @03:56AM (#889722) Homepage Journal
    Being hooked up to the net at work, there's always the temptation to fire up the old web browser and check the latest goings-on when things are getting a little dull and slow. There's plenty of neat stuff online, but it's an awful distraction when trying to Get Stuff Done.

    So, when I built my box for home, I had them install a nice ethernet card for my little LAN, but I kept the modem out. And the difference is pretty amazing. Just dis-engaging my mind from the computer, going outside and thinking about problems without the computer staring back at me is quite refreshing and helps my creativity immensely. The computer is just a tool, after all, and sometimes one needs to put aside the tools to get a better look at the problem.

  • State of mind is your god

    If you can jump in that mental zone of pure abstract creativity, then your battle is won.

    The c0der cocktail: (use at your own risk)
    -------------------------------------------
    Once Daily:
    *5-HTP - 100mg
    *Vitamin/Mineral supplement

    With a meal: (3 times daily)
    *DHEA - 25mg
    *Ginko Biloba - 80mg - 24%GF

    *One of:
    - Ephedrine - 20mg
    - Adderall/Ritalin - 1 dose
    - Ginseng - 2 doses

    General Tips:
    -------------
    - Drink plenty of fluids.
    - Drink caffinated soda, DIET so your teeth dont rot
    - Eat often, smaller meals, snacks. Coding drains the brain
    - Get some tunes!

    your mileage may vary...
  • Actually, this sort of thing has done a lot for my understanding of the world. Like the original poster, I'm an INTP, and I have an ENFP boss. Understanding the underlying characteristics of both lets me work better with him because I understand many things about him most people don't.

    Incidentally, Bill Clinton is an ENFP too. Check out what the test says about an ENFP and it gives you some interesting insights as to why Bill is what he is.

    D

    ----
  • Maybe the same thing applies that Piers Anthony said about writer's block: "If you have it, you're not being professional enough".

    And the quality of his work reflects this philosophy. Stories written with what amounts to stream of consciousness (but lacking even that artistic quality), places where he writes himeself into a corner, and rather than go back and make the appropriate changes to the storyline, add some foreshadowing, etc., he plows ahead, writing a sentance of the form "fortunately, W had prepared for this weeks earlier by doing X, so now he did Y and escaped!"

    The worst writing, bar none, I have ever seen in any genre (and in any universe).
  • by arivanov ( 12034 ) on Tuesday August 01, 2000 @03:25AM (#889730) Homepage
    I got married Saturday, BTW (July 22), to Bonita Hatcher so I got to spend a little time with my bride before I come back to slashdot!

    That is what you do to overcome a programmer's block. get a life.

  • I simply take a break from it.

    A couple of weeks ago I was working on some perl and hit that block. I was really stuck/burnt out. So I simply went and did something else; built a couple of servers and configured them. Gave me a chance to do something else, and think (Building servers is not a real brain intense thing to me). After a couple of days, I felt alot better, and got back to programming.

  • ...become project managers!

    --
  • "In other words, programming is only "part of you" it's not all of you. It's not your reason for living, and it's not even your best part, most likely"

    HERETIC!

    Someone bring out the...
    COMFY CHAIR!
  • Amen to that.

    I'm shocked at how many geeks are complete couch potatoes. Take care of the body and you're taking care of the mind.

    Meditation/Prayer/spiritual something is also good. I know it's a taboo topic in some geek circles but human are complex creatures with emotional, spiritual, mental, and physical attributes and you need to tend to all of them. Complete void of anything spiritual seems to be another popular geek trait.

  • I am currently working on design for a multiplatform B2B 3D collaboration system and feel the block setting in frequently. Once a friend showed me God's desire to have a relationship with me on a day to day minute to minute basis. I was more likely to ask Him for help and peace, and boy does it come. God has since shown me over and over again He does care [gospelcom.net] and is listening. BTW you can pray when you are getting exercise or drinking a beer too :-) It's free like freedom as well.
  • I feel refreshed when I get back to my desk!

    Ugh. I'm a pretty heavy smoker, and I hate having to go out for a cigarette every hour. I love having a cigarette after dinner or sex, but I hate the manditory mid-afternoon cigarette breaks. That and my stamina now sucks so I can't really excersise a whole lot, which I think would make me feel a whole lot better. Or maybe I'm just talking out of my ass - it's 10:30 AM and I've been up all night smoking pot and programming.
    --
  • If that's all they want, make them take out the part of the contract that syas they own all works that you produce. You might want to have an employment lawyer look over the contract, and if you care enough you could have them draft a copy that included the NDA parts but properly removed references to IP ownership.

    At my company, I questioned a document like that (only worse in many respects - the document claimed to own IP you produced for a year after you left!). I sent a number of questions through my manager to the legal department, saying I'd sign when the questions were answered to my satisfaction - I've not had to sign anything yet, and am beginning to think they'll never answer my questions. At least I haven't had to sign anything I don't agree with.

  • Doing something totally unrelated helps. Sorta lets your mind work in the background and relax in the foreground. Take a 30 minute break and enjoy outside; get yourself a cup of coffee 15 blocks away. Its like tip-of-the-tongue effect.. the answer is always in sight.. sometimes you have to let it come to you.

    Its amazing how much thinking you can get done while you aren't thinking.

    ---
  • I find it helps to stop and scream a steady stream of profanity (with a little obscenity and some blasphemy thrown in for good measure) for a solid five or ten minutes. I stand up from my chair, put my fist through a wall, and curse the computer, the bastards who made the dev tools and the environment I have to code for, and the people who want the program written. It's helped me out of blocks many times.

    Of course, I'll also resort to prayer when nothing else helps. I keep a herd of goats in the back yard for just that purpose, and a sacrificial knife sitting between my keyboard and my monitor.

    ---
    Despite rumors to the contrary, I am not a turnip.
  • 1) Any thinking scientist, who is religious, must spend some effort to understand and synthesize their religious beliefs with their scientific beliefs.

    Hmm... all people think (including scientists), some scientists certainly seem to refuse to examine their religious beliefs, therefor, this is nonsense. Either that or a tautology redefining the word "thinking" to no useful end.

    2) Atheism is the dominant belief in the scientific (geek) community.

    I'll go along for the point of argument, but I think there are more agnostics and people with wierd personal religions than true atheists, unless you consider all people to be atheists who don't follow an organized religion.

    3) So by your logic there are more religious people on slashdot then are listed here.

    I wasn't aware that religious people on slashdot were "listed", and I'm not following anyway.

    If you're saying that Christians are oppressed on slashdot and in the scientific community in general, therefor there are many of them in hiding, you're full of it. Note that the top-level post "Pray" got modded up to 5. Anyone who has strong views on anything and posts them gets flamed, that doesn't deter any group from posting.

    ---
    Despite rumors to the contrary, I am not a turnip.
  • Now, I ask you, is God's case any worse? Have you read his book?

    God's case? For his own existence? I'll be laughing at that one for weeks. If just came to me and told be to believe in him, I would. It would be an awfully easy thing for him to prove.

    I've read the Bible, it's a fairly random collection of history, practical advice, and silly myths. There's plenty of good stuff (like any mythological collection, it provides powerful metaphors), but even more crap. Amazingly, for every point there seems to be a contradictory point. I guess this was done intentionally, so the literate priests who study the whole Bible could find a passage and point it out to a barely literate person to support or justify any action.

    If there was a God who loved us and wanted us to worship him, he wouldn't hide from us so carefully.

    There are many thousands of such questions, so you might be able to pick a handful and bluff your way around them,

    This is classic sophistry: have a thousand claims ready, don't make any effort to prove them or support them in any way, just make sure you have enough that your opponent can't disprove them all beyond a reasonable doubt. If he makes a good argument about one, just move on to the next. The technical term for it is a "shit barrage".

    Any idiot can keep spouting nonsensical claims until the wisest man in the world just leaves in frustration. Any reasonably bright huckster can make up a continual stream of fairly plausible claims on spot, so ignorant observers go away believing him when his opponents leave in disgust.

    Look at you! You threw out some completely random, unexplained, unsupported claims as if you expect me to feel a need to disprove them. Then, without even waiting for an answer, you reveal your intent to avoid arguing the points you brought up, but to abandon them when they are challenged and bring up new unsupported claims from your bottomless pile of bullshit. Here's a hint, pal: in science and rational debate, disbelief is the default, and any claim is considered false without supporting evidence. Your "thousands of such questions" wouldn't look so good if you realized that you are the one responsible for bringing proof to the table, since you introduced them. Scientific claims are few and cautious for a reason: it's a lot of work to prove things (they're also vast and sweeping for efficiency's sake).

    Example:
    Religious Nut: If you slam your head against the wall a million times, you'll become immortal.
    Rational Man: That's nonsense.
    Religious Nut: Do you have any evidence?
    Rational Man: Well, I know that smashing your head against the wall isn't good for you.
    Religious Nut: Ah hah! So you admit you've never actually tried smashing your head against the wall
    Rational Man: Actually, there's a well document case of a man in an insane asylum who smashed his head against the wall over a million times. He died around one million one hundred-thousand.
    Religious Nut: Well, that one's not important. I'm right, but you're obviously too blind to see. Anyway, stuffing both fists up your own ass lets you talk to God.
    Rational Man: That's the most stupid thing I've ever heard.
    Religious Nut: Let's be scientific, have you tried it?
    Rational Man: Of course I've never tried it. I've never heard of anyone doing something so incredibly stupid and painful.
    Religious Nut: See, you have no proof! It must be true.
    Rational Man: I guess you haven't tried it either, there's no room for either hand to fit with your head up there.

    The creationists have always been arguing like the Religious Nut. They are shown to be wrong over and over again, only to bring out wilder and more ridiculous claims, until everyone who argues with them recognizes the obvious: it's much, much easier to make wild and ridiculous claims than to disprove them.

    Ever hear the saying "Don't try to teach a pig to sing. It wastes your time and annoys the pig."? Well, I've certainly wasted my time, are you annoyed?

    ---
    Despite rumors to the contrary, I am not a turnip.
  • by TheDullBlade ( 28998 ) on Tuesday August 01, 2000 @01:16PM (#889770)
    Given the way scientists were treated in those days when they tried to suggest that they knew things that officials of the church didn't, don't you think that terminating your essays with "Of course, I believe in God, and this is all God's work. Actually, this proves that God exists. Isn't God great?" could be motivated by self-preservation rather than severe belief?

    When atheism is oppressed (as it has been through most of history, and still is in much of the world), practical atheists give lip-service to religion. When speaking other words, or even remaining silent, would likely be punished, one's words are no evidence of anything at all.

    BTW, Newton was a remarkably ruthless and pragmatic person who is known, as a matter of historical record, to have told lies often, and about many things, for his own benefit.

    ---
    Despite rumors to the contrary, I am not a turnip.
  • Here's what I do:

    1. Turn on some really loud, energetic music (I find trance/techno works wonders). Just make sure it's all instrumental; words will destroy your concentration. And yes, headphones are best unless you have 1200-watt speakers and an amp to match and no roommates and you live in a house in the Australian outback.
    2. Get really stoned. (See below.)
    3. Close your eyes, put your head in your hands, and stare into the blackness while your ears are assaulted by Orbital or whatever music you put on (but because there're no words, it isn't distracting).
    4. Starting from about 30,000 feet above the problem, just kinda 'think' down at it and slowly settle down upon it. This lets you see it from all approaches and angles. Feel free to glance at your monitor now and then if you need to.
    5. Get more and more specific in your approaches. Try them all and use whatever one solves the problem best. Don't "try" to solve the problem; just go on instinct and let the solution come TO you from wherever it is solutions gather.
    6. Rejoice.

    Codeine, methamphetamines, oxygen deprivation, etc can be substituted in step 2 if you have hangups about things that are illegal but shouldn't be. I've found alcohol numbs you a little too much, but it can also be effective in small amounts. The point is that in order to solve a problem you can't rationally solve while perfectly sober, you have to numb that part of your brain that does all the "logical" thinking. A problem that escapes your every attempt to solve it logically requires turning off the "left brain" analyzer so the "right brain" (instinctive) heuristic tools can be heard above the din the left brain creates by being so loud and sure of itself. Perhaps that's why we have two brain halves... one to solve problems, and another to solve the problems the first half can't solve because it's not trying to create a solution to it, it's just letting solutions come to it and filtering out the best one. I know it makes little sense, but how better to find a solution to a problem that doesn't make sense than to try solutions that don't make sense?


    "The best weapon of a dictatorship is secrecy, but the best weapon of a democracy should be the weapon of openness."
  • =:-) Seriously though, that happens to me too, and the best thing is to get a rest. What would be really nice is if i could get a job working on videogames rather than business software, i think that would make a bigger difference though. I learned to program so i could write games. I tinkered with that all through school (elementary-high school), then i had to go and get a job, and so now i write business software, and i'm to burned out at the end of a week to even consider firing up an editor and coding something for myself =:-(
  • by mav[LAG] ( 31387 ) on Tuesday August 01, 2000 @02:55AM (#889778)
    I have this problem *all* the time. What works for me - apart from relaxing non-coding activities - is to take Sedgewick (or any classic text) and write one of the algorithms in there. Doesn't matter what it is: QuickSort, stack-based level order traversal of a binary tree, FFT - whatever. Pick a small one (so that it can be in one source file), read the chapter and then write it yourself. If you get stuck, you can always refer back to the text to see what's wrong.

    I find this method helps a lot: you can produce a small elegant system which works. It's like "wow - this is really elegant and I coded it." It seems to switch your programming circuits on but leaves the blockers off. The result is you realise you *can* program after all and you'll have probably learned something in the process - maybe a deeper understanding of the algorithm or a faster way to do things. The brain is pretty good at self-organising which means any knowledge you gain doing this could well help you with a stumbling block elsewhere i.e. you're not wasting time on a trivial exercise...

  • One thing I've noticed is that simply working longer hours doesn't normally make me more productive.

    I find this is absolutely true for me except with one exception. When the code is flowing freely, I can work productively 18-24 hours at a stretch (not bad for a guy who by hacker standards is pretty old; when I was a kid hacking on PDP-8s it used to be even longer).

    Other times I look at the screen and all I can think of is something else. Then I limit my work time to reasonable hours, get plenty of sleep, force myself not to obsess on the problem, read a good book, or get some exercise, spend time with friends.

    The brain is a biological organ which has its own rules and can't really be hacked to operate in a linear fashion. You can't churn out code like a butcher makes sasuages -- i.e. given twice the time twice the result. I think one of the rules the brain obeys is balance; the brain refuses to put more than a certain amount of resources into any one activity, and will withhold resources, perhaps even the critical resources needed to solve the problem. In my personal experience, many thorny programming problems can't be solved by thinking harder so much as thinking smarter. When the brain refuses to give up the critical problem solving resource, you can trick it by trying as hard as you can to think about anything else but the problem at hand for a while.

    Hackers are distinguished by their ability to devote more mental resources to a problem, but even they are human after all.

    And really, when you have those days when code just pours out of you, you are accomplishing things that only a rather small minority of the human race can. It justifies a few days or even weeks of time that appear outwardly slack.

  • I called my client and asked to take a few days off from coding[...]

    First and foremost SLEEP! If you can log 12h sleep a day, that's great. You're probably severly overdrawn on your 'sleep bank account' due to OT, stress etc...
    One you're 'back in the black', try to avoid late night parties during your off time, do some daytime stuff instead , and bask (safely, w/sunblock) in the Sun. The sunlight should fixup your vitamin A, serotonin(sp?) level and resync your biological clock.
    ---

  • by macpeep ( 36699 ) on Tuesday August 01, 2000 @02:38AM (#889794)
    I just came back to Finland from something of a nightmarish project in Singapore. Me and a fellow coder wrote almost 1MB of code in a month (and even documented a large part of it in the same time). I spent some 330 hours coding during that month and quite often I would hit this very problem for whatever reasons, stress, fear, anxiety, lack of sleep. Since we were under a very tight deadline, I had to figure out a way to get around it and I actually came across something that worked for me. Hopefully someone else will find this useful.

    Finding myself unable to code, I started writing the code in english on paper. I would sit down in a corner of the room and start writing in english. "check the user permissions. if the guy is an admin, show this and that screen. for each line in the screen, make sure it's bla bla." and so on. Once I was done and saw that I had something that could work, I took the text, pasted it into the existing source code and started translating it to code (Java in this case). Maybe it won't work for everyone, but it did wonders for me and I was able to overcome my block several times this way.

  • by coyote-san ( 38515 ) on Tuesday August 01, 2000 @06:41AM (#889803)
    I never use flowcharts.

    At the implementation level, object-oriented code and flowcharts don't mix well. Most of us find little value in hundreds of flowcharts consisting of (start)->(call super)->(one line of additional code)->(return). Something like Z notation (to describe the object and the various operations on it), on the other hand....

    At the detailed design level, almost all problems break down into one of 500-1000 lower-level patterns. E.g., "this is how you recursively descend a directory tree." While you could use flowcharts, I (and many others) find it better to use canonical "null" examples. The work breaks down to verifying the common stuff is the same and our extensions do what we want. (See also earlier OO comment.)

    At the design level, "patterns" work best. At that level the focus isn't on *how* the code is put together, it's on *what* each block of code is supposed to do.

    So what's left? Flowcharts at the architectural level? I don't think so. (This level should have DTDs, though!)
  • you have far better distractions than shooting shit with guns...

    Seriously, there are some nice, somewhat legal ways of dealing with stress in the netherlands... from the redlight district to the cofee bars...

    damnit, i'm jealous...


    tagline

  • Been there tons of times. What usually works for me is getting lots of sleep, drink lots of caffiene and do a little "research". the first to will get your mind into a state where you can focus better and the research can help you see the possibilities. Newsgroups are good for this. Lots of examples to peruse while you are thinking. Getting started is the toughest part when you are stuck, so just start trying things and a solution will usually come to you.

    Coder's block seems the biggest problem for me when I don't have confidence with what I'm doing. Recently a large Intranet project I am working on did a 180 degree turn when I was asked to reimplement my work in VBA/ASP instead of PHP. I hit a wall. I felt like I was being asked to "dumb down" my application and implement it in a buggy language. What finally got me going was what I mentioned above. It's really a lot like running. Sometimes you have to push through the low points to keep going.

  • Take a long vacation! Its a great way to get things together. Two weeks very far away from work gives you lots of insight.

    I recomend Queensland [queensland...ays.com.au]
  • Speaking for myself I can't get any programming done and my wedding is till 10 months away. It's not as though I am burned out though.

    When I come home from work (I do minimal coding at work), I'm tired. I spend half an hour changing/relaxing and then I eat supper. By then my fiance is over, and she doesn't want to sit there while I program. So my problem is that there is not enough time in a day.

    Oh well, what can you do? I mean other than disrupt the space-time continum with a giant "laser."

    Devil Ducky
  • by Devil Ducky ( 48672 ) <slashdot@devilducky.org> on Tuesday August 01, 2000 @04:40AM (#889813) Homepage
    Hobbies away from a computer? Blasphemy!

    Seriously you dont have to get away from computers just away from programming in all of it's forms. You can surf the 'net, read /., laugh at some AOLers. All of these things are done on a computer but should not remind you of programming (unless you start editing the slashcode for some reason).

    As for your second suggestion, why not boast? Coders just get made fun of in the "real" world. Why not let someone know exactaly how important what you are doing is.

    And if you find some girl who will actually listen to you while you are boasting: Marry her. I'm not kidding about that.

    Devil Ducky
  • You just discovered use-cases :) As much as I hate to write/document requirements, they make the design much more solid.

    -tim

  • Check out Beck's Extreme Programming [fatbrain.com]. In it, he describes a highly interative approach to design and coding. I, too, have experienced coding blocks and my approach is to go ahead with whatever design I have and code what I can. After it's coded, I can easily see what I should change. I usually cannot see that until I've written something. You will throw away code, maybe even a lot of it, but you're first "released" version will be about your third internal version which makes for a much more solid release.

    Also, I'm NOT suggesting you ignore design. Design what you can - leave those fuzzy areas out for now. They will be much less fuzzy when you start writing the code around them.

    YMMV,
    -tim
  • I sometimes get terrible programmer's block. I think I'm susceptible because I'm an over-picky perfectionist, and if something is not done correctly in my mind, I will wrestle constantly with it. If any big projects come my way I usually spend a good amount of time hypothesizing and drawing diagrams and coming up with the optimal architecture and design, avoiding implementation. It usually takes me a while to be confident with the design in my head and get up enough nerve to just dive in, and that can only happen after about two cups of coffee. Six hours later I will be out of breath and probably have something done, but I won't want to touch it for a while. I usually end up writing anything major several times over until it is either "just right" or I am so sick and tired of it I archive it somewhere and hope nobody wants it done.

    Like the author says, I *do* find reading about good, correct, elegant design and implementation inspiring. I can tear through manuals/tutorials...but to get my hands on the keys to do real work on a big project I first have to overcome the fear of "not doing it right" the first time or "messing something up".

    Then again maybe this is just a strange neurosis of mine.
  • I've never had a real programming job, so I don't know if this idea would work in such a situation...

    Didn't Thompson say, "When in doubt, use brute force"? Whenever I have had programmer's block, it's always been because I was far too worried about making the code fast, or extensible, or portable, or perfect. By copmparison, writing a bubble sort algorithm is almost like meditation... it can be very therapeutic.

    Once, I was so sick of a C++ project that I just rewrote the whole thing from scratch in Tcl. It was fun, and the it cleared my mind enough to allow me to get back to the real code.

    Of course, another advantage of this method is that you actually end up with working code. You may even find that your brute force algorithm is good enough to keep after all.
  • Been there, done that, often.

    Often an algroithm needs to buzz around my brain for a while before coding it. If I sit around and DO NOT CODE for a couple of weeks, drawing flowcharts, data diagrams, doodles, reading books of algorithms and suchlike, then usually I reach a point where the whole program just suddenly spews out complete and right.

    On the other hand, if I force myself to code, I get stressed, take much longer, and end up with something that needs rewriting.

    I guess its a variety of Eureka phenomena.

    Of course, some pointy hairded bosses may object.
  • by theonetruekeebler ( 60888 ) on Tuesday August 01, 2000 @04:41AM (#889827) Homepage Journal
    I recently reread Robert Pirsig's Zen and the Art of Motorcycle Maintenance [amazon.com] and came across a passage that got me out of a period or coder's--and writer's--block:
    Stuckness shouldn't be avoided. It's the psychic predecessor of all real understanding. An egoless acceptance of stuckness is a key to an understanding of all Quality, in mechanical work as in other endeavors.
    The whole passage was about finding yourself in a place where you aren't producing visible results for your mental efforts. I can't remember how many times I've agonized for days or weeks over a hairy code module thinking I would have to rewrite the whole thing from scratch, then just walking in one morning and making two or three small, seemingly unrelated changes, which would not only fix the thing, but would make it run right.

    So I think you did the right thing by riding it out, reviewing fundamentals, letting the solution present itself to you of its own accord.

    If you think of writer's block as a boulder in your path, you can extend the metaphor to how you go about destroying it: You can either flail away at it with a sledgehammer, expending enormous energy to make slow, painful progress; or you can study the rock, learn it, find the cracks, insert the chisel and destroy it with two or three taps. It is rather Zen. When you are not actively typing away at a problem, you are gaining awareness of its true nature.

    So use your time of stuckness to do good things, and if you work where your manager says things like "I didn't hire you to think, I hired you to work", buy him a copy of Demarco and Lister's Peopleware [amazon.com] and tell him to go away and come back when he's read it.

    Note: The above links to Amazon.com do not imply endorsement of them. Support your community's independent bookstores: read Amazon's reviews of these books, then purchase them locally.

    --

  • I would [] start writing in english. Once I was done [] I took the text, pasted it into the existing source code and started translating it to code.

    I've met programmers who do this as a general technique for coding. It works for code generation but can be hard to debug.

    The solution is to add a simple step. After you write it in English, paste it in TWICE. Then turn the first pasteup into comments and convert the second.

    Shazam! DOCUMENTED code!

    And if you ever have to make a mod to that part, and you start suffering from coder's block, start switching your attention between the comments and the code.

    Most of the solutions to blocking that I know of fall into two variations of one category: Stop concentrating on the subject, for a short or a long time. (Get rest. Do something unrelated. Do something related but different. Radically change your schedule.) This thread leads to more variants of the theme:

    - Write in English and convert. (Change an element of your coding style.)

    - Swtich focus between comments and code. (Do something related but different.) Leads to:

    - Compare the code to the comments, analyze aspects of the differences and/or check for bugs. (Again, do something related but different.)
  • if the obvious cures (hikes, bikes, movies, sleep) don't do it, pick some other programming task - the one-day kind. Focus on it. Start it. Complete it. Hey - even document it.

    There's nothing like a completed project to motivate you on the next one.....
  • If riding in an airplane is called flying, then riding in a boat is called swimming...

    If you really want to fly, get out of the plane... I highly recommend taking along a parachute. Incredible view, incredible mental focus, nice rush.

    For another great hobby, I recommend solo autocross racing. It's pretty cheap, assuming you already have a fairly sporty car. It's a great way to meet cool people who may or may not be into computers.

    Speaking of that, I saw a woman at an autocross Saturday who had the words " Well behaved women never make history " on the back of her roll bar. In four weekends of autocross, I've met several cool people and have become a much better driver. I think having a secondary focus makes me a better programmer / software designer.
  • The reserve chute is spring loaded, and MORE reliable than the main chute.

    The real statistics are 1 in 187,000. It's statistically safer than most freeways.

    If you can't accept THOSE odds, then don't skydive. But it's a lot of fun.
  • by mkafka ( 66546 ) on Tuesday August 01, 2000 @02:36AM (#889834)
    The Slashdot crew isn't the mostly likely group to go hit the weights, but for me physical exercise really helps keep my mental side running smoothly.

    Endorphines and what not, I guess... Plus it helps get your body tired so you can get longer, more restful periods of sleep. They've done lots of research showing heavy exercise can overcome some mental problems like ADD, and that is the same mindset I end up in when I feel blocked...

    Best of luck.
  • I know exactly how you feel. The last few summer jobs I've had have been not my cup of tea -- great money for a college student with bills to pay (rent in Berkeley! argh!), but living in or commuting to Silicon Valley for some of them was so not fun. And colleagues can be focused to the point of obsession. And maybe I don't WANT to be immersed in technical specs for eight to ten hours a day. Maybe I'd prefer talking with and writing for people and not engineers.

    Part of the solution can be changing habits -- this is for long-term fatigue, not just temporary 'block.' If you aren't enjoying yourself, AT ALL, maybe you should try coming in at different hours (a lot of workplaces allow flextime now because they want to keep their laborers and keep them happy); morning-afternoon or afternoon-evening or morning-evening! Eat small meals, spaced out in the day -- or eat a few big meals, for 45-minute breaks. Instead of putting off the work you hate, try doing it for 15 minutes, then rewarding yourself with a trip to sluggy.com or something. (Or posting on Slashdot...)

    But when it comes down to it, if you find yourself dreading work EVERY DAY, don't do what I did -- just try to get through your prison sentence until fall comes and you can go back to school. This is a hot economy. You can quit (most contracts I see say 'you can quit at any time with or without a reason and/or notice) and temp for a while. Find something you LIKE, at least, and if possible, LOVE. You only live once.

    Gotta go -- boss here...

  • by wowbagger ( 69688 ) on Tuesday August 01, 2000 @03:08AM (#889839) Homepage Journal
    I too have been programming professionally for over a decade (in C++), and here's what I've learned:

    Don't be afraid to fail.

    Sometimes, the problem definition is too vague, or there are too many unknowns in the mix. You have to follow the scientific method, and the first step of the scientific method is gather data.

    You have a module that you cannot figure out how to do? cvs commit, then say to yourself, "Self, we're going to write something to see what is what. When we are done, we will delete what we have written, and using what we've learned, write it properly". You'll be amazed at how much clearer the hidden requirements become when you start bashing code against them.

    Now, as to the C++ issue: I don't know if part of the problem is your level of skill in C++, or if that is just a red herring. If you really aren't comfortable using OOD, then for Torvalds' sake DON'T! Just write the code proceedurally. Again, I've often found that once I've written a code block, I can then better see where the objects are within the code. Then, I re-write the code to be OO.

    In my experience, no object is reusable from the beginning, no matter how much work you put into it, no matter how long you worked on the design. Only after the third time a class has been used have you come close enough to defining what functions need to be virtual, what members non-private, what args need to be passed to the constructor, etc., to make the class really reusable. Accept it and move on.

    Like I said, don't be afraid to fail. It's the only way you will succeed.
  • I find I do my most creative work in the times when my mind is not directly focused on the problem at hand - my best ideas (and the solutions to problems that have me blocked) seem to come when I'm in a quiet, somewhat disassociated, state - like taking a long hike in the hills, (or in town), or on the train, taking a long cross country drive, or one of the best - taking a long shower.

    I suspect it has something to do with a combination of physical relaxation, quietness and lack of distractions (no radios/web/irc/etc)

  • This is a symptom of caffeine addiction. Inability to concentrate, anxiety, etc.. Also, cut down of sugar. Sugar affects your brain, making it harder to concentrate on mathematical types of problems (like programming). Stop drinking soda and start drinking water.
  • by grantdh ( 72401 ) on Tuesday August 01, 2000 @04:24AM (#889849) Homepage Journal
    What do you do when you are stuck in code and your focus leaves you?

    Bail out - become a manager - it's worked for so many others - how can it be wrong? :)

    But seriously:

    In one place I worked at, we had a standing rule - if you were bogged down, it was better to just pack up and go home for the day. Get out, get some R&R and get back tomorrow to resolve the issue.

    This came about mostly 'cos I had a couple of occasions where, after pounding at a problem until late at night, I'd give up and go home. I'd be half way home when I'd realise what I'd done wrong and, turning around, would race back to plow through the issue.

    So, it was not uncommon to hear a defiant "SCREW THIS AND THE HORSE THAT CRAPPED IT!" from the development area followed shortly after by a resolute programmer storming out of the office. Usually within an hour the person would be back with a solution.

    Worked almost every time...

  • There is also an Extreme Programming web site [armaties.com]. You might also want to visit The Programmers' Stone [reciprocality.org]. It offers some interesting insights into how programmers think. It might change your view of what is happening inside your head when you get programmer's block.
  • I apologize for not having been able to join into the discussion today but I'm afraid my new bride pointed out that all I'd done was work since we got married a week ago Saturday and we weren't going to get to take a honeymoon anytime soon and so we spent a bit of quality time together.

    I don't think she would have understood if I told her I'd been featured on Slashdot and had to take breaks from her to go post...

    I did read through some of the comments here earlier this evening and I must say that this has been an excellent discussion. The sheer number of comments posted shows I must have struck a chord with the community - and my experience with other programmers shows that this is a common problem with others.

    I'll post tomorrow what the folks on comp.lang.c++ [comp.lang.c] and comp.sys.mac.programmer.misc [programmer.misc] had to say but they were in general along the same lines as what was posted here:

    • Take a break
    • Get a life
    • Do something fun that doesn't involve computers
    • Engage in vigorous physical exercise
    • associate with the attractive sex
    • Step back from low-level coding and do other software-oriented things like design, discussions with a coworker or documentation
    There's some more, some of which I'll discuss in a moment.

    I did in particular step back to think about software from a different level than coding, but I didn't actually do design work. Instead, I just cracked open some good programming texts. If you haven't read much lately there's probably a lot of good stuff that will stimulate you and improve the effectiveness of your work - check the book reviews online at The Association of C and C++ Users [accu.org] (and consider joining it - I did, a couple months ago).

    One thing I consider important in the reading I did was that I wasn't looking for solutions to the problem at hand. Rather, I was trying to get back to something I'd been missing for a long time and wanted to indulge in - the sheer joy of learning for its own sake.

    It was the case that the books I was reading were pertinent to my work but I wasn't searching them for solutions. I was just reading and flipping through them as my curiousity led me. And when solutions to my problem would occur to me, I'd put them out of my mind until the time I'd decided ahead of time would be my time to resume work.

    What actually got me going again was that I had such a flood of ideas and they had crystallized so clearly I was able to sit down and implement my solution in a day and it worked just fine - still does.

    Something else that helped stimulate me was the website on Extreme Programming [c2.com].

    A lot of the approaches there really appeal to me. Particularly I like the ideas they have that could be generally expressed as "design by coding" and are mentioned I think by Stroustrup in the intro to More C++ Gems as "expressing designs in the code".

    That is, rather than doing a bunch of up-front modeling using diagrams like OMT or UML or what have you, you just write code - but you are designing in the code, so they emphasize in extreme programming that you constantly rewrite the code as designs gel.

    One thing that saddnes me though is that Extreme Programming also suggests programming in pairs. This is something I used to do with Dave Johnson [mailto] when we were at Working Software [working.com] together. We'd help each other through hard spots and just rap about politics and stuff and go have coffee or a beer and get a lot of work done.

    Now I live at the End of the Internet [infinitevisions.net] and I'm working for myself as a one-man consultant shop [goingware.com]. It has its advantages (I can work at home and set my own hours) but one big disadvantage is that I work very much alone and there's no one around to bounce ideas off of.

    I have other programmer friends and I do call them up but they all have their own gigs - it's not the same.

    On another important note, several people both here, privately via email and in the newsgroups raised the possibility of this being clinical depression.

    Well that is something I was well aware of and had been considering. Depression is something I have been dealing with all my life, as you will see in another slashdot article I posted:

    Manic Depressive Geeks [slashdot.org]

    I didn't used to be (woefully so) but now I'm very introspective about my mental and emotional state. I have to be. I didn't used to be but now I just won't tolerate the depths of misery that I just thought were part of the normal human condition.

    But I don't think that what was happening to me was the sort of depression that I usually consider. There are "endogenous" and "reactive" depressions. Endogenous depression just happens to you and is usually caused by chemical imbalances in the brain (shortages of serotonin or norepinephrine) and is what's usually experienced with Manic Depression, while reactive depression is (naturally) a reaction to external events, like a personal tragedy.

    Life has been really hectic for me for a long time, with the turbulence of my consulting business, falling in love with a woman from another country, planning a wedding, moving to Canada, and just trying to keep it all together. Maybe if all that hadn't been going on, I wouldn't have gotten stuck. But basically, I just got stuck.

    Robert Pirsig talks about stuckness and ways to overcome it extensively in Zen and the Art of Motorcycle Maintenance, which I recommend highly (and probably ought to reread). And I really was suffering the kind of stuckness he described, the stuckness that occurs when you just want to get your bike fixed and you break the head off a crucial screw...

    (Robert Pirsig went nuts while a grad student in philosophy at the University of Chicago. He had shock treatment back when it wasn't very carefully administered and lost nearly all his memories. The book is about his motorcycle trip across to some of the places he used to live to visit old friends he hardly remembered, along with an amazingly enlightening discussion of what he'd been so obsessed about that it drove him crazy - what is Quality?)

    Someone mentioned meditation in the discussion. I had found reading about Zen and doing meditation on my own was of profound help in overcoming my mental illness back in the really dark days. But as things got better and my career got in shape and I stopped seeking so much and concentrated on learning to program and making a place in the world for myself I drifted away from that, something that I think is really wrong.

    During my time off my then-fiance lent me her copy of Chogram Trungpa's The Path is the Goal, A basic handbook of buddhist meditation. It is published by Shambhala Publications [shambhala.com]

    I'm afraid I read a little bit of it then when my time off came to an end I set it aside and started thinking again.

    One of the little traps our mind has for us is thinking. I like to think, and I'm particularly well-developed at it. But my wife tell me that we are not our thoughts, and actually our thoughts can lead us astray. And when I was getting so stuck on my programming problem I was thinking really hard and trying to solve my problem by thinking harder.

    One thing you do in meditation is to stop thinking. Hardened programmers might find that a frightening concept. And you can't really try to stop thinking - you just sit, and look, but not too hard, and experience

    You cannot experience your world as it really is and be thinking.

    One thing that Pirsig discusses in his book is how to bring the wisdom attained at the rarified mountain peaks of meditation down to practical value in everyday experience. He uses fixing a motorcycle as an illustrative example but when I read the book I found that I was able to program better because I could "become one with the machine".

    My wife doesn't really believe this is possible but I think it is, that one can meditate while carrying out an intellectual activity like computer programming. That's something that I seem to have lost long ago, that I had years ago when I was not nearly so knowledgeable but I did have the ability to really lose myself in the machine all day long without distraction - and without getting tired or worn out.

    Don't forget:

    Tilting at Windmills for a Better Tomorrow
  • One of the side effects of moving up here to Newfoundland is that we drive long distances to get to my wife's parent's house, and we also made a trip (via the ferry) to Nova Scotia, which is a really long way.

    I couldn't afford to not work for such long times so we bought an inverter at Canadian Tire and I plugged my laptop [goingware.com] into the car cigarrette lighter.

    And damned if I didn't get more work done on the road with my wife driving that at any other time.

    I'm writing a cross-platform product right now and have a choice to program on a Mac desktop or my windows laptop (it also runs Slackware Linux and BeOS [be.com]). Sometimes my wife borrows the laptop to browse the web and - zing! - I get a lot of work done.

    The problem was that I'd leave elm open in a terminal window and a web page open on slashdot and hit reload whenever I was running a long compile or something.

    So recently I made the choice to turn off my laptop when I've set into my work, or give it to my wife. It's greatly improved my productivity.

    (I only paid for one computer on my cable modem, and haven't figured out IP Masquerading yet, so my mac can't hook to the internet. Modems are interchangeable but the DHCP for the cable modem is keyed off of your physical ethernet address so unless you cough up for the second connection or use masquerading you can't use a second machine).

  • When I used to work at Live Picture (publisher of the Live Picture image editing app, and one of the creators of the flashpix file format) one of the things I got in the habit of doing was going out the back with the smokers when they'd all go out and smoke.

    I don't smoke. Never have.

    I'd just stand where the wind blew the smoke away and we'd have a little chat. It was very helpful. Sometims we'd talk about programming issues or sometimes we'd talk about nothing at all.

    Mike

    Tilting at Windmills for a Better Tomorrow
  • The ZDNet article included the quote from my question:

    What do you do if your productivity drops to two lines of code a day, and you just sit and stare at the code and feel like you don't know how to do it anymore?

    I emailed the author, Mary Jo Foley [mailto] and asked her why she didn't attribute me, pointing out how easy it was to find out who I was from the link in the ask slashdot article and my first post.

    It particularly irritated me that I didn't get credit when she interviewed Linus about it, who didn't participate in the discussion, and some other guy who compared a programmer being stuck to your plumber saying he couldn't fix your pipes because he had "plumber's block".

    She replied that she didn't give attribution to my post (and I guess to any of the posts that came directly from the Slashdot discusion) because she had been flamed in the past for quoting people from Slashdot!

    I consider that pretty cowardly. Say what you want to me in the press - but spell my name right. Imagine she'd quoted some government official saying something, but didn't attribute them because other government officials had complained in the past!

    She should be very well aware that any snippets she quotes from Slashdot are perfectly legal because of fair use (I could not imagine a fairer use) and it is not just ethical, it is a very basic rule of journalistic practice to provide such attributions.

    It is important for historical reasons - what if the ZDNet article survives to be quotes later but the slashdot discussion is no longer available to be linked to? What if someone reads my quote but does not follow the link?

    She felt that simply providing a link to the original article was sufficient attribution, but that's not true - my words appeared on her page, and I want my name next to them.

  • by gharikumar ( 87910 ) on Tuesday August 01, 2000 @02:36AM (#889868)
    Programming is an intensely mind-consuming activity that can leave you mentally exhausted. You need to give your mind a chance to clear off the cobwebs and stay fresh.

    Suggestions:

    1) Develop some hobbies or other interests that have nothing to do with computers or books or other mental activity. Preferably, some physical sport that causes you to sweat a little, or something like carpentry . Spend at least 30 minutes a day on such activity. A healthy mind requires a sound body to stay healthy.

    2) Hang out with some non-programmers of the opposite sex once in a while. Tell them about what you are doing (in a non-boasting way). Never underestimate the effect of the power of "wanting to show off" on your creativity.

    Hari.

  • hmm... so if we assume the second chute has the same reliability as the first, then you only have a .09% chance of making a big loud SPLAT.

    - isaac =)
  • by laborit ( 90558 ) on Tuesday August 01, 2000 @03:22AM (#889873) Homepage
    "I must not fear. Fear is the mind-killer. Fear is the little death that brings total obliteration...

    But you probably already know that. And I already know the cruelty of simply telling someone not to fear. I'm no programmer, but your problem is universal.

    You are finding it difficult to work. This is because, as you perceive it, the risks of continuing outweigh the benefits. You may explicitly tell yourself that this is not so ("I know I could just back up the code and write any old thing and throw it away if it's wrong"), but the horde of automatic thoughts that rise up when you contemplate doing it say different. You know that in a long-term sense, bearing down and getting through the work is the best thing by far. But when an individual's fears of failure become strong enough, it can force hir out of the long-term perspective and into a low-level, immediate world, the same way that you can be stopped from contemplating Rodin's Age of Bronze by a splinter. This is the point where you might just be told to shut up and work through it, but another way is to figure out what your fears are, whether they're reasonable, and whether they can be disproved or transformed.

    If you were trapped in a situation where the alternatives were painful, awful failure and procrastination, your solution would be to procrastinate. You must acknowledge that this is reasonable. The first step is not to blame or criticize yourself, which only increases your paralysis, but to compassionately accept that you're in a bad situation and start working to get a handle on it. It sounds like you're already on that road.

    Now, we have to find out why you're fearful and emotional about this project and whether it makes sense to be that way. The simplest of all tools in my field of study is the double-column technique. Just think about the automatic thoughts that go through your mind when you contemplate working, and get them written down on the left-hand side of a sheet of paper.

    I don't know what your thoughts are, but for many people they may look like this:
    1) I'm going to make a lot of mistakes and look stupid.

    2) I won't be able to handle this problem at all, which will make me a failure as a programmer.
    3) I'm going to reveal that I'm not as skillful as I pretended to be, and have been a fraud all these years.
    These are frightening. Are they true? In fact, they contain cognitive distortions that all people make to some extent. The second and third show the especially insidious error of dichotomous thinking, the tendency to see things in an all-or-nothing sense. A single failure could be due to a specific hole in your education, emotional factors outside your work, a lingering virus, or all sorts of things. But even if you completely and utterly screwed up, would that erase thirteen years of success? Surely that makes no sense!

    On the right-hand side of the sheet, write the best refutations you can think of to these statements. They should be compassionate, insightful, and constructive -- everything you'd tell a friend in your situation. In this example, they might be:
    1) No one will see my mistakes but me, and I already know I'm not stupid. I'm an elite hacker! Doing things wrong is annoying, but ultimately it's how I learn to do them right.

    2) If I do screw this up, it won't make all the things I've learned and all the successful projects I've done magically disappear. It will mean I did one thing wrong, and for a lot of possible reasons at that.
    3) Which is more reasonable: that I've had a slump lately, or that everything I've done in my life has been some insane con game? I know that I have the skills to handle this. Even if it takes a lot of work, I can afford to do it calmly and happily, knowing that even missteps take me closer to my goal.
    Keep your refutations with you at all times, and write them down as you think of new ones, or notice new automatic thoughts. What you have to do is take the most powerful and frightening thoughts you can uncover and argue them down. I mean seriously argue, bringing up the best refutations you can and trying to believe them wholeheartedly. Even if you don't buy them now, think how much more productive they can make you. This isn't really dishonest; if this rational optimism leads to repeated failure, you can always re-evaluate it and change to thinking you're a washout.

    Fear and self-criticism are terrible motivators. Relaxed understanding allows you to work with an absorbed sense of flow. To put it tersely:

    chill.

    - Michael Cohn

    Important note: I am a student, not a licensed or degree-holding psychologist. I am giving you a digest of other researchers and writers. This may be valid self-help advice but should not be relied upon for severe or life-threatening problems

    Recommended reading on the subject of Cognitive-Behavioral Therapy:

    Beck, Judith: Cognitive Therapy, Basics and Beyond -- a textbook. Dry but comprehensible.

    Burns, David: Feeling Good -- a self-help classic. Burns is a moron about a lot of things, but it's overflowing with useful techniques and arguments.

    Ellis, Albert: A New Guide to Rational Living -- If you're sick of therapists who act like Deanna Troi, you'll be pleased when Ellis comes and kicks you in the ass.
  • by TopShelf ( 92521 ) on Tuesday August 01, 2000 @04:15AM (#889877) Homepage Journal
    Caffeine's great if you know the path that you're on is the correct one, and you just need to hammer out code and work intensively for hours on end. It's like strapping a rocket booster on - if you're pointed in the right direction, it works great. If you're lost, though, it won't help you at all.

    One means of stirring up the creative juices is to walk far away from the computer and pick up a good magazine (like Scientific American) with articles from a wide variety of backgrounds. It can be useful if you're an engineer, for example, to read articles from biologists or astronomers to give your brain a kick in a different direction...

  • The only way to cure programmers block is a direct infusion of skittles and mountain dew intravenously, keeping the brain in an alert and creative state.

    Duh.

  • I've been kicking around IT for 13 years now. I recently had a mental block which lasted some months. Although you refer to it as programming block, IMO it happens in every walk of life, and its not the first time its happened to me.

    My last episode was between Feb and May this year. I took some time off in April and did nothing but sit at home thinking about whatever. This did not improve the situation at all. As soon as I was back at work, I couldn't make the links between ideas to come up with any solutions, once more I was drifting.

    I survived this, how, I don't know. I took to playing a little more sport and generally trying to care less, though not shirking any responsibilties.

    IMHO this loss of mental agility has a lot to do with stress, not just work, but life in general. Nowadays we are mentally very active from dawn til dusk. Mentally very taxing.

    My friends (some of them my colleagues) and I often sit together and discuss ideas. These ideas are not work related, and often completely off the wall, but we generate ideas about things which really have no bearing on anything outside the conversation, in fact its mainly comedy. I find these conversations very therapeutic and mentally stimulating, being comedy they are funny and therefore relaxing. I my experience, a relaxed mind throws forward some excellent ideas when least expected.

  • When you have have programmer's block, don't try to distract yourself by reading slashdot.

    It may seem like a good idea at the time, but you will soon realize that your two lines of code productivity will drop in half.
  • Do NOT follow the temptation to go into project management or somesuch, if your programming job isn't enjoyable anymore! I tried that, and am now pining away for the sort of job I used to whine about.

    But, I have done more than pine, I have used the tight job market to my advantage and have cried enough to get a promise that I can go back to coding and move into design/architecture when I get up on some new tools.

    Now I just have to "finish my homework" and doc up this part of the project, and my reward will be doing some coding on the next part. Talk about a mental block -- knowing I have to keep slogging away before I can do what I'd like...Aaarghh!

    So, about the only advice I can give is to know what you really want to do, then make a fscking pest of yourself until your employer lets you do it.

    And if you're still coding for a living, count your blessings.
  • by re-geeked ( 113937 ) on Tuesday August 01, 2000 @10:59AM (#889914)
    Back at my first programming job in college, I would try to explain the problem I was having to the receptionist or data-entry clerk, and although I would really try to explain it in English, they would always stare blankly at me with no idea what was going on.

    Didn't matter, though, because by talking it out I always talked myself into an answer. I'd say "That'll work. Thanks!" and go back to my desk with them staring at my back, puzzled (and probably frightened).
  • When I was at university, I found that the more complicated stuff always used to make more sense when my mind was really off the subject (like when I had drunk too much, and was considering making a move on the goth girl next to me).
  • by garethwi ( 118563 ) on Tuesday August 01, 2000 @02:41AM (#889918) Homepage
    I know the author has spoken, and a holiday has provided the answer for him, but perhaps someone else who is really in a rut could try what I did.

    I changed everything about working with computers.

    For years I used to specialise in programming VB and Delphi apps in Windows (don't laugh, it paid the bills), and I was really in a rut. I had tried just about everything using those languages, and there was no very much left to interest me.

    So I made a big jump. I switched to Perl. I got a new job programming in Perl as a trainee consultant, and after 6 months solid learning, I still realise that I am only scratching the surface.

    Life couldn't be better. I'm having challenges again (I also switched from Windows/IIS to Linux/Apache), there is lots to learn, and the fun that I used to have when I was playing around with my old ZX81 has returned. Coding is great again.
  • I'm not a coder but I do know that in writing novels and screenplays the trick is not to write yourself out. If one of my characters is engaged in an activity, I don't let him/her finish it in one session without starting another. The next day it gives me a place to start from that is already in motion, so to speak. This way you avoid the 'where do I go from here' syndrome and can easily get your head back in the place it was the day before. I know other writers that do the same. Several carvers and a sculptor I've talked to do this also. Don't 'finish' every day. Leave your project just a little unfinished and you'll be raging to get at it tomorrow and know exactly where to start and what to do. Good luck! You are definitely not alone.
  • I've being working at Davinci for over three years now and about a year ago I started playing chess with the colleagues in my office. One of my fella programmers brought in a huge chess board. Later two more bords appeared in the office (one of them is mine) today we have real chess matches going on, people are excited and are playing all the time (even our product managers.) This helps us to get reduce stress, we actually have fun and think about interesting chess problems and in the long run, I am pretty sure chess helps with thinking processes. (However a couple of card decks are also present so it's not necessarily just chess.) Any time I feel like playing I grab one of the developers and we take off
  • by magnushuckvale ( 133606 ) on Tuesday August 01, 2000 @03:45AM (#889943) Homepage
    One solution that seems to be coming up over and over again is caffeine - coffee, Coke, Mountain Dew, Jolt, Red Bull.

    Caffeine is EVIL

    No, really.

    It might seem like the problem is a particularly tricky algorithm to implement, or a bug that you can't track down, but this is never, ever, really the case.

    The problem is Stress, and if you (I'm more addressing this to the clueless replies than the original poster) don't admit that and deal with it, it will just get worse.

    A charge of Caffeine won't prep you to handle tougher problems, it will just make things feel even more hopeless and impossible. If there is any wonder-drink that will sort you out, it's a Smoothie, made from fresh fruit, that contains lots of de-stressing anti-oxidants and natural sugars.

    Another wierd viewpoint I've seen in this discussion is that when you get burn-out, you should take a couple of days off and then dive right back in. DUH! Why not adopt a lifestyle you can maintain indefinitely??

    Through my degree I tried all sorts of things that I thought would directly increase my productivity - Coke, ProPlus, Guarana - and they all just served to make me more stressed, depressed and non-productive.

    What really increases productivity is having a rest and doing something different. I always try to:

    Do something small at least every hour
    • Go to the toilet
    • Go fetch a smoothie
    • Go and have a chat to someone
    • Pray (I ain't religious, but I see that this would help) or meditate
    Do something longer two or three times a day
    • Lunch OUT of the office
    • A walk in the sunshine
    • Watch a movie
    • Have sex (on your own is just fine)
    • Play an instrument
    • Have Exercise (trust me, there IS a worthwhile sport for you, even if it's just a walk in the park)
    Take the weekend off
    • Veg
    • Tidy the house
    • Dig the garden
    • Go visiting people
    Duh, people tell geeks to get a life. Sometimes we don't even look after the one we've got.
  • This happens to me every now and then. However I think that it's a lack of motivation.

    All I need to do is really give myself a kick and put my head down and work. After I do that I normally solve the problem in a day or two.

    Another thing I do is just start coding. Even if I don't know how to fix a problem I find that if I just start writing code it gets my brain working. On the down side I normally have to scrap what I have just written...
  • by NaughtyEddie ( 140998 ) on Tuesday August 01, 2000 @09:05AM (#889954)
    (yes, even pray if your imagination is so limited)

    It takes far more imagination to pray than it does to regurgitate these vanilla pseudo-scientific opinions on religion.

    And, scientifically speaking, your belief in the "subconscious mind" solving your problems is just as superstitious as anyone's belief in a deity.

  • by madstork2000 ( 143169 ) on Tuesday August 01, 2000 @02:43AM (#889960) Homepage
    My problem usually stems not from hard architecture problems, but instead from bad specs. I design web applications using PHP. I will often go on binges where I work 15-20 hours straight take a nap and go back at it. Those are the time when I am told to go and "just do it". But if I am given a handful of poor specs, and then somebody is looking over my shoulder asking me to redo every other feature or function I have a tough time gaining momentum to get any productive programming done.

    For me its all about momentum. The more I code the more I want to code. If I have to keep shifting gears, by attending meetings, writing reports, etc I can't shift my brain into gear. Then I am left in limbo, usually checking my email every couple of minutes and making sure slashdot hasn't posted a new story.

    Fortunately for me I work at home, so I can avoid most distractions, but it usually takes me at least a day to recover from a day in the real office.

    just my $.02

    -MS2K
  • by matlhDam ( 149229 ) on Tuesday August 01, 2000 @02:57AM (#889971) Homepage
    Finding myself unable to code, I started writing the code in english on paper. I would sit down in a corner of the room and start writing in english. "check the user permissions. if the guy is an admin, show this and that screen. for each line in the screen, make sure it's bla bla." and so on. Once I was done and saw that I had something that could work, I took the text, pasted it into the existing source code and started translating it to code (Java in this case).

    Umm, I think that's called pseudocode, dude. You're supposed to write that before you start coding. At least, that's why I keep being told ;)

  • Yeah but I already carry a Dual Band cellphone with WAP and IRDA on it :) If i have a laptop that could actually run software written in the last decade then it'd also be able to surf the web (albeit at 9600bps).

    Ahh the wonders of technology
  • by grahamsz ( 150076 ) on Tuesday August 01, 2000 @02:47AM (#889973) Homepage Journal
    Much as I love it, the internet is the ultimate counter-productivity tool. In my preonline days when I was in the lower years of high school I used to do a lot of coding. When i wasn't out drinking i'd code shit all day (and the odd good thing)

    Now i do soo little :)
  • by chowda ( 161971 ) on Tuesday August 01, 2000 @03:24AM (#889990) Homepage
    Talking to your cat isnt silly at all! often times just talking out loud (for some strange reason) can help you resolve a problem. I talk to my dog much more often than I probably should :)

    Me: I'm not sure how to design this DDL...
    Dog: [pant] head tilt [pant]
    Me: Should I store messages in there own table or can I put them with the message details?
    Dog: [lick nether-regions]
    Me: If I store the messages in their own table I'll have decreased overhead for normal users, but more overhead for adminstrators and translators.
    Dog: [sniff own fart]
    Me: 4 of 5 hits will be normal users and they pay us...
    Dog: [pant] head tilt [pant]
    Me: Two tables it is then!
    Dog: [lay down and snore instantly]

    So as you can see in this very simple example how helpful my dog is... sometimes these conversations can go on for hours....
  • by tbdean ( 163865 ) on Tuesday August 01, 2000 @02:34AM (#889992) Homepage
    I find it helps to stop and pray, even if just for a minute. I lean back in my chair, put my feet up on my desk and ask God for inspiration. It's helped me out of blocks many times. Of course, I liked the comment about becoming a sys admin too. :) I actually do both so when I get tired of one I do the other. It's 4:30 AM here in CA and I've been coding an inventory proggy since 10 AM. At 1 PM I get a break to install a frame relay!
    T. Bradley Dean
  • by cr@ckwhore ( 165454 ) on Tuesday August 01, 2000 @03:08AM (#889993) Homepage
    Recently I've been experiencing the same! I've been calling it "programmer's fatigue". There are probably a few programmers out there that believe "programmer's fatigue" can't be experienced by a REAL programmer... well screw off and blow it out your far heap. I've been programming for 17+ years and its not exactly 'programming' that I'm fed up with. It's the application I'm working on! It's gross, and the spec is completely out of control.

    In my experience, I need to be utterly interested in what I'm writing in order to be good at it and turn out a great piece of software. Perhaps you aren't interested in continuing your project... there are obsticles in the world that software can't solve. Screwed up software design specs are one of 'em.

    If you're bored with the current app your working on, find something of better interest, and you're productivity will surely pick up again.

    --cr@ckwhore
  • I am really, really glad to hear that I'm not the only one who experiences this problem. I was really starting to worry.

    I think motivation and passion for what your doing is a big key.

    I'm a consultant and I've been brought in by another company to help salvage an ASP project they have. The project just needs to be scrapped; the other programmers have the same opinion, which doesn't help things.

    I look at how much money they pay for me to be here, and I feel so bad, but I just can't bring myself to be very productive. I read Slashdot, I instant message, anything to get away from programming -- and when I do sit down to program, it's like I zone out.

    You know what the sad thing is? I'm only 20 and I already have this problem; I'm terrified by that.

    The Solution - What I've Discovered Anyway.

    Money isn't enough. Wealth doesn't drive people like us -- it's the challenge, the thrill we get from programming. I remember when I finally "clicked" with Java; my hands just sort of "took off" on the keyboard, and I pulled an all-nighter, something I hadn't done in a long time.

    You need a vested, genuine interest in what your doing. It's time for a change of scenery. Personally, if my next project (only 3 weeks to go!) is in the same boat -- I'm out of here. I'm way too young to be this drained. I'll either devote my time to my business or go back to school and become and "academic".

    This is part of the reason Linux and debatably Mozilla has taken off so well. You have all of these guys devoting their free time to something they normally get paid for. Why? For the love of the game.

  • by Spudley ( 171066 ) on Tuesday August 01, 2000 @02:39AM (#890009) Homepage Journal
    I know this sort of thing well. I get it myself often.

    My solution is simply to switch to a different project for a while. It always works for me - I work well on the other project, and then when I go back to the original work, I'm more motivated.

    I haven't really analysed why this works before, but I think it's maybe because when I come back to the original project, I've forgotten some of the details of how it works, so I have to study the code again; that's a great motivator (for me, at least) because I spot bugs and stuff that I would have missed otherwise, so I start fixing them, and that breaks the "programmer's block" syndrome.

    By the way, I'm also a writer, and the same thing works for me with that too (although I usually have to leave it alone for a bit longer than with programming projects).
  • I tend to find that the best way of dealing with this problem is to identify individual elements of the problem, and start knocking up solutions to them, without worrying about the bigger picture. This might be things like creating a new class that will help me solve a problem further down the line, trying to use a couple of new techniques as I go, and creating a bucket-load of useful methods along the way...

    This usually rejuvenates me completely. I suddenly find that I know how to tackle the problem, or at least some fo the elements of it. And I can plough back into the task at hand.

    All the work I'm doing can be incorporated into the final solution, but I find it to be the most effective way to address individual issues, rather than staring at the problem as a whole going "Ohmigodohmigodohmigod...".

  • What do you do when you are stuck in code and your focus leaves you?

    spend half the day reading 'ask slashdot' articles about what to do when you are stuck in code and your focus leaves you. if this doesn't work, try it for another couple of hours. i'll let you know how it goes.

    if my boss is reading this, it's my evil twin posting this and yes the database code is finished.
  • "I am an 'INTP'. The middle two letters (NT) are very common type of personality for programmers."

    Jeez. The last person a Shashdot reader wants to hear is that they're NT at heart. Is using Linux instead just a form of denial?

    (sorry -- couldn't resist)


    --
    "Better dead than smeg."

  • I think a lot of it comes down to personality. Different people (obviously, I guess) have different ways of coping and getting problems worked out.

    Most people who I know tend to go for the attack coding binge type of approach. That is to come in stacked up with 16 hours worth of the high energy drink of their choice, and just sit there and code.

    I've never found this to be very productive for myself because my mind doesn't work instantaneously on demand like that. What I tend to do is look at the problem so I know what I'm dealing with, then just ignore it for a few days. During this time an idea of how to do it just forms in my head, and if I can I'll probably scribble bits of it down on paper as soon as I have the opportunity.

    Even then, I usually can't code it immediately. I wake up in the morning knowing what I want to have accomplished, and during that day it's virtually impossible for me to get very far past that point. If I manage to get the whole lot done in half an hour, I still can't get much further than that point. I'll just end up sitting around playing freeciv [freeciv.org] or something.

    To make more progress means waking up again with a new goal in mind, knowing what I want to get done. Sometimes these goals take all day but they're usually not too big to take much longer. If they are, I just stop when I get tired and finishing it becomes the next day's goal.

    So I guess my way of attacking the coding block that I get is to break it down into small day-by-day problems. If I can't think how to do something, I'll work on a different part of the project instead. Usually in the beginning I don't have any detailed idea how I'm going to do something, but as the bits build up and it takes some shape, it gets easier to see how to finish it off and what parts (if any) need to be recoded.

    It probably wouldn't be much help if your mind works differently, though.


    ===
  • When I get the symptoms of burn out, I take a small time out, and start listing the tasks I have to complete. I often find that the problem is not the difficulty or complexity of the problem, but the sheer number of tasks. I read or heard somewhere that the human mind can only juggle 5 or 6 ideas at a time, and that more than that becomes overwhelming. I don't know about the rest of you, but it's very true for myself.

    Often, I'll find that it's not even programming tasks, it's just I have too many other things. If my list looks like this:

    1: Implement a file transfer mechanism to the machine older than me
    2: Solve a defect in someone else's code
    3: Bath the dogs
    4: Get some milk
    5: Renew my car tags
    6: Get a haircut
    7: Get my mom a birthday card

    then the simple number of "everyday" tasks will overwhelm the programming tasks, and I'll get nothing done! The only thing to do is take a few hours, clear tasks off the list, and come back with a "managable" number of tasks. Or just make the list, so your brain isn't always swapping memory to disk.

    That's why, while on site, I can write hundreds of lines of code a day, clear tons of errors, and write pages of documentation, but when I get back in the office, I find it hard to even make 1 line changes. It's a different world, when you have to do your own laundry, cook meals, be social, etc.

    It's a shame life gets in the way of code sometimes, but you got to take a holistic approach.
  • by AndrewD ( 202050 ) on Tuesday August 01, 2000 @03:08AM (#890042) Homepage

    The only solution I ever found worked was to change the working environment. Your skills and talent are still there, but you've become bored or intimidated by the surroundings. I find that taking a scratch-pad and a pencil and going to work in a coffee-shop works. For serious cases, I go work in a bar - they're usually quiet during the day and a couple of stiffeners tends to loosen up the inhibitions that are causing the problem.

  • by waroonster ( 204181 ) on Tuesday August 01, 2000 @05:10AM (#890044)

    As a programmer, we think about the problem domain a lot, but we rarely turn our piercing gaze back upon ourselves. I find that when you have a mental block, it's time to stop programming for a while, and get your thoughts and feelings cleared up.
    Here are two ideas:

    1. Go take a personality test, and think about your personality, and the personalities of the people you work with (your clients, your boss, your co-workers).
    In personality types, according to the Meyers Briggs Type Indicator (MBTI), I am an "INTP". The middle two letters (NT) are very common type of personality for programmers. First, the N, which stands for Intuitive, means you search for pattern and order in the universe, and you build an mental model of it. Think of it as Synaptic Object Oriented Programming. You want to figure things out, understand how they work. I call it the "mad scientist gene". The other parts for me, are Introversion (versus Extroversion), Thinking (versus Feeling), and Perceiving (versus Judging). I find that when I am in crisis (code block, or not doing well in a project) it helps to think about why I am upset and anxious, and what personal, emotional, irrational, yet real things are bothering me. One way to let that stuff surface is to recognize that your Extreme Code-Writing persona is one way of subjugating lots of other parts of you that you don't want to deal with. So try leaving that coping strategy behind for a while, try to find that emotional you, and wallow in it for a while, or leave the analytical you behind for a while, and operate in the other parts of your head and heart that normally lie around not doing much when you're programming.
    In other words, programming is only "part of you" it's not all of you. It's not your reason for living, and it's not even your best part, most likely. Read a book about personality types, about people, about something emotional or personal, or read a devotional book, if you are religious. Understand your personality, and choose to live in a different head-space than you normally would, choose to live in.

    2. Sometimes a good way to let everything bubble up to the surface is to write a good rant. I don't believe a rant needs to be sent to anyone else, but if it does need to be, then send it to one buddy. Even better, just write it and save it on your hard drive for 24 hours. Don't send it. After 24 hours, go back and read it forensically. Treat it like a core dump of a diseased program. That's what it is. Debug your mental state the next day. If there are good points to be made in your rant, isolate them, and save them. Hopefully those good points can be made to your boss or client in some way they can hear and process constructively.


    Third bonus suggestion: Read slashdot for a while. :-)
    Warren Postma

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (5) All right, who's the wiseguy who stuck this trigraph stuff in here?

Working...