Discover the best of the web!
Learn more about Digg by taking the tour.
Overcoming Coder's Block
skindeep.logankoester.com — For my entire programming career, I ’ve been searching for a solution to what I call “Coder’s block”. Writer’s block is easy by comparison - simple techniques like freewriting and mindmapping can help to keep you focused and free of distraction. But what techniques can be of use when writing software?
- 864 diggs
- digg it
- scuba7183, on 10/12/2007, -1/+62definitely avoid social sites, i cant count all the times that I've almost missed a deadline for something cause of digg
- logic, on 10/12/2007, -0/+37Yeah, for me it's not the articles so much as the comments. So easy to lose hours mindlessly scrolling through pages and pages clicking those addictive little thumbs.
- slasherx, on 10/12/2007, -1/+4I totally agree. Instead of working right now I'm switching between either reading digg or watching the rose bowl.
On a side note, here is the duggmirror.com link since it's loading for about 2 minutes and hasn't come up yet.
http://duggmirror.com/programming/Overcoming_Coder_s_Block/ - senfo, on 10/12/2007, -1/+6@scuba7183
For me, digg is more of a procrastination; however, I actually find that digg can help me when I'm having coders block because it gets my mind off of the problem and on to something a little more entertaining. I'd be a pathological liar if I denied spending more time on digg than is necessary, though.
By the way, I've never actually heard of "coders block", so my interpretation may very well be wrong, but I have had times where I just can't think of an algorithm to solve a more complicated task. For example, when I'm trying to design a class or a function (or method if you prefer that name), I try to stay as abstract as possible without making things less productive. Code reuse is often pretty high on my priority list, but at the same time, I don't want to make things so complicated that the next person that comes along won't be able to understand it. I find that on occasion, I know there is a decent solution; however, it some times takes a bit before it comes to me.
For those times when I feel like my brain needs a little kick start, a good cup of black coffee usually gets the blood flowing. Just watch yourself with the coffee because I've found that too much will cause my skin to break out like I just hit puberty again, and I've also found that it can make me a bit paranoid after consuming high quantities of caffeine. If I'm working at home, I've found that some of my best ideas have come to me while I was in the shower. Something about the hot water just seems to spark life back into my head. - returnofmalv, on 10/12/2007, -9/+3Usually when I get coders block I masturbate. That can easily use up 30 minutes.
- kyriakos, on 10/12/2007, -1/+9avoid forums in general. exit MSN. dont set it to appear offline cause u still see people coming online and u get distracted and tempted to chat :P
- drepmoreh, on 10/12/2007, -2/+5Bars are a definite no-no. If I can't solve a problem I'll normally go for a beer, which then quickly turns into 5. I can barely see when drunk so you can imagine what I'm like coding.
- dgaspard, on 10/12/2007, -2/+8I always thought I coded the best at 3am after the bar... The syntax is horrible, but the ideas are usually pretty good.
- FearlessFreep, on 10/12/2007, -1/+2"The syntax is horrible"
and that's what the compiler is for anyway
- astrosmash, on 10/12/2007, -7/+12I've been a software developer for over 10 years and I've never had "Coder's Block". Writer's Block? Sure. Homework Block? You bet! Coder's Block? Never. I just put on the headphones and go.
- wmarcello, on 10/12/2007, -2/+17I'm a programmer. I also play guitar and write songs. I must say writer's block is 1000 times worse than coder's block, at least for me.
- ogden, on 10/12/2007, -12/+8Do you suck then? Coding is as much a creative endeavor as anything and you are either amazing and creative all the time or just suck and don't know it? :)
- ImTheDarkcyde, on 10/12/2007, -0/+23I wouldn't say i get so much "coder block" as a complete lack of motivation to code. I don't do it professionally, just a hobby, so there is nothing that's forcing me to do it
- cracell, on 10/12/2007, -2/+3What the heck are you coding? Anything your task isn't framed out for you, you can get very stuck. That or your the type that spends 3 hours writing a new function that turns out to be entirely useless to the program.
- IceZZ, on 10/12/2007, -7/+8There is nothing creative about it. Usually amateur programmers believe that it's somehow a creative process, because they are not familiar with proper and well-known designs. The Gang of Four is a perfect example. The "creative" part is sitting down and thinking up what kind of project you are going to complete, or what features to include. The coding itself, if done properly and to spec, is a mechanical process. If you think coding is about "being clever", then you probably write bad or unmaintainable code. There is very little freedom when conforming to a proper design.
This leads us to the conclusion there is no such thing as "coder's block", only procrastination. You should **always** know what the next step in the process is. - emehrkay, on 10/12/2007, -0/+1I'd say that the only block that i get while coding comes from not knowing what to do next. So in fact it comes from the documentation not being complete. Thats when the writers block kicks in.
- TimTim, on 10/12/2007, -0/+3@IceZZ: This leads us to the conclusion there is no such thing as "coder's block", only procrastination. You should **always** know what the next step in the process is.
My opinion exactly! Programming is all about logic! All one has to do is think "what needs to be done next?" and then start writing the code to do that very thing. I think some people day dream too much about the program and they can't see the steps. This leads to procrastination and distraction. - ryodoan, on 10/12/2007, -2/+3@IceZZ
One of my computer science professors would dissagree with you to no end. His exams are designed to get you to be as "creative" as possible. He feels that you need to be able to think for yourself. As for the creative exams, they are a doozy, highest score out of 60 people was an 84%, with a low of 1% and an average of around 50%
I understand where you are coming from, but in the end I aggree with my professor. To be a skilled programmer you need to be able to think out of the box. Yes, the easiest way to solve the problem might be with nested for loops, but what if you can find a way to do it recursively in a different way and cut the complexity from n^2 to Log(N) ? - astrosmash, on 10/12/2007, -0/+3Software development is 90% technical skill and experience, and maybe 10% creativity. Of course, CS students have little technical skill and even less experience, so for them it's all about being creative.
Which is not to say that creativity isn't very important in a job, it's just that if you find yourself having to be extra creative when it comes down to task of coding, you'll probably just end up with a bunch of stuff that doesn't work.
Personally, if I find myself "blocked" creatively, I'll usually do some heads-down coding to get the juices flowing again, which is why I don't really understand the concept of "Coder's Block" that this article suggests.
- VaporBro, on 10/26/2007, -11/+5Why not take some LSD? =]
- stormgren, on 10/12/2007, -0/+11Because the code isn't supposed to crawl off the computer screen.
- logic, on 10/12/2007, -0/+3LSD is wayyyy too intense for coding, at least for me. However I often find that if I can't quite get my head around a problem, or motivate myself to do a boring and repetitive task, that the non-linear thinking induced by smoking a bowl (or less) of marijuana will help me see the problem from a new angle. But I have to be careful not to smoke too much, or I'll end up on the floor =)
- ZMerlin, on 10/12/2007, -0/+2Early Cisco Systems Inc programmer Kevin Herbert used to use LSD to overcome difficult coding problems.
See http://www.wired.com/news/technology/0,70015-0.html
- perlgerl, on 10/12/2007, -1/+8Definitely stay away from MMORPGs when you have coder's block.
- jbond03, on 10/12/2007, -0/+52 years later, 5 lvl 60 chars. 0 code written.
- IHatePants, on 10/12/2007, -0/+21For me it's a shower. It may sound weird, but when I have a problem I just can't work my way around, I take a long shower. I guess it's because the act of bathing is mechanical, so it and the comfort of the hot shower frees my mind to think about the problem in a more clearheaded way, and there are no external distractions past the curtain.
- bariswheel, on 10/12/2007, -2/+4There is a scientific reason why a shower is a good thing, it's a shower of negative ions.
Negative ions enhance our mood, stimulate our senses, improve appetite and sexual drive, provide relief from hay fever, sinusitis, bronchial asthma, allergies, migraines, even post operative pain and burns. Negative ions stimulate the reticuloendothelial system which is a group of defense cells in our bodies which marshal our resistance to disease. Negative ions promote alpha brain waves and increased brain wave amplitude which results in a higher awareness level. The body is better able to absorb oxygen into the blood cells, oxidize serotonin and filter airborne contaminants.
Normal ion counts in fresh country air is 2,000-4,000 negative ions per cubic centimeter. At a large water fall you might find over 100,000 negative ions. Polluted air such as in large cities might have less than 100 ions.
You might have noticed that you feel more refreshed near the ocean, a waterfall or even taking a shower. This is because all of these areas have a higher concentration of negative ions to positive ones. The ocean typically has 2000 negative ions and 1000 positive. The force or energy of the falling or splashing water causes splitting of neutral particles of air, freeing electrons which attach to other air molecules causing a negative charge. - marc26uk, on 10/12/2007, -0/+2@bariswheel
You got a source ? Otherwise I have to disregard this interesting fact :-( - camturner, on 10/12/2007, -0/+1I was intrigued too. This is as close as I could find to a source: http://www.medicinenet.com/script/main/art.asp?articlekey=52131
- bariswheel, on 10/12/2007, -2/+4There is a scientific reason why a shower is a good thing, it's a shower of negative ions.
- Takteek, on 10/12/2007, -2/+5http://www.dzone.com/links/overcoming_coders_block.html
I just saw this on DZone and I was thinking "I wonder how long until this shows up on digg. Maybe I should submit it... nah." And here it is!
Awesome article though. I seem to have coder's block a lot. = - jmacdonagh, on 10/12/2007, -0/+11A lot of times I get coder's block because I get stuck trying to figure out the "best" way to do something. Whenever I'm thinking I get up and get drinks of water. I also waste time on digg.
- kyriakos, on 10/12/2007, -0/+10thats when u start going through websites with solutions about the problem and then get caught on something programming-related and interesting that is totally unrelated with the coding problem you had initially..
- pmcnamee, on 10/12/2007, -0/+3I've found myself floundering for way too long trying to figure out the perfect design patterns as well. Fortunately I can usually pick someone else's brain at work and get back on track.
- paulcooper, on 10/12/2007, -0/+4oh Amen. Thats my biggest problem - i know i could solve the current problem (when coding) by just hacking and slashing into the code, but I'm always looking for the 'best' solution, most elegegant, resuable code and sometimes even to introduce a nice convention for other problems like this. There is very few times when writing code is about just trying to get this one thing to happen - its alwasy about so much more, which is bound to bring about coders block.
So this was a helpful article. - evilbeatfarmer, on 10/12/2007, -0/+2If you find yourself always trying to find the 'best' solution without ever coming up with a solution. Try this: implement it once, any which way that works. Then refactor your code with input from others (co-workers) or with fresh eyes.
- pauleric, on 10/12/2007, -0/+7I usually avoid work when I'm not entirely sure how I need to solve the problem at hand. So I try and do something productive on something easier, even if it's not the particular project that's most urgent. At least I'm getting something done that I won't have to do later. Eventually It'll occur to me how to proceed, or I'll make up my mind what I need to do. Of course, if you've procrastinated to the last minute, then this doesn't work.
- SPrintF, on 10/12/2007, -0/+3I agree with this. If I'm avoiding tackling a problem, it's almost always because I don't really understand it well enough to begin coding. "Coder's Block," for me, is my mind telling me, "Hold on there, hoss. You're writing checks your brain can't cash."
- kyriakos, on 10/12/2007, -0/+6also found my internet-enabled pc being the biggest problem when i was in university. i could sit down to do an assignment that normally would take me an hour and spend the whole night cause i was IRC chatting (yes i'm old), browsing and all the usual stuff..
- Tiak, on 10/12/2007, -0/+2IRC is still around, it doesn't exactly make you old... Now if you got sucked into a BBS, then you would have that right.
- wizgha, on 10/12/2007, -0/+4Dugg simply for the sheer irony of avoiding digg. Wish I could convince myself to practice what TFA preaches though.
- FormulaOne, on 10/12/2007, -0/+13
Didn't anyone watch Swordfish? The best way to prevent coder's block is to have a girl give you a blow job while coding. Everyone knows that.- Tiak, on 10/12/2007, -0/+6I thought it was to watch someone suffocating as you're coding... Either way, I doubt I'd be able to finish a hello world, let alone create a bank supervirus thing or steal money that was randomly routed to a random account somewhere.
- mwheeler1982, on 10/12/2007, -2/+1If you're having a hard time figuring out what to program, have you tried writing out on paper what you're going to do? If you've flowcharted your application/module, converting that to code should be the easier part...
- darkstar949, on 10/12/2007, -0/+2Part of coders block is coming up with the algorithm to use when coding - as such flow-charting it out would not due to that is one of the things that you are having coders block about.
- Brahma, on 10/12/2007, -0/+4FTA..
Avoid social news websites (such as digg) at all cost.
Ironic... - nreynolds, on 10/12/2007, -2/+1The worst is when you're waiting for someone else's work. You know exactly how you're going to finish your part once you get their part but you can't even program the rest of yours because you're not sure EXACTLY how their's is gunna work, and it'd just be a waste of time.
I'm 17 years old and I was a intern at my school over the summer where I helped program and design a new part of the school website for teachers to write up progress reports, etc. We got stuck for like 4 days because the company that made the system we were working with (that has teacher codes, class codes, etc) took so long to write up a little query for us. We would've written it ourselves, but as all really awesome companies do, they hid basically everything about their system so we couldn't even figure out the names of tables and crap like that.- hackwrench, on 10/12/2007, -0/+1>and it'd just be a waste of time
No, it isn't. While I don't write code professionally, the little programming I have been doing and the programming bligs I've been, and just general experience indicates that even writhing code to throw away isn't a waste of time.
http://www.objectmentor.com/resources/articles/craftsman4.pdf
The apprentice struggles with his mentor's quixotic guidance: Spend hours or days writing code, and then blithely throw it away? How pointless is that? - hackwrench, on 10/12/2007, -0/+1Also from that article:
You need to be ready to throw away a lot more code
than that if you want to become any kind of a programmer.
- hackwrench, on 10/12/2007, -0/+1>and it'd just be a waste of time
- akira117, on 10/12/2007, -2/+1One word, Pr0n....
- centic, on 10/12/2007, -1/+4My productivity has drastically decrased since digg made my bookmark bar
- burke, on 10/12/2007, -0/+3As has mine since it made my homepage... in.... May 2005, I think. I've lost 1.75 years worth of usefulness...
- antdude, on 10/12/2007, -2/+1http://duggmirror.com/programming/Overcoming_Coder_s_Block/
- fotuenti, on 10/12/2007, -0/+3I love, "reboot your day", definitely trying that one out sometime.
- dasaas, on 10/12/2007, -0/+1Wow. Tell me about coder's block. I'm supposed to be coding now. For me the obvious things are important: clean workspace, organization, isolation from interruption. Going beyond that the short nap/restart day thing can work well if done at the right time of day. A BIG part of the block is procrastination. What works for me is a reward system. After applying everything I've already mentioned I'll do a quick scan of sites that interest me like Digg. This gives a secure feeling like I'm not missing anything. Then if I'm really feeling lazy I try to find something I want to see like a south park clip, and set a small goal to get a certain amount of coding done before watching the clip. Breaking apart an overwhelming amount of work into little pieces is effective. The more severe the block just make the pieces smaller! Take short mental breaks like quiet reading as a reward for good progress. I also set up my laptop next to my desktop. It comes in handy for things like Digg, net related phone calls, code testing, etc. leaving my desktop strictly for coding. Sometimes I've got a hand on each keyboard. Hope any of this helps someone. Happy coding!
- IceZZ, on 10/12/2007, -0/+0What you are describing is not "block", it's procrastination! Writer's block is when you don't know what to write. You are stuck. You have run out of creative juice, everything you write is tripe, etc. Writing and coding are entirely different. Coding is a mechanical science, not a work of short fiction.
- dasaas, on 10/12/2007, -0/+1I have to disagree. It's not the SAME as writer's block, but it is a type block. I can personally attest to wasting 24 hours without writing a single line of code. Sometimes family distractions or other things may unsettle your mind for the concentration needed. I do say the word 'block' can be applied, though it's not at all what writers (with my respect) must solve.
- IceZZ, on 10/12/2007, -0/+0What you are describing is not "block", it's procrastination! Writer's block is when you don't know what to write. You are stuck. You have run out of creative juice, everything you write is tripe, etc. Writing and coding are entirely different. Coding is a mechanical science, not a work of short fiction.
- Holosiren, on 10/12/2007, -1/+1As someone who actually writes short stories - bad ones, thank you very much - I can assure you that writer's block is much more complicated than coding block. I know what you're talking about; I have done some simple C++ and VBasic programs. However, one can solve a code problem with pure logic and perserverance. Writer's block is a more dynamic plague.
The human mind is especially apt to deal with "If *this*, Then *that*" sort of problems. I think humans are really stretching the limits of their mental capacity when they try to create art.
The reasons for writer's block are extremely multifarious and notoriously difficult to root out. Sure, there are the type of blocks of that people imagine, ones where a writer doesn't know what logically comes next in the story. But far more common are completely unrelated impediments: for me, ego, despair, and emotional anemia. Going to the keyboard and seeing your fantastic ideas turn into crap on paper is absolutely harrowing. In truth, coming up with ideas for a plot is elementary. Actually carrying through is crazy. And freewriting really doesn't help if you don't have the right mindset.
But enough off-topic nonsense. The blog suggestions sound good for people who code for a living. I just always ruffle up when someone refers to the problems of writing as "easy."- pmcnamee, on 10/12/2007, -0/+2I agree that the creative part of writer's block is most often more difficult than just figuring out algorithms but there is definitely more to programming than calculations. It can be very daunting when you are required to design as well as code.
- FearlessFreep, on 10/12/2007, -0/+4Being a professional programmer and an amateur musician, "coder's block" is a lot easier to overcome.
- jshusta, on 10/12/2007, -0/+2the artificial light trick mentioned in the article works for me, but i use neodymium "true daylight" bulbs. my eyes hurt a lot less and i feel less lethargic when i finally stop working and i go to decompress.
another thing that helps me with easing off the work is to read a good old fashioned paper and ink book, as opposed to just plopping down in front of the tv. if you don't stop thinking about what you were working on, you start having dreams about code. it helps to exercise the mind on something else instead of passively sucking in something you won't value later, because you'll actually be inclined to switch context and forget your work until the following morning. my hypothesis is that the immediate retasking of the eyes/hands is what does the trick. try cleaning house, or if you take martial arts, practice your (forms|taolu|kata|quyen|hyong|tul). - elegalindus3, on 10/12/2007, -0/+2"Writer’s block is easy by comparison - simple techniques like freewriting and mindmapping can help to keep you focused and free of distraction." - that is BS. Those are not "simple techniques"... try writing a book. Pretty simple eh?
(I'm sure coder's block sucks too) - emehrkay, on 10/12/2007, -0/+4You ever wake up in the middle of the night with a coding solution? Those are the best kick starts because you cant wait to try it out
- RobotKing, on 10/12/2007, -0/+1I better clean up around here and find my desk. A good way, to get rid of major distractions, is to unplug the network cable when you are coding.
I know the internet loves me and she will still be there after I do work...unless I forget to take her to dinner on the monthly anniversary (paying the fios bill) then she might be pissed. - solarpowered, on 10/12/2007, -0/+2Do something else (vacation, hobby, tutoring, charity work, etc.) until you actually feel like coding again.
Otherwise you're spinning your wheels.
If it isn't either fun or rewarding, don't do it. - mojaam, on 10/12/2007, -0/+1Depends on the person. If you having too much "coder's block" then perhaps the project/program is just not that appealing.
Also to the writer you might want to correct this part: "This is something I do not just with work, but any time a day is going so incredibly badly it just can’t be saved." - marc26uk, on 10/12/2007, -1/+1I've ended up dreaming in code ! Anyone else ?
- logic, on 10/12/2007, -0/+1Yep. Thinking too. Though usually not so much in actual code as in design patterns. Perhaps this is a result of knowing more than one programming language.
- OneAndOnlySnob, on 10/12/2007, -0/+2The cure: Unplug the ethernet cable from your computer.
Wireless? SORRY THERE IS NO CURE FOR YOU :( - HeavensDoor, on 10/12/2007, -0/+0For me... Subspace ( or Continuum ):
http://www.getcontinuum.com/
But only at home =)
I don't think my boss would love it. - chaoskaizer, on 10/12/2007, -0/+0nice catch, the comment is most exciting part. o/
unplug
dont drink coffee to much
do the meridian tap clear ur mind & soul - error792, on 10/12/2007, -0/+0My coder's block usually comes in the form of wanting to efficientize/beautify code. You know, when you have a kludgy 100-line direct-object-access function and you're just _dying_ to write a brilliant API to make your problem and anything remotely related to it trivial, or make the code a 1-line, abstract, streamlined piece of art. Program design can be pretty frustrating, too (balance between control and simpicity).
- lnostdal, on 10/12/2007, -0/+1to overcome coders block, do something else
Digg is coming to a city (and computer) near you! Check out all the details on our