Fog Creek Software
Discussion Board

What makes you a programmer

In , Joel talks about his computer science class, where suddenly almost everybody dropped out when they started talking about pointers. "For some reason, some people just do not seem to be able to write code with pointers in it. They were born without the part of the brain that does indirection, I guess."

So, I work as an instructor for a web-training company, and wanted to know if anybody else knows what hes getting at here.

Its something I see a lot. We get students who are really smart and organized, and then all of a sudden, something mysteriously doesnt connect for them, and they are unable to advance in our program.

What do you think programmers have in their brains that regular people dont have or cant access?

Tim Boucher
Monday, March 11, 2002

I think good programmers are able to suspend belief and/or judgement temporarily. They might not 'get' pointers at first, but they're willing to play along, listen to the instructor, see what he's using them for, and then revisit the original concept with a bit more context.

Pointers are not hard to understand, but I think most people are scared and intimidated when they're first introduced. It's usually the first abstract concept they come across in a programming course, and there isn't always a clear need for them presented. Their brain just shuts down and they can't get beyond that point.

Darren Collins
Monday, March 11, 2002

Good question.  I've found that even the simplest tasks are beyond me, however I consider myself to be an above average programmer.  For example, my girlfriend has to sort our clothes on laundry day because I find the seven different classifications of clothing to be too difficult to remember, but I am able to hand write JNI header files from memory.  Go figure.

wyoming johnson
Monday, March 11, 2002

I can think of a couple of possibilities.

It may be that most people have trouble with logical abstractions.  I recall from various math classes that even fairly advanced students would get confused on the idea of "necessary and sufficient" in doing proofs.

Another possibility, which I consider more likely, is the size of the conceptual increment.

Anyone who has had algebra has learned the concept of a named variable having a value.  There is some initial confusion learning that x = 0 is an assignment, not an equation.  But it's not a big jump.

Now say you tell your students about pointers: int *px = &x;  Now they not only need the concept that x has some value, but they need computer architecture and the idea that x exists somewhere in the machine.  Whether that is easy or hard would depend on how much the student learned in computer architecture class or whether they even took it.

When I went from programming in FORTRAN to C it was an easy step because I also programmed assembler and had a reasonable idea about computer architecture.  Making the transition from C to C++ was a bigger step and I had to spend a bit of time studying the concept of object oriented programming before getting it.

Monday, March 11, 2002

The difference is how they respond when intimidated. The great programmers keep at it. They are willing to kick at a problem for 14 hours a day, go to sleep, and come back the next day. They see pointers and go "wtf? lemme read some more!" (and then do so).

Then you get the people you talk about: "It hurts to think about so many asterisks....!?". Needless to say, it's obvious that they don't get stuff.

An example: in many CS classes, you ask one person how to do X, and he'll talk through it out loud. That's the programmer. The other person you may ask, says "I have no idea whatsoever". Except, that's not so: he has an idea, almost always: Maybe you need a loop? Well there's half your code, you sure know a lot for 'no idea'!

The difference is that programmers don't give up. We're a stubborn breed of bastards that will consult a book or the web when we don't know. Or write what we DO know and work off of that. The gurus don't magically know more: they just never give up when they DON'T know something. That's the difference.

Mike Swieton
Monday, March 11, 2002

I think that one of the necessary qualities to be a good programmer is to be ability to think through an idea in a specific mental context and to be able to freely switch contexts.

Take pointers for instance. I suspect that one of the reasons that many people have initial problems coming to grips with pointers is that they first encounter the concept within the context of the solution to an programming problem. For example, they are thinking about how to swap characters in a string - there mind being full of which position to swop with which. In this context, it is hard to make sense of pointers. However, once you start thinking in the context of how a computer works, ie a cpu and addressable memory, and remember (or learn) that a variable is just an address to a piece of memory, it is much easier to understand pointers.

A (gross over) simplification of the mental process involved in writing a program is :
  Grasp an idea in the context of the problem
  Switch context to that of the solution
  Translate the idea to the terms of the solution
  Switch back to the problem context
  Check the problem is properly solved

I think that the ability to switch mental contexts whilst holding an idea is needed by a programmer.

Peter WA Wood
Monday, March 11, 2002

On pointers-I'm self-taught-and the general concept of pointers weren't that difficult, it was implementation in code that generally stumped for a while.

One thing people have to remember is that modern humans have been around for 40,000-100,000 years.  We have a suite of features-but they're mostly evolved in the context of being hunter-gatherers.  We've retrofitted a lot of our capabilities to our modern lifestyle-but sometimes the fit isn't so good.

Think of things we take for granted.  Literacy is a strange development.  Humans are verbal animals.  For most of history no one was literate, and then for some of it, a small minority were literate.  Today-we simply take literacy for granted and assume that everyone should have a "basic" level.  And yet-we all know some people are better at reading & writing than others.  Some people never get beyond a basic stage of literacy-and yet things people are great things like fixing a car or what not.  They aren't dunces-they make do.  But we see them as somewhat sad because they're mental capabilities are percieved as not be up to snuff.

But the fact is a lot of the higher-level abstract thinking we humans do today is pretty strange.  Think of "civilizations" that never implemented the wheel or the use of zero.  Think of the disciplines people find "easy" and the ones they find "hard."  Many people enjoy reading and learning about history (the less academic forms) because it's not that different than storytelling-narratives are part and parcel of humanity.  On the other hand, very few people are into reading long texts on mathematical proofs. 

I took math up to matrix algebra in college.  I recieved A's in Calculus & Differential Equations.  B's & A's in the multivariate calculus courses.  And squeaked by the last term of Matrix Algebra with a C+.  I obviously reached some sort of natural limit.  Others hit the "ceiling" in calculus, and I actually know a guy that went to grad school in Math and couldn't pass his comps-he hit is ceiling in the 2nd year seminars.

As far as specifically programmers-I think it's persistance.  Computers are pretty logical-we're jsut too stupid to see it for the rational machine it is :)  And compared to chemistry experiments, the error messages that computers give back are very transparent....

razib khan
Monday, March 11, 2002

I think Mike hits the nail on the head with the stubbornness problem.

How do marathon runners become marathon runners?  By getting up as 6am and running a few miles before work month in and month out.

Same with programmers.  The brain is a muscle that needs to be exercised.

That said, there will always be superstar programmers the same way there are top atheletes.  What makes them a breed apart I don't know.

Ged Byrne
Tuesday, March 12, 2002

I don't think that persistence alone sums it up very well.  I know plenty of persistent people who I'm absolutely positive could never understand programming.  On the same note, I know plenty of very smart people who are capable of advanced abstract thoughts.  Many of them wouldn't be good programmers either.

The thing that often differentiates programming is that the programmer needs to be capable of seeing both the trees and the forest.  The trees, of course, represent the details that are required to create the classes, the methods, the forms, etc, and the forest represents the vision to understand how all the pieces should fit together.  These are two different skills - detailed and abstract thinking.

Back to the original post, though, about why some smart and organized students hit a wall and don't progress.  I've hit walls several times in classes I've taken, and it's usually for 3 reasons - over confidence, cumulative mental overload, and anxiety.

Over confidence can especially happen in courses where the subject is easy.  Even worse - in classes where the first half is easy and the second is more difficult.  When you get something, it's very difficult to force yourself to sit down and memorize it.  You might read Chapter 1: Got it! Next.  Chapter 2: Piece of cake. Next.  Chapter 3: Right-o. Next. On so on until Chapter 7: Oops! I needed to not only 'get' Chapters 1-6, but I also needed to remember them.  They all seemed so clear in my head at the time, but it’s all so fuzzy now. Wish I hadn’t glossed over that homework.

Cumulative mental overload is similar. At some point in the course work, you're learning so much, so fast that it's hard to keep it straight in your head.  One day it's clear, the next day it's spaghetti.  In high school, we learned many things by rote.  For example, in high school I took the AP calculus - taking a full year to cover the equivalent of the 1st two terms in college, and the teacher would assign dozens of problems per chapter. Taking the 3rd term as a college freshman, the professor would assign a fraction of what the high school teacher assigned. So the value of learning by rote gets set aside by the constraints of accelerated schedules and class sizes. It gets you past just understanding the concepts – you own them. In the case of pointers, the concepts aren't that difficult, but when you cover pointers, arrays, pointer arrays, pointers to pointers, pointers to functions, etc. all in one chapter, there’s suddenly a lot to digest.  Usually the best way to dealt with this is to learn by rote - sit down and write simple sample scripts until it’s drilled into their heads. Good programmers take the time to write sample code as they're learning.

The last on my list is anxiety. In this case, you’ve just covered pointers, arrays, pointer arrays, pointers to pointers, pointers to functions, etc. And, the assignment is due tomorrow. And, there’s a quiz this Friday. No time to sit down and write sample scripts. I’ve got to dive into this assignment. This book sucks – what does he mean ‘it can obviously be shown that …’ – that’s not obvious at all! Pompous PhD bastard! What’s this ‘const’ sh*t? Why do they pass a reference here but a pointer there? I’ll show you where you can stick that pointer, pal. Ah, screw it! I’m switching my major to Speech and going into Sales!

So, now you know not only why students hit a wall, but also why Sales keeps quoting ridiculous lead times. Revenge.

Tuesday, March 12, 2002

Well, this intelligence thing surely helps. I mean this funny set of abilities you can measure with an IQ test. I really do not think, intelligence is as important in everyday life as some people want to make us think (in Germany we have a big IQ hype at the moment), but with programming it is essential. This does not mean everyone who is smart will be a good programmer (or a programmer at all), but I don't think you will find good programmers without an above average IQ.

What else? Stubborness and eagerness to learn were pointed out already. I agree that they are really important.

Another thing I saw in fellow students a lot which would drop out of CS was reluctancy to just try things out. Ok, I agree, there might be people out there, who can grasp all the concepts involved in programming just by reading about it or taking lectures or whatever. I would never have learned to programm that way! It was as if those kids were afraid to type anything into their editor and compile it if they were not absolutely sure that it would work. Every compiler error was like failing a test for them, I think. I sometimes tutor beginning students in CS who have trouble with programming and sometimes I would like to make them write a sentence on the blackboard over and over again (you know, Bart Simpson like), something like:

I shall not be embarrassed in front of my compiler.

I think you have to be eager to learn by experience (spelling b-y m-i-s-t-a-k-e) to become a programmer. At least that is true for myself. My apologies to all the geniuses out there who are able to do everything right the first time.

Creativity is very helpful too. I could come up with my favourite LEGO bricks theorem again. Children playing a lot with LEGO will make great programmers in the future :-) And most programmers are very talented LEGO engineers.  Many programmers I know like to play (PC-games, board games, RPGs, whatever). Maybe good players make also good programmers or vice versa.

Have fun,

Jutta Jordans
Tuesday, March 12, 2002

I can back up the Lego theory.  I loved the stuff as a kid, and the appeal of programming is very similar to the appeal of Lego.

My kid is just getting old enough to play with Lego, but he gets annoyed with me because I get to selfish with it.

Ged Byrne
Tuesday, March 12, 2002

In other jobs, I've noticed that there are people who don't grasp certain concepts.  Analogous to pointers and recursion.  I've been programming too long to remember examples, but I had the distinct memory that there were people you didn't trust with certain tasks and had to add that to your workload.

Ever know people who didn't understand certain truths about relationships?  Do some people have problems with garbage-collection in daily life, leading to overflow problems?

I don't think programming is special.  Especially since corporate programming has to do with communication.  It's just that it can be intimidating; most people don't have parents and generations in the programming biz.  Eventually, these concepts should filter into our group consciousness.

Richard Jenkins
Tuesday, March 12, 2002

> What do you think programmers have in their brains that regular people dont have or cant access?

Some linguistic ability, for example being able to distinguish the *word* "dog" for a real-life actual dog (a.k.a. maths). Mostly it's practice IMO, 10s of 1000s of hours of practice. To practice that much, emotions have to be in gear with what you're doing. Chapter 6 of the book _Emotional Intelligence_ which I'm studying describes prerequisites for "flow": you must be neither too anxious, nor too bored; mildly challenging is about optimum, step by step, acquires each technique. But later integrating the knowledge, having the right detail coming to mind at the right time: partly that's a result of having an actual problem that you're trying to solve, and partly it's just magic, what the brain does, intuition ... but again, intuition comes more easily in a certain circumstance or brain state.

Christopher Wells
Tuesday, March 12, 2002

I think the primary distinguishing trait for all engineers, including programmers, is a basic drive to improve or create things through the application of one's mental abilities.  The largest part of this is a continual quest to find, understand and invent tools (including processes).  There's another element of uncovering and exploring cause-effect chains, there's a third element of reductionism ("divide and conquer") but it all comes down to a belief that invention and problem-solving can create a better world.

This might seem to many here like a basic *human* trait, but it's not so.  Many people have no desire to create or improve anything but their own situation in what they perceive as a zero-sum game.  Others believe that improvement comes about through some means other than problem-solving or inventive forms of thought (e.g. philosophy or spirituality).  Many scientists, even, believe that improvement is a matter of understanding rather than building.  It's only among engineers and programmers that this belief in the power and importance of building things (or improving things that have already been built) seems to be universal.

Jeff Darcy
Tuesday, March 12, 2002

Might consider the way in which pointers are explained. Nobody I knew in any computer class I ever took understood until it was explained that like on a hard drive, the files you see are not physically there, they are just being given a representation for the computer user/hard drive to manipulate. And a pointer is like that.

No book or teacher ever said it in those terms or attempted too. That was just how I tutored the students. It seemed to work as long as a student could grasp the idea of abstract representation of information (variables and variable names). If a person could grasp that idea, pointers were easy.

Some people do not understand what a variable is. Therein lies the problem. If a person does not learn what a variable is (a reference to the memory space that contains information) and that the name is not the variable itself, they cannot program pointers with understanding.

Hope it helps.

Wednesday, March 13, 2002

> If a person does not learn what a variable is ...

I might try to teach pointers by explaining e.g. the MOV and ADD opcodes from Intel assembler; and then, showing how a corresponding small C program ("int a = 3; int b = a + 4; int* c = &b; int d = *c + 5;") compiles to map to those opcodes (because that's the natural sequence in which to learn them IMO) ... and then, demonstrate the *usefulness* of pointers by talking about some data structure such as a linked list instead of a fixed-length array, and/or by talking about heap as opposed to stack.

Christopher Wells
Wednesday, March 13, 2002

Man! This question is so on the mark! I do mostly web developement with PHP as my central focus. No college or anything else, so there at times have been a lot of reading and researching I've had to do that college trained guys got along the way.

However, while learning, I too kind of came to this wall where I said, "OMG, I don't even know where to start!". That was with the whole idea of db driven dynamic web sites. However, I soon figured it out and after that tackled OOP as well.

I think what did it for me was just a little taste of success. Once you begin to comprehend an area specific, you realize, "That wasn't the big deal I thought it was going to be". After that, you just keep pluggin' and learning whatever it is you need to learn. It's an awesome way to make a living. Allways learning.

Later on,

Terrence Cox
Monday, April 1, 2002

*  Recent Topics

*  Fog Creek Home