In The camel has two humps, Saeed Dehnadi and Richard Bornat explain that some people have an aptitude for computer programming and others don’t:
Learning to program is notoriously difficult. A substantial minority of students fails in every introductory programming course in every UK university. Despite heroic academic effort, the proportion has increased rather than decreased over the years. Despite a great deal of research into teaching methods and student responses, we have no idea of the cause.It has long been suspected that some people have a natural aptitude for programming, but until now there has been no psychological test which could detect it. Programming ability is not known to be correlated with age, with sex, or with educational attainment; nor has it been found to be correlated with any of the aptitudes measured in conventional ‘intelligence’ or ‘problem-solving-ability’ tests.
We have found a test for programming aptitude, of which we give details. We can predict success or failure even before students have had any contact with any programming language with very high accuracy, and by testing with the same instrument after a few weeks of exposure, with extreme accuracy. We present experimental evidence to support our claim. We point out that programming teaching is useless for those who are bound to fail and pointless for those who are certain to succeed.
The test is fairly simple and deals with the first “semantic hurdle” of programming: assignment and sequence. It doesn’t touch on recursion and interation or concurrency. For instance, the test presents some simple Java code:
int a = 10;
int b = 20;a = b;
then asks what the new values of a and b are.
Of course, if you’ve never taken a programming course, you likely don’t know how Java works, that the equal sign means assignment, etc. Students, despite their various mental models of what the code might mean, fell into three camps:
- 44% used the same model for all, or almost all, of the questions. We call this the consistent group.
- 39% used different models for different questions. We call this the the inconsistent group.
- The remaining 8% refused to answer all or almost all of the questions. We call this the blank group.
I’ll let you guess which group succeeded in learning to program.
The original link is long dead, but I was able to find another instance of The camel has two humps.
It’s also archived on the wayback machine: link and alt link.