Hacker News new | past | comments | ask | show | jobs | submit login
How can I get addicted to programming? (stackoverflow.com)
87 points by d_r on July 18, 2010 | hide | past | favorite | 33 comments



As addicted to programming as I am, I can't sustain the same levels of intelligent programming as I can the consumption of media, be it playing a game or reading a book.

When programming, I can stay on-task for 12 consecutive hours a day with enough caffeine, but after the first ~5 hours, I'm doing it by rote, and hopefully I've made good design decisions earlier in the day. After around 8 hours of it, I'm just a zombie. I'll be producing poorly factored and poorly tested code, I won't be considering the corner cases, and I there will be a lot more bugs. If I do this for enough days in a row, I'll start the day a zombie.

When playing Diablo II, I can easily spend 6 hours playing it in a row without noticing that my skin has gone pasty-white and I've ordered my second pizza ;) I may not be as intelligent towards the end, but the game is nowhere near as demanding as programming and it really doesn't matter.


At work I structure my days by doing the difficult coding problems at the start of the day and then doing progressively easier things or stuff I know by rote.

Ideally I'd be updating documentation, running some tests, organizing a project at the end of the day. Although it rarely goes like this ofcourse.

If I run into a nasty problem when I'm way past my daily mental peak and there is time I'll just wait for the next morning. Experience has shown that nine times out of ten I see the solution the next morning so I won't be wasting time on it.


Same.

I think the key here is persistence. Recently, it took me over four days to solve a certain 3D animation problem. It was frustrating when it wasn't working, but because I threw all of my spare time at it, it eventually got done, which is very satisfying.

I don't know how to want to be persistent. I just am. Getting started each day is usually the hardest part. If I give in to the temptation of playing a game, it's almost a guarantee that I won't be getting anything done for a few hours, if at all.

It helps a lot to be very interested in the problem domain. If you're avoiding a task, try re-framing it to make it fun. For example (I'll use a gamedev example since that's my field), instead of writing a way to play a 3D animation, write a way to blend between a bunch of different animations simultaneously, then play the result. Sure, it's more challenging, but it's also more fun. That kind of "re-framing" is very valuable.


I think that your first step in becoming "addicted to programming" is understanding what building stuff really is: intense sprints of orgasmic discovery separated by long periods of building the prerequisites. Once you understand which phase you're in, you can better understand why you feel the way you do.

A perfect example was my project last week. I had to make 14 changes (including 3 major structural reworks) to an existing application to produce one additional output. This output was key for a fundamental shift in thinking about the use of the app.

My week was actually fairly predictable:

Monday was fun for a while, thinking about how it would work, what needed to be different, how the data has to be restructured, and how cool the new results would be. But things became drudgery when I had to lay everything out build my work plan.

Tuesday sucked, tearing apart code while trying to maintain an audit trail and balancing the new functionality with keep everything old still working.

By Wednesday, I didn't even want to work on it and spent a lot on time on hn, playing games, and surfing the internet. I struggled getting the final pieces in place.

On Thursday, my interest piqued when regression testing went almost flawlessly. But no matter, even if it didn't, being in "getting it to work now" mode always captures my attention.

Friday was bliss. I was cranking code, unit testing, regression testing, reworking, getting the results I forsaw on Monday, and doing a happy dance every 20 minutes or so. Time flew as I worked into the night getting all this cool stuff working. I wish every day could be like Friday, but I needed to pay my dues earlier in the week just to get to that point.

I wish I had an easy answer for collapsing the long hours of building the prerequisites and expanding the time spent "in the zone". The only suggestion I can make is get to the point of having something for output as early as possible. That's when the fun usually begins. Until you reach that point, just understand you're in "courting" mode. Just keep on working and the digital orgasms will arrive. Once they do, it'll be worth it. Don't worry, you'll be "addicted".


I guess this is one of the best descriptions of my own "hunting" habits. It is amazing to me how hacking/making seems so similar to the kind of persistence hunting that our ancestors used to depend upon (http://www.youtube.com/watch?v=826HMLoiE_o). As I meditate more about these traits and my own struggles with ADD/bipolar tendencies, it is becoming clearer that most hackers are indeed "hunters in a farmers' world".


I wish I could give you more than one vote - that's one of the most insightful comments I've read on here.

(NB I've always been fascinated by prehistory and how our ancestors experiences shaped our own behaviour).


If you really like it, please have a look at http://ngm.nationalgeographic.com/print/2009/12/hadza/finkel.... This has taught me more about hacking and life than most books I ever read. I believe pg was on the right track with the "Hackers & Painters" thing, but we are not only makers, we are actually the descendants of the original pre-historical hunters.


Have you read this?

"After the Ice: A Global Human History 20,000-5000 BC"

http://www.amazon.com/After-Ice-Global-History-000-5000/dp/0...


Not yet, but it is definitely worthy a look. Thanks for the link.


I don't like the "addicted" metaphor. I think he's really saying that he wants to get into flow.

http://en.wikipedia.org/wiki/Mihaly_Csikszentmihalyi#Flow

Flow happens when you have high skill and are attempting things at the limit of your ability. The little mental rewards for achievement come quicker and propel you to the next step.

So the unfortunate truth is that he's going to have to spend a lot of time practicing and honing his craft, before he can truly get into flow. Perhaps it's better to try mastering simpler tools and simpler tasks and iterate from there.

There are programming methodologies that help you get into flow. Extreme programming is a silly name, but pairing with someone else really does help with focus. Also, building a skeleton system with lots of dummy classes or functions and "filling in the blanks" can feel extremely rewarding. A test-first practice can also help, where you set up lots of tests that all fail and make them pass, one by one.


> I left my job for a tech company and took a job as a barista at a Starbucks.

I can second this, although I don't know if I could make the choice to do it voluntarily. I was unemployed a couple of years ago and working full time hours at Tim Horton's serving coffee. I found it really exhausting, both physically and mentally, and then when I got home all I wanted to do was program - I think I would have had to force myself not to do it. Maybe it's even something about being around the smell of coffee all day too!


Sometimes I fantasize about doing this. I've been unemployed and tried to make things happen, but days spent alone in front of a computer really depressed me. My current job is about as awesome as a job can get, but it's still not really my own ideas...

It seems to me I was most enthusiastic about programming when it wasn't my "real" job. Maybe I just want to recapture those days.

Also, I had no idea how ignorant I was, which certainly helped.


Interesting discussion. My answer would have been the classic one: work on a tiny sw project of your own choosing, totally not related to work and on something that you find really cool. Then, start a bigger one.

That being said, I think his attitude of "If I can get hooked on programming like I am on gaming, I'll be in heaven" is totally wrong. You should know that there are other things in life. Read the classics. Fall in/make love. Learn how to make something with simple tools. Volunteer. Repeat.


I agree. Have always had difficulty just "learning" programming languages. But when I try to make small web apps using scripting languages, I've had far more fun...I'm just going to learn the tricks needed, but none of the really advanced stuff.


In my case, it's all about getting into the computer science rather than "programming" per se. I love reading papers and articles related to the problems I'm solving and then working out if they'd help me. Taking sloppy O(n*n) algorithms I've bashed together and getting them down to O(n) - or whatever - is very fulfilling.

This might just make me weird though ;-) I guess I like to think I'm working towards actually making an academic contribution to the world one day, rather than just doing something to earn some money - that's a big driver for me in terms of life ambition.


In lieu with my goal of learning algorithms, I've found all these great sites that provide programming puzzles for people to solve. Your submissions are automatically ran against a system judge for correctness. For instance, topcoder.com.

This is great. This sort of thing is very similar to a video game - I try to get high scores, and I can mark off the problems I've succeeded to see how well I'm progressing. Just yesterday, I think I spent a good 4 hours in flow while working on a problem. I barely noticed what was going on in my surroundings at all. It was awesome.


Could you list off those sites? Besides Topcoder.


http://www.spoj.pl/ is a good multi-language site.


train.usaco.org is a great one, and the one that I'm currently taking the most seriously. Other than that, I have set this page: http://www.algorithmist.com/index.php/List_of_Problemsets to my homepage. I don't think you will ever run out of problems there. :)


I find that I'm very addicted to writing code when it's just you and your language of choice.

The difficulties in motivation start when I hit something 3rd party that I don't know very well.

There was a productivity tip on HN a while back about how you should always walk away with something incomplete so that it's easy to come back to. You know exactly what you need to do next.

But when coming back to programming means spending another hour or so reading documentation and playing with settings until it works, things get a lot more difficult I find.


I dont mean this to be patronising, but this is less to do with code and more to do with a work motivation. Let me explain.

Every day is different and some days I code because I love it, some days because Iam good at it, and some days I absolutely hate to code. Regardless of what mood I am in I think of the money....code pays my bills, I use this fact to focus my attention ;)


The easiest way to get addicted to programming is by creating something that you think is cool.

Let the ego trip begin and soon enough you feel like a god.

Once you feel like god, you are addicted. Hopefully, you can live in denial as long as possible until the real world decides to kick you in the ass.


I started out programming on an Acorn ATOM 2k+2k, upgraded to something like 12K total, which gave 'hi-res' graphics, and wrote little games I used to play myself.

There's really nothing quite like the joy of having a simple game come together and be fun enough that you play it yourself. Here's one I did in java. The source is available!

http://jonathanwatmough.com/jplanetoid/ptoidApplet.html

Of course, I write bigger programs now, but the same joy of getting something to work should always be there. If it's there, it should shine through in your code and UI, and people should love your software. Make people happy.

Just as an example, today's task that I got done, I managed to move some audio streaming code onto its own thread and get vastly improved performance in the UI of an iPhone app I'm building. It's just sooo addictive when a plan comes together!

And one other thing. Pick a programming language to write in that is fun and powerful enough to be addictive. Clojure is a wonderful language, and so is Objective-C. Both have enormous power, yet are relatively easy to write once you have the basics down. Many people will say similar things about Ruby or Python, or hacking things together in Perl. The important thing is to pick something where you say 'just 5 more minutes on this'.

Then you're addicted.


I think that video games or movies are so moving, that everything else in life seems fade.

That's why they're so addictive, because they're so much "more" than reality.

The only solution is to reduce the consumption of them. Than reality will "bloom" again. I have been there before.

Unfortunately I'm currently again on the other side, and I know hard it's to reduce it.

Edit: The funny thing is, that reducing them makes them again more enjoyable.


You have to inject the drug properly :) From what I understand, a lot of the rush in problem-solving comes from release of dopamine, and dopamine itself is the fuel for problem-solving.

So start slowly, solve a simple task, then ride the dopamine levels upwards by solving more and more, until you hit the flow.

Although, I do not understand why would anyone want to get addicted to programming. Trying to have something that can earn money while getting you high naturally is one thing, trying to imitate successful addicts in hopes of huge success is a cargo cult.


How about a game that requires that you solve typical programming problems at certain points? addictive most of the time, but then get 5 or 45 seconds to solve a real problem.


When you're in the flow, you're addicted and everything else becomes second. It's just that lots of grunt work is the prerequisite for getting into a good flow.

So the answer is that you can't get addicted to programming even if you wanted to but occasionally you will even if you didn't want to.


Three basic principles of motivation: mastery, freedom/control, and purpose. Game is all about the mastery of the well defined rule set in an artificial environment with player-controlled actions to achieve well spelled out goals. Now just work that into programming.


Try to program a game maybe?


Coding a game is polar opposite of playing one. You might not even like video games after you're done.


Not in my experience, but it probably depends on the type of game.


Kill your television.


Forget all this complicated thinking and work hard crap, why has nobody suggested the Ludovico technique?




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: