

Why is programming fun? - signa11
http://www.grok2.com/progfun.html

======
michaels0620
I remember early in my programming career, I had a program that was a tangled
mess and making changes was requiring more and more effort just to keep
everything straight. I was able to refactor the code into three well
contained, clean modules. I distinctly remember the sense of satisfaction I
got from that. I imagine it is similar to the satisfaction a wood worker gets
when everything is just right. Not joy per se, but certainly a sense of
satisfaction.

Another programmer at work explained to a non-programmer why he liked
programming by comparing it to cross word puzzles or sudoku. Again, it isn't
that cross word puzzles are a joy so much as it is interesting and satisfying.

------
conanite
I bet the pleasure in finding a new way of looking at a problem or a solution,
applying an old solution in a novel way to a new problem, or learning to
understand new concepts - recursion, tail-call-optimization, metaprogramming,
(or whatever cool thing your next language does) - is neurologically similar
to what happens when we "get" a joke. New paths are traversed in your brain
and you giggle like you did when you first figured out how to put two lego
bricks together. For me, anyway, programming is just a grown-up version of
playing with lego.

It's true though that in a corporate context, you are dealing with _other
people's bugs_ , policies, procedures, documentation, specifications. Most of
that isn't programming, even though non-programmers can't always tell the
difference.

Even after an attack of debugging, when I've figured out what the problem was,
and reconstructed the thought process that led to the code that led to the
bug, there's a spark of delight when my brain creates this structure. The
debugging may be joyless, but not the fixing.

------
almost
Among other things I think it's the huge rush I get when I figure out
something hard. Can't be beat :)

Then there's the satisfaction of imagining a system and slowly putting it
together. The exhilaration of a new program. Problem solving at different
scales. The anticipation of a finished application. All good.

Not to say it's _all_ fun _all_ the time, but I don't need to be paid to want
to do it :p

------
glymor
This is nice but it's also nonsense.

Nether a program nor a poem is easily tractable. A change in one place
requires rebalancing elsewhere. We try and minimise this with interfaces etc
but it's never _"so flexible, so easy to polish and rework"_.

Snowflakes and leaves are not each designed.

The minutiae of programming couldn't really be more repeatative.

The _"pleasure of making things that are useful to other people"_ only happens
if you project isn't cancelled and actually gets used. Outside of a startup
this confluence of events is heartbreakingly rare.

I'm not against writing poetically but this is more Wordsworth than Tennyson.

~~~
10ren
_Tractable_ compared with non-thought stuff - try reworking wood or metal. But
you're right that it's impossible to eliminate all dependencies, and a large
interdependent structure becomes tedious, and scary, to change. "Throw one
away", Brooks even admitted (if you can.)

Alan Turing predicted that programming need never become boring because you
can automate the mechanical aspects. If it really _is_ repetitive, you can
automate it.

One can also make small tools that are useful to others. e.g. I got a thrill
even from a trivial script to automate away a tedious step, when other people
used it.

I don't believe in a personal god but I respect people, like Knuth and Fred
Brooks, who do. If they think a tree is designed, I'm happy to think of the
intrinsic beauty of a tree - and of all nature. I couldn't make any of it.

It's surprisingly renewing to spend some time in nature.

~~~
glymor
Perhaps I wasn't clear. I wasn't refering to whether God designs. I was
refering to the differences in each snowfake or leaf being of random source
that is what I meant by "each".

~~~
10ren
Oh, you mean they aren't individually designed (without commenting on whether
the process that generates them is designed or not); and the variations in
each one (that snowflakes are the canonical example of) are just random
fluctuations. The beauty comes from the process, not the randomness. I see
what you mean.

I think taking a personal God point of view, one would say that those random
fluctuations are not random, but designed; just as each individual person is a
real textured thing. Every individual is more than a mere variation on a
platonic theme. My own tendency is think that when we don't understand
something, it's easiest to model it as random; but whether it really is random
is something we don't know. So I'm with Einstein in the "god does not play
dice with the universe" on this one.

BTW: on a separate note, I'm concerned about you. Having a project canceled is
very distressing. The last time I heard someone talking like this (an editor
at my publisher, who just had an important proposal knocked back), they
committed suicide a couple of weeks later. I sensed something was a little
odd, but I didn't do anything. Please, if you are feeling low, ring one of
those suicide helplines. I'll be very relieved if you do (or if I'm
ridiculously off-base, even more so).

------
edw519
There are only 2 things that make me jump up and dance spontaneously:

(a) when a great song comes on in a dance club and I'm with a hot date

(b) seeing something I've just written work for the first time

I don't know if I'm bragging or complaining, but lately, I get a lot more of
(b) than (a).

~~~
jcromartie
> seeing something I've just written work for the first time

When some large piece of fresh code works on the first try, I call this a
"hole in one" :)

~~~
blhack
Best "hole in one" I ever had.

(I am not a programmer, feel free to submit this to the dailywtf, or coding
horror, or make fun of me and call me ugly if you want to).

There was a huge huge huge file that I was trying to run a perl script
against. The [text] file was about 3 million lines long. What my perl did was
split it out into a CSV file so that I could actually _work_ with it (the
person sending to me sent it as a space delimited file that didn't really
follow its own specs, or have any explanation about what was going on...blah
blah, it sucked)...

Anyhow, my perl (stupidly) was doing:

foreach $line (<file>)

{

do_something;

}

The problem was that it kept coming back with an out_of_memory error. The
other problem was that it wan running serially (is that a word) on an 8 core
box....it would peg one proc with the perl, but the other 7 would just sit
there being lazy.

My (very hackish/duct tape) solution was to split (which should have been a
big hint) the file into 8 pieces, then call the perl for each one of the 8
chunks...8 cores, 8 threads...should be full of win, yah?

I used wc -l $filename to find out exactly how many lines were int he file,
and then gave my new perl script that as the number of lines for each file.
The new script did something like:

foreach $line (<file>)

{

print FILE1 $line;

}

(there was a couple of if statements so that after it hit $num_of_lines / 8 it
would go to file2 file3 file4 etc.

After that mess was all finished, it would call a shell script that did:

magicscript file1 > file1.magic &

magciscript file2 > file2.magic &

etc. etc. etc. until it was done, then it would do

cat *.magic > fixedfile

which I could then work with...

I put all this into another shell script that did

echo "FULL POWER TO MAIN DEFLECTOR (this could get messy, look out!)"

perl engage.pl

by some miracle it worked on the first try!!

I have since fixed this mess of code. At the time it was a "we don't have time
to do it right, just DO IT!" moment, so...whatever :).

------
shaunxcode
For me it is the challenge and mental exercise of creating something from thin
air which is both elegant and succinct (somewhere between code golf and SICP).
I love coming across domains/problems/ideas which truly have not been
solved/solved best and conjecturing ways to approach it. Something about that
just makes me feel ALIVE and excited - like keeps me up at night and dreaming
in syntax excited.

One of my latest projects has been simply an sql -> awk (and other unix tools)
parser so I can use sql instead of native awk imperative programming. It took
me all of an hour to whip the perl script together but when it was working
with inner joins on flat files I was like "woah sweet!".
<http://aql.googlecode.com>

------
parenthesis
In a nutshell, I find programming can be immensely satisfying because it can
be simultaneously a very creative and a very technical pursuit.

I find I need to be creative and technical. If I'm doing a lot of the one to
the exclusion of the other, I start to crave the other. At the best of times,
at least, programming gives me enough of both.

------
hamai
I like programing, but it gets me bored real quick. Sometimes I think its the
keyboard... I wondered about mouse programming for a while but then I got
bored again.

~~~
jlees
I hear you can program with Legos now.

------
hs
i like it because there is no physical limitation and raw materials involved
for creating something

network programming nullifies the distribution constraint

to me basically programming is freedom (no constraint, insane leverage)

------
sho
I don't think programming is "fun" per se. It's merely the means to an end for
me. It's certainly satisfying and rewarding in numerous ways to create new
things, but I just spent 8 hours debugging and refactoring Javascript and let
me tell you "fun" is not the first word that springs to mind to describe the
experience.

Why does everything have to be "fun"? An activity can be good without being
fun. Many of the best things we can do as humans are not fun at all and yet
undeniably a good use of our time. I learnt the piano for 20 years and not a
single one of the scales I played was "fun". I know an athelete who gets up
every morning at 6am to run for an hour, rain or shine. She doesn't do it
because it's fun, she does it because she wants something, and that's the way
to get it.

The end result is when we receive our deferred payment for our labours, be it
being able to play any song we can imagine, run a triathlon, or admire our
sparkling new web app. Whether the process was "fun" or not doesn't really
enter into it. In fact, wilfully choosing to do things that aren't fun in
pursuit of an abstract or distant goal is a hallmark of adulthood, IMO.

I'm not saying I don't try to make the process as enjoyable as possible, of
course. Just that I don't think programming is innately fun, nor do I care
that it is not - one does what needs to be done.

~~~
cubicle67
Am I the only one here who derives a considerable amount of joy from the act
of writing code?

I've worked across a wide variety of languages and environments, including far
more Access VBA than anyone should be exposed to (I loath Access more than any
other environment ever), and yet, even here I love writing code. There's
something amazingly zen about it; I _am_ the machine, corny as it sounds. It's
where I am at peace.

I don't know how to respond to people who see coding as merely an end to a
means, except to say that that may be true for you, but for me it's far far
more.

~~~
visitor4rmindia
Same here - I enjoy programming. I'm passionate about it. I can relate very
strongly to the OP.

I program because I want to - because the very act gives me joy. I'm not crazy
about debugging but it's a part of my craft and I even enjoy it sometimes.

Sometimes, I still can't believe they pay me to do this!

~~~
blhack
I love debugging...I even [sometimes] love debugging other people's code...

Its a bit like being a kid, and going out exploring in the woods, or trying to
figure out where your parents hid the christmas presents. Everything is new,
and shiny (with other's code)...its fun seeing how other people do things...

That and it is a puzzle. Doing stuff in the "real world" is boring,
predictable. Doing stuff in code is fun. There are no "rules" really. The only
limitation is how much yerba matte I can consume.

~~~
benmathes
I like solving puzzles based on inherent complexity -- complications that
arise in the data structures and algorithms of a piece of code. Any time spent
fixing complexity layered onto the minimal complexity by confusing or poorly-
factored code sucks.

For example: I enjoy solving a performance issue by introducing a time/space
tradeoff. I do _not_ enjoy fixing a bug where a previous coder (maybe me)
misspelled a variable name once in a 6000-line function -- that's just
cleaning up a mess, not problem solving.

------
c00p3r
Man-Month is great book. Kent Beck's Extreme Programming Explained is the
second one. But those are mostly about management of software projects.

If you want to learn how to write good code you probably should read about how
to write short stories and even Dale Carnegie's Speaking For Success.

They are really useful.

------
erlanger
Because it allows you to do a lot while moving very little.

