Easily, according to a test devised by Saeed Dehnadi and Richard Bornat at Middlesex University's school of computing. In a draft paper at www.cs.mdx.ac.uk/research/PhDArea/saeed/ they show that it takes only a three-line code example and a multiple-choice test to divide "programming sheep from non-programming goats", adding that it "predicts ability to program with very high accuracy before the subjects have ever seen a program or a programming language".

Dehnadi and Bornat say teachers of programming often discover that class marks from exams form a "double hump" - as if there were two separate, overlapping populations with differing abilities.

"It is as if there are two populations: those who can, and those who cannot, each with its own independent bell curve," they comment. The first group includes 44% of people; the second, 39%. (There was also an 8% "no answer" group; the other 9% seem to have gone missing.)

The three-line code question - a simple assignation of two variables in Java, after which the examinee was asked to state which value the variables would have, and why - proved sufficient, when tried on undergraduates before they started their computing courses, to sort out who would do well and who badly in the end-of-year exams, because it showed who would use a consistent mental model to work out how variables received a value, and who used more than one model. (Using multiple mental models is the way to programming madness, and failure.)

But Dehnadi and Bornat may have discovered the secret to easing the pressure on computer science recruiters - and lecturers. Presently, reports suggest, between 30% and 60% of every university computer science department's intake fail the first programming course (though we can't find the source of the statistic).

Removing the goats early on might help - and identifying programming sheep in all walks of life could steer them to a different career.

Coming though as it does just two weeks after the British Computer Society called for more people to become programmers ("Should I think about becoming a programmer?", July 6), this draft paper might call into question the whole concept of just trying to recruit more people to computer programming courses. But the BCS numbers are worrying, showing a 50% drop in applications for computer-related degrees, a 60% drop in software engineering students and a 47% drop in systems engineering students. Let's hope the dropouts are all multiple-model goats.

Perhaps the most intriguing point comes near the end: as Dehnadi and Bonat note: "Formal logical proofs, and therefore programs - formal logical proofs that particular computations are possible, expressed in a formal system called a programming language - are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion."

True - but at least professional programmers get paid for it.

· If you'd like to comment on any aspect of Technology Guardian, send your emails to tech@theguardian.com