Live data from Hacker News

Is learning to program inherently hard?

computinged.wordpress.com

21–30 of 69 posts

Re: Is learning to program inherently hard?

#21
I've said it before, and I'll say it again. In my experience, the problems that students have ultimately fall into one of two categories:

1. Learning to think algorithmically; 2. Abstraction.

What do I mean by these? By "thinking algorithmically," I really mean "taking a large problem and breaking it up into an ordered series of steps or sub-problems." This is surprisingly hard for a lot of people, in part because the correct "size" of steps or sub-problem can change from problem to problem and from language to language. This can absolutely be taught, though. Some students have an easier time of this than others, but eventually (in my experience) they all get there in the end, and develop an intuitive sense of how to do it... at which point 99% of people immediately "forget" what it was like to not be able to do it, and become incapable of recognizing and dealing with students who haven't gotten there yet. :-) Most programmers (myself included, at least until my dozenth or so student, at which point I figured out what was going on) fall into this category: thinking in this manner is so deeply imprinted into our cognitive processes that we typically have a very difficult time visualizing what it's like to not be there. We're sort of like fish and water, if you know what I mean.

The second problem is much more difficult to address. Abstraction is one of those things that, I'm convinced, some (most) people can "get" and others simply can't. For example, I've had students who seemed to understand arrays perfectly, including the idea of using an integer subscript to refer to the value at an array index such that if you showed them the following code:

myList = ['monkeys', 'elephants', 'giraffes'] print myList[1]

they'd easily tell you that it would print 'elephants' (yes, they can usually get their heads around zero-indexing without issues). If, however, you showed them this code:

myList = ['monkeys', 'elephants', 'giraffes'] idx = 1 print myList[idx]

a lot of them would be more than a little bit lost. Even worse would be if you showed them this code:

for i in [0, 1, 2] print myList[i]

They'd be really lost, then. Even if you walk through it line by line, with lots of extraneous print statements, there is a certain sub-type of (otherwise perfectly capable) student that just isn't gonna get it. I'm convinced that this problem--- lack of abstraction ability--- is also why so many students have problems with loops. Dealing with loop counter variables (and the things that you usually want to do with them--- array indexing, printing, doing math, etc.) is very hard if your brain isn't able to think in this abstract manner.

It's worse in Java than it is in Python, just 'cause there's so much more code involved (meaning that it's harder to pinpoint exactly where the confusion is coming from), but the problem totally persists even in sane teaching languages. I've talked to a lot of other CS educators who've noticed the same thing- no matter how you approach it, this level of abstraction is just beyond some students' reach. It gets worse once you try and teach them about object/class distinctions, and so on. It's not that they're stupid- my students are usually MDs working on their masters' degrees. It's just that some people's brains don't work that way. And it's not that they can't do other computer stuff- some of these students have gone on to become pretty good at SQL and even relational data modeling, which you'd think would use some of the same cognitive patterns, but apparently is different enough that it's doable.

I don't know if the problem would be better or worse teaching with a purely functional language; my gut says "worse," but I haven't tried it so I don't know, and the fact that many students with this problem go on to handle declarative languages pretty well gives me pause.

Re: Is learning to program inherently hard?

#22
post #2

Is learning to ride a unicycle hard? It is if you don't have inherently good balance. Is linguistics hard? It is if you don't have a good associative memory. Is math hard? Is carving a wooden bowl on a lathe hard? Is pro-Hockey hard? Is sculpture hard? Metal working? Philosophy? Music? The percentages of people with specific inherent skill sets will vary widely in society, so 'hard' is best defined as 'requiring a sk…

Forgive the pedantry, but riding a unicycle is not difficult even if you have bad motor coordination.

I'm fairly janky in terms of my motor skills and learned to unicycle in a week or two. It consists of hacks, concepts, and fundamentals just like most seemingly complex tasks.

Re: Is learning to program inherently hard?

#23
Programming is probably as challenging as any other intellectually demanding task, but it does have one advantage to other skills: it can be done fairly cheaply. It doesn't require any sort of capital investment other than a cheap netbook (or someone could probably even learn on machines in the library), there are tons of high quality tools and tutorials out there that are completely free, and there is a large community of people that are very accessible and actually like helping other people.

Re: Is learning to program inherently hard?

#24
I found programming WAY easier than learning the guitar. 'Course I was 13 at the time, and the latter involved "practice". Practice was boring, yet learning things like ASCII, how to toggle a PDP-8, Hammurabi, ... Those weren't "practice".

As everybody knows, doing what you like to do is easy. Doing other stuff is not.

Re: Is learning to program inherently hard?

#26
post #9

Programming is like most things in life: hard if you have no affinity for it, much easier (but not necessarily easy) if you do. I see programming to have a lot of parallels with being a combination mechanic and automotive engineer. A mechanic fixes cars, diagnoses problems, tunes a car and so on. It's really a lot like (code) reading, testing, debugging and maintenance--all key programming skills. An automotive engin…

I would be useless as a mechanic.

90% of being a good mechanic, just as 90% of being a good programmer or a good doctor, is debugging. If you're a good debugger, you can damn well do anything.

Re: Is learning to program inherently hard?

#27
I think what makes programming particularly hard is that there is such a large space of possibilities. There's pretty good research out there that people flounder when there are too many choices. When I was first starting out I remember being paralyzed by that; I could think of several ways to write this one algorithm, and how did I choose? What helped was learning about efficiency in programming, simply because learning "best" practices was a way to limit the space of possibilities.

There are, of course, parallel examples of open problems- writing a novel is much the same way, I think. And I think most would agree that writing a novel is also hard. And doing original research also falls under this umbrella.

Re: Is learning to program inherently hard?

#28
post #24

I found programming WAY easier than learning the guitar. 'Course I was 13 at the time, and the latter involved "practice". Practice was boring, yet learning things like ASCII, how to toggle a PDP-8, Hammurabi, ... Those weren't "practice". As everybody knows, doing what you like to do is easy. Doing other stuff is not.

> Practice was boring, yet learning things like ASCII, how to toggle a PDP-8, Hammurabi, ... Those weren't "practice".

I get better at programming as I do it more. I think you're correct that individual knowledge points aren't "practice" per se, but practice definitely factors into skill over time. Just like I imagine it does with the guitar.

Re: Is learning to program inherently hard?

#29
post #9

Programming is like most things in life: hard if you have no affinity for it, much easier (but not necessarily easy) if you do. I see programming to have a lot of parallels with being a combination mechanic and automotive engineer. A mechanic fixes cars, diagnoses problems, tunes a car and so on. It's really a lot like (code) reading, testing, debugging and maintenance--all key programming skills. An automotive engin…

You can still get rapid feedback with a computer simulation tool for automotive engineers (of which I have no specific knowledge, though!).
Post reply on HN