

What makes programming so hard? Can non-programmers invent algorithms? - nickb
http://www.amazon.com/gp/blog/post/PLNK2DYCU7ANMP5E6

======
Hexayurt
And organic chemistry isn't hard?

Programming is a _profession_. Professions are hard. That's what makes them
professions.

If it was easy, then people would just do it as part of other activities, and
there would be no specialization worth of the title profession. We don't think
of typing in URLs as a profession, or spell checking documents, but we do
think of graphic design or architecture as professions.

Programmers are operating close to the limit of human capability, just as
other professionals are. Only a few people can do it well because it's a
talent which is unequally distributed, just like being able to draw.

As for why this particular activity pushes that limit? The hardest part of
programming is building mental models of non-existent objects which have no
natural analogs. It's dealing with the "virtual."

~~~
mdemare
Teachers are operating "close to the limit of human capability"? Farmers?
Policemen?

Some professions are just more natural for people - programming on the other
hand is fairly unnatural.

------
tx
Its all about motivation. 20% of his students genuinely _wanted_ to know how
computers work. They were naturally _curious_. Curiosity is what drives an
educational process. Good teachers try to get children curious, fascinated by
something, and then very effectively explain how the phenomena works.

I hated physics in middle school, but in high school I got lucky and met the
most amazing physics teacher the world had seen. That changed not only my
grades, but my perspective on technology, world and life.

------
amalcon
Part of the problem is that we usually teach in procedural style -- but this
requires learning the MOST abstractions to do anything useful. Procedural
style is based on variables, loops, conditionals, and side effects. Functional
style is just based on function calls and conditionals; this makes it far
easier to explain.

A larger part of the problem, I suspect, is that people are just _not
interested_ in the process of programming -- it's the product they want. The
first thing you'll notice when you try to teach someone to program (in the
normal case) is that they are focused to a fault on making the program work.
This is the same problem that keeps people stuck to a single language: "well,
it works." You need a genuine interest in the journey, not just the
destination, to really be able to wrap your mind around the skill of
programming. That's what gives someone the ability to intuitively understand
how computers "work."

You wouldn't try to drive cross-continent if you're only interested in what's
on the other side -- you'd just fly there, or take a train or bus or
something. Likewise, if you're not interested in _how_ a program does what it
does, you should just pay someone who does care to do it.

~~~
eru
Who needs conditionals? ;)
<http://en.wikipedia.org/wiki/Church_boolean#Church_booleans>

But really - I agree. Functional programming is easier to explain without
resorting to all sorts of helpful lies. At the university I am helping
freshmen learn C.

------
mdemare
Learning to program means mastering lots of new abstractions, becoming
comfortable with them, and being able to use them. And I know that if I
encounter too many new abstractions at a time, my mind simply shuts down. This
happens each time I try to learn Haskell for instance. I'm following a
tutorial, and suddenly I encounter this:

    
    
        parseNumber = liftM (Number . read) $ many1 digit

And then I've hit a road block. This can be solved by better teaching
materials. Most education in general is simply bad and terribly inefficient
compared to what it could be (but I'm working on it...)

Another thing is attitude. Everyone programmer encounters really hard or
confusing problems all the time - the trick is being really stubborn, and
never give up. That doesn't come naturally to most people.

Finally, most things we learn, we learn by imitating others. Our brains are
hardwired to learn that way, but it's not very helpful for learning to
program.

~~~
cowmoo
"Finally, most things we learn, we learn by imitating others. Our brains are
hardwired to learn that way, but it's not very helpful for learning to
program."

I would like to disagree (respectfully). Although in most CS programs,
algorithms and PL classes tend to be heavily proof-based and end up being
exercises in tedium. As a TA for a intro. programming class, I would like to
present the latest problem-set to students as some kind of narrative, sketch
out what makes the problem interesting and the natural flow of the program
structure that follows the problem, that comes spontaneously to the mind. So
in a way, people are learning by imitating/doing, and not grinding out the
hard theory first.

Honestly, I don't think everyone here learned for the first time about loop's,
as according to proving that loop variants hold on during the iterations; or
convinced themselves the way that various data structures work, by way of
category theory. You learned it by doing, and you know that it just
intuitively works. While functional PL is harder than Java, I think it works
the same way; you change the way you think and in turns, the way you program,
by doing.

~~~
BrandonM
Maybe that is one thing that makes CS more difficult than other areas... that
you _must_ learn by doing. We really are hard-wired to learn by imitation (as
the original commenter said). That is how we learn language, social norms,
etc. CS, however, is definitely something that you need to learn by doing.

Interestingly, that may also explain the idea of "computer geeks". If CS
selects for people who learn by doing instead of by imitation, you are more
likely to see those types of individuals. If social norms and social
interaction is learned by imitation, those are abilities that are harder to
learn for someone who is more inclined to learn in another way.

------
brlewis
Some people are good at constructing mental models from a symbolic or
linguistic description. Most need help constructing the mental model. That's
why Montessori math education includes so many hands-on materials.

DrScheme has a stepper that helps visualize expression evaluation. I think
that can go a long way toward helping "non-programmers" learn.

~~~
majimojo
I like the mental model description. I think programming (like other skilled
arts) requires constant evolution of programming mental models or memes.

Developing new languages is a great exercise in creating new tools to solve
specific problems. Rails really kicked the status quo and made programming so
much easier for a bunch of us. But is it possible to ever create a language
that will make all the different kind of programming problems equally easy? It
always seems like there is a tradeoff, programming abstractions vs
performance. As another case, all of us know english, but how many of us are
great writers? (not I! haha)

Great link though. Look forward to the day when game programming is as easy as
brainstorming out loud to our computers.

------
cstejerean
Personally I think there might be something genetic. The same people that get
computer science are good at a lot of other things that folks that don't
understand programming don't seem to be great at. Look at Calculus or Physics.
20% of the students just get it, most of the class needs to memorize formulas
and 20% of the people just don't get it at all.

~~~
german
I think it's not about Calculus or Physics, it's about Logic.

~~~
karzeem
Exactly. Algorithms are simply ways of approaching and solving a problem, and
the ability to devise clever ones is portable between disciplines. At my
college, several professors in the CS department hadn't programmed anything
since the '70s.

The balkanization of science and liberarl arts is probably the worst thing
about university education today. The unwillingness of either to import
valuable concepts from the other ends up hurting both.

------
amichail
The best programmers are generally those who have learned it at a young age.
Maybe that's the best time for the brain to pick it up.

