The Neuroscience of Computer Programming
Hugh Pickens DOT Com writes "Chris Parnin has an interesting read about an international team of scientists lead by Dr. Janet Siegmund using brain imaging with fMRI to understand the programmer's mind and to compare and contrast different cognitive tasks used in programming by analyzing differences in brain locations that are activated by different tasks. One recent debate illuminated by their studies is recent legislation that considers offering foreign-language credits for students learning programming languages. There have been many strong reactions across the software-developer community. Some developers consider the effort laudable but misguided and proclaim programming is not at all like human language and is much closer to mathematics. Siegmund observed 17 participants inside an fMRI scanner while they were comprehending short source-code snippets and found a clear, distinct activation pattern of five brain regions, which are related to language processing, working memory, and attention. The programmers in the study recruited parts of the brain typically associated with language processing and verbal oriented processing (ventral lateral prefrontal cortex). At least for the simple code snippets presented, programmers could use existing language regions of the brain to understand code without requiring more complex mental models to be constructed and manipulated." (Read on for more.)
"Interestingly, even though there was code that involve mathematical operations, conditionals, and loop iteration, for these particular tasks, programming had less in common with mathematics and more in common with language (PDF)," writes Parnin. "Mathematical calculations typically take place in the intraparietal sulcus, mathematical reasoning in the right frontal pole, and logical reasoning in the left frontal pole. These areas were not strongly activated in comprehending source code." The new research results are a much needed, but only a first step in revealing the neuroscience of programming. Other questions remain including: Can we finally provide a neurological basis for a programmer's flow? How relevant is the mastery of language skills for programming? Are there certain programming activities that should never be mixed, due to higher chance of cognitive failure (and resulting bugs)? Do code visualizations or live programming environments really reduce mental load? "Programming involves a rich set of cognitive processes," concludes Parnin. "Although the study found a particular pathway that was strongly associated with language processing, there may be other pathways associated with other common activities related to programming (debugging, editing, refactoring, etc).""
In my experience, coding and reading other's code are two completely different tasks.
what comes around.... metaphysical disunabstraction week
Of all the fully employed programmers you know, how many of them have degrees in English, French, Japanese, Chinese, Literature, Journalism or creative writing? How many in mathematics or physics?
This study shows that understanding/reading code is related to reading : " What a surprise ! . Reading code, reading text book is more about pattern matching, memory (associative) than anything. Compare reading a math book and reading code probably results will probably be similar but this is not doing mathematics or programming, this is about reading/learning. Compare creating algorithms and demonstrating a theorem results will probably be similar.
Three possibilities about the study :
- Bad summary of the study
- Propaganda
- Wrong science
The whole point is just an incentive to get more students to study programming.
Like tax credits for charitable donations, nobody is claiming that the Salvation Army is akin to the government.
For quite a long time now, I've been explaining to everyone who will sit still long enough to listen that the term "computer" is a bad name for what these boxen do.
While strictly speaking they do carry out mathematical operations, that's not what most people use them for. They got the name "computer" because one of the earliest uses of computers was the numerical solution of differential equations. For example the Von Neumann architecture was developed by Dr. Von Neumann for use in designing hydrogen bombs. The Difference Engine was Charles Babbage's fat defense contract for the purpose of calculating firing tables, that is, how to aim a cannon, taking into account the wind and so on.
Really these boxen are instruction following machines. I was able to finally explain to my mother what I really do, and what a programming language really is, by asking her to compare her applications that I might have written, to her writing down the recipe for chocolate chip cookies. That recipe could be written in English, or in German or what have you. English and German could then be taken to be recipe languages, much as Java and C++ can be considered programming languages.
Why just the other day, I told a good friend that I wanted to return to graduate school to complete my Physics Doctorate, but had forgotten all my math. This because it is exceedingly uncommon for programmers to need to know much more than very basic arithmetic on the job. It is actually uncommon for me to use floating point on the job, or fractions. I cannot recall the last time I used a trigonometric function on the job.
However coders do need very strong verbal reasoning skills. If you could win on the debating team, or you studied philosophy in college, I assert you could be a good coder.
Please mail me URLs of software employers.
That will be a good test of language vs math.
1. How many programmers out there speak more than 2 languages?
2. How many can program in more than 2 languages?
Its likely the answers are 1. not many and 2. most.
I think equating spoken languages to programming languages like this is misguided and makes sens only to tech-ignorant policy makers and scientists looking for juicy grants based on half-baked non-peer-reviewed research.
That's where all the work is done !!
First, somebody needs to explain why some schools have a foreign-language requirement. The job of high school is to prepare students for jobs upon graduation (not so much any more) and/or prepare students for college. How does one or two years of mandatory foreign language study do either?
The difference you are overlooking is the translation of a problem description into mathematics.
Otherwise, no computer to process the information...
It is called a computer because that is all it can do - compute. It carries out mathematical procedures. Nothing more.
If you can't translate a procedure into mathematics, then the computer cannot perform the procedure.
All CS or Engineering here.
The link: http://www.gnxp.com/blog/2007/04/intercourse-and-intelligence.php
Have a nice day!
--
Sheshbazzar
Larry Wall: Wall developed the Perl interpreter and language while working for System Development Corporation, which later became part of Unisys.[5] He is the co-author of Programming Perl (often referred to as the Camel Book and published by O'Reilly), which is the definitive resource for Perl programmers; and edited the Perl Cookbook. He then became employed full-time by O'Reilly Media to further develop Perl and write books on the subject.[5]
Wall's training as a linguist is apparent in his books, interviews, and lectures. He often compares Perl to a natural language and explains his decisions in Perl's design with linguistic rationale. He also often uses linguistic terms for Perl language constructs, so instead of traditional terms such as "variable", "function", and "accessor" he sometimes says "noun", "verb", and "topicalizer".
ok. who can forget the hoopla surrounding presidential candidate ross perot's (billionaire computer programmer) 'deep voodoo & chicken feathers' speech meltdown, after which time he proclaimed he feared for his life from the gangsterious beltway feather peddlers?
for 85 then;; what was ross referring to?
Thank you, Professor Kugler.
"Love is a familiar; Love is a devil: there is no evil angel but Love." --William Shakespeare ('Love's Labors Lost')
Make sense to me... Language processing areas of the brain are a component of programming.
Try this experiment: Count backward from 100 by 3s. As in 100, 97, 94, 91, 88, etc.
At around 85 have another person -- yes an actual living breathing person -- start calling out random numbers between 1 and 100. See how long you can keep counting.
It's all pure math. But very few people have the ability to keep going amid distractions, even when the numbers are being called out in a foreign language they do not speak or understand.
Programming is like counting backward from 100 by 3s, only thousands of times more complex. Coding while someone is talking nearby can be downright impossible. Clearly there is some overlap between language processing and writing/reading/understanding code.
While computer languages are about math a lot more than human languages, coding isn't really like doing math. It's more like telling the machine how to do math, which the machine then does for you.
Brackets contain world's first nanosig, highly magnified:[.]
A lot of programming is about understanding a problem, seeing what the real needs are - not the ones that the users think they need. You then need strategic planning on how to meet those needs, a lot of that will be about understanding how the new program will fit into the existing ecosystem. Next comes the translation of that strategy into a programming language (or more: you may also need some SQL, HTML, shell, ...) and the completely different skills of debugging. Finally: documentation for the users and also the programmers [actually: I find that doing the first draft of the documentation before writing the code is a really good idea].
So: programming is much more than just language skills.
Some here have asserted that programming is a branch of maths. This may be true for some sorts of programs (or some subroutines), but it is not true for most of what I do -- although an understanding of maths does help some parts.
Summary: please don't be simplistic, programming is a complex skill that requires many different brain subsystems, language is just one of them.
"Mathematical calculations typically take place in the intraparietal sulcus, mathematical reasoning in the right frontal pole, and logical reasoning in the left frontal pole. These areas were not strongly activated in comprehending source code.
Usually, when I'm reviewing legacy source code, I find that the author's mathematical and logical reasoning centers were not strongly activated while writing the code, either.
Programming languages are very much like spoken languages. If you understand the origin language, or have an innate ability to infer meaning, it is possible to naturally understand a new programming language. I studied C++ in high school, so Java and C# are familiar and easily understood. The structures make sense, and if I don't immediately know offhand what something does, I can infer from the surrounding code. The same holds true for spoken languages. English is my first language, and I studied German in school. I never formally studied any other languages because that wasn't my passion. My passion was working with computers. However, I can generally infer the meaning of spoken Spanish in the same way I would deduce the function of unfamiliar code. I look for parts I recognize, use them to help decide what the unfamiliar portion means, and test my guess.
I've always felt that writing good code is very similar to writing a good essay or research paper. The process is about the same. The thinking is about the same. The ideal steps followed to produce a decent paper are similar to the steps followed to produce decent code.
I've always thought that a good essay writer can make a good programmer. In particular, good essay writers can make good programmer/analysts or project managers. In both worlds, you struggle with scope, organization, and fact finding. Answering the question "What is this paper/program really and truly about?" is the primary task.
Both try to make it as unambiguously as possible, both try to define the context under which the conditional will be evaluated and the consequent actions/outcome/behavior for the true and false paths.
Both work most of the time for the anticipated context. But when unusual and unanticipated conditions arise, codes trigger bugs and the legislation triggers loopholes. Bugs are sometimes confused with features. Loopholes too are sometimes intended to be there.
Both code and laws need to struggle with legacy issues and maintaining historic behavior sometimes takes precedence over fixing the bug/loophole.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
I use several programming languages, and I can read about 3 human languages. While there are some similarities, I'd say the two things are quite different. However, that doesn't settle the question of what should be taught in school.
I've gone back to school. I'm getting a degree from WGU. For my degree, I could take either American history or sociology. By giving me the choice, the school isn't implying that history and sociology are the same thing. They are saying that either one will improve my education. I see foreign language and programming the same way. Learning either creates a more well-rounded and employable student. I see it as "take either foreign language or programming, not just basket weaving and bird watching".
It is called a computer because that is all it can do - compute. It carries out mathematical procedures. Nothing more.
Then explain the mathematical equivalency to a jump instruction, a variable assignment or an I/O operation.
can form into rough sketches of Natalie Portman like that
Since in college I was hopeless in my foreign language class when listening/speaking were stressed. (And failed those classes multiple times.) When all I had to do was read it(at the same 4th semester level) I passed it the first time and I wasn't even close to failing. (Yes, I realize this is an anecdote but I wouldn't be surprised if there were a difference between reading and listening.)
Did you know 80 to 90% of the moderators on slashdot wouldn't recognize a troll even if one dragged them under a bridge.
A lot of people think that. A lot of people think they speak (and write) it better than they do. There's quite a degree of overlap.
And they're wrong. If it was the case, then English kids would be speaking in full sentences at 6 months whereas those who speak your idealised perfect un-pathetic language[1] wouldn't be able to ask for milk before they're hitting puberty.
I don't even know what that's supposed to mean. Should it add noun declensions? Adjectival agreement? Pray tell, O great guru of linguistics.
[1] are you one of those Esperanto twats? You're certainly smug enough.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
You're forgetting the complexity of learning each language and how repetition aids retention. Languages like LUA and Go have as few as 25 keywords and can be learnt in an afternoon. Try and do that with Japanese.
All those moments will be lost in time, like tears in rain.
Some programmers are also terrible and I don't listen to them on matters involving programming let alone linguistics. I have always thought of learning another language and learning another programming languages as similar experiences. At first you try to tie the words almost one for one from one language to another. But once you become fluent you just start doing things differently. But just like anyone going from no language to their first language, they must first learn the basic concepts. But with human languages you do know that there will be a word for car, bus, airplane etc. But a language used by a primitive culture might have one word for airplanes, while, say, English has many many words, (biplane, monoplane, fighter jet, prop plane, etc) the same is in many programming languages. R focuses on concepts while matlab focuses on others as I suspect that people from a pearl diving culture would have shockingly nuanced words for things relating to underwater.
Then you get other nuances such as not using a programming language for long enough generally results in that language becoming rustier and rustier until it is gone. Yet you generally can relearn a forgotten language fairly quickly. An interesting experience would be to see if people even activate the same brain areas relearning a forgotten programming language as those used relearning a forgotten spoken language.
But even within a single spoken language you have cultural differences. People in LA don't generally small talk about the weather, but will go on and on about the traffic during their commute. But in the North East people can talk endlessly about the weather, and in my area the joke goes, "If you don't like the weather, wait 15 minutes." The same with programming languages, using C/C++ as an example you have embedded programmers who obsess over the limitations of their environment and can pack a data-structure with bit for bit perfection; while someone working on a desktop might obsess with making their application installation friendly; and a mobile developer might obsess over screen resolution/sizes. Needless to say while the vast majority of their vocabulary is similar their use of the language can be wildly different yet mutually comprehensible.
Now there might be one tiny catch. A programming language is combination of creativity and some mathematics. Thus the best brain comparison might be to someone doing poetry, someone writing a wordy financial report, and programming.
So my question to any programmer who doubts that spoken languages and programming languages are not hugely overlapping in the brain is: "What part of the brain do you suggest we are using to program? The brain parts that control our bowels?"
What did they study a "programming"? String processing with regexes in Perl, canvas graphics in HTML5, pointers in C, and tail recursion in LISP are totally different activities requiring totally different cognitive abilities.
Because there's a vast difference in the type of mindset associated with Python for most tasks in contrast to assembly. The more abstract the language and the model, the more linguistic skills are involved because of how the language covers the underlying mechanics. The lower you go in level (having to work with pointers and stacks in C e.g.), the closer you are to the actual graph of the code in question, the more "math" are involved. Keep in mind, math isn't just algebra - I'm talking about graphs, and sets and stuff like certain techniques (like recursion). I mean, just how does reading assembly code involve linguistic skills other than decoding the "verbs" - the reconstruction of code into a graph is purely a mathematical concept. And perhaps, the real question is just how much "math" is involved in language - which frankly, depends on the language. I'm taking two somewhat extreme cases from both ends of the spectrum - I mean if writing some SCADA stuff is done in schematics, is it now the visual cortex that is solely used? It's math because language in fact can be best described using math. It's how the damnable lexical analyzer that feeds into the computer works. It's simply highly formalized with usually little in the way of being context-sensitive. I mean, this is old stuff, basically Chomsky's work. Are we just trying to prove that the brain has specific functions or map them? Because it's fine identifying what exactly goes in the process of programming, but coding is a subset skill of programming - they're different notions. A code is a rewriting, a shortened form, programming is building a machine (quite literally actually) to solve a specific problem in a given set of inputs. I'd go on about rediscovering the wheel or just going after research funds but it's really just interdisciplinary breakage.
For me, coding/design/problem solving seems to be mostly 3d abstract visual with objects being represented by some abstract entity and interactions that I can "see" (in quotes because I'm not sure that's what's really going on) and manipulate.
Reading or writing code is a translation to/from the imagery which is the real "code". The imagery is the abstract representation of the solution and where the problem solving happens.
While it seems logical to me that there would be heavy overlap between the brain regions used for natural language and those for reading programming languages, it's important to remember that "using the same brain region" is *not* equivalent to "thinking in the same way". For example poetry and mathematics both activate many of the same brain regions, presumably because they both involve a lot of pattern recognition and abstract thought.
For that matter, if I recall correctly the language centers of the brain are themselves mostly a subset of the vision centers of the brain, even when dealing with purely spoken language. Probably that pattern-recognition stuff showing up again
--- Most topics have many sides worth arguing, allow me to take one opposite you.
Backin the early 1970's the college I went to allowed FORTRAN to satisfy one of the two language requirements.
> Coding while someone is talking nearby can be downright impossible.
Could you tell that to the asshole who made open workspaces popular? kthxbye
http://www.wired.com/wiredscie...
I suppose that dead salmon should get credits for social science classes in such case...
while studying someone else's code. All the programmers were muttering and cursing under their breath, about what an idiot the programmer was and how much better they could have written the same thing.
RETURN without GOSUB in line 1050
The control groups should have been two other reading selections designed to bracket programming code reading: for example, reading mathematics, such as algebraic proofs, versus reading in an unfamiliar non-math vocabulary like a dense legal contract. It's possible that all would have looked similar, or that two but not three would have been similar, or all different. We just don't know.
And don't let me even get started on the fact that most fMRI studies use far too few subjects and then use absurd values for N like thousands of MRI mapped vertex points in a single subject to reach "significance" (a technique which would be considered a statistical cheat in any other field).
Or this one.
https://github.com/c00kiemon5t...
Don't quote me on this.
Having actually looked at the code snippets in the article, I have a different conclusion. I believe they are actually measuring what happens when someone tries to map a written programming command to their mental concept of it.
They are showing very simple snippets of code that basically force the programmer to translate the words into what they do, deriving semantic meaning from text. I would agree that the task is roughly analogous to language processing, but only because the code given is easy enough to understand without reasoning about it's logic. If you show me a simple for loop I don't try to figure out what it's doing in any sort of exhaustive mental exercise. I know the concept of a for loop and I map the representation without thinking about it. The same way you would map the concept of an English word to your mental construct of it upon being asked to read the word. Another comparison would be asking someone to understand a single simple clause in boolean logic. It would basically equate to a translation exercise and not a logical exercise in simple cases.
Real programs though are not like single loops or like simple clauses. They are like a complex branch of interlinking logical clauses. I think that in order to understand what parts of the brain are actually used during programming you'd have to get the fMRI results from someone actually doing a normal programming task. I suspect using similar tests for any given field you could translate each one to learning a language.
The Curry-Howard isomorphism is a way to relate programs to proofs and types to propositions. Control flow can be expressed in terms of call/cc and relates to Peirce's law in logic.
in any language
I studied Physics and Chemistry in the College of Science at the University of Southern Mississippi from 1969 to 1973. Our degree requirements called for passing either a proficiency test in one of several 'scientifically' relevant foreign languages or passing one in FORTRAN. I took one semester of FORTRAN and passed the test. I went on to minor in computer science.
In 15 years of formal education in the English language no one ever mentioned the word 'syntax'. We diagrammed sentences and conjugated verbs and identified parts of speech but no one ever explained the mechanics of what or why we were doing it. It was just English and it was necessary. Two weeks into computer programming and I knew WHY it was necessary. Understanding the structure of language, be it a computer language or a human one, I'm better equiped to learn new ones of either type.
Are learning to program and learning a foreign language equlivant? NO. We talk to machines: we communicate in a foreign language.
JMP is a simple addition, ie: add a constant to the instruction pointer..
Variable assignment is basic algebra, X=3.
I/O, again basic algebra. O = fn(I)
Do I also need to explain that "all a computer does" is set a bunch of switches on or off?
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
It's not about programming, it's about reading and understanding code. Also when coding you have presumably worked out what you want to do and are now in the process of translating that concept to code. TFA is not equating coding and natural language, they are merely pointing out the brain uses the same hardware to do both jobs. If you want your entire brain to light up then listening to music is the best brain exercise you can do.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
I am a software engineer with 30+ years of experience, and am currently a senior engineer with a tier-1 hardware/software company. Most good programmers that I know (and I know a lot) are polyglots in that the best of them speak/understand at least 2 or more languages other than their mother tongue. In my office, the babel in the halls or break room usually encompasses a dozen languages - English, Chinese (several dialects), Hindi (several dialects), Russian, Spanish, ... It is a mini-UN! Me, I speak English (mother tongue), Spanish (fluently), French, and understand Italian. My niece (not a programmer - an actress) speaks fluently at least 6 languages (English, Spanish, Portugese, Russian, Italian, Dutch). In any case, I am still learning new programming languages on a regular basis. I can do this quickly because, I believe, not just because of my previous programming language skills, but also because of my human language skills. Programming languages I am competent in? C, C++, Java, php, BASIC, Fortran, Cobol, Dibol, PL/SQL, TransactSQL ... and a raft of scripting languages (bash/ksh, csh, perl, python, etc). When I need to, I can learn a new programming language in less than a month to the point where I can write professional quality code.
Has anyone ever read Snow Crash?
accessing someones open account on facebook is not hacking
Maybe if they look at computer memory with an MRI....
But lets get to reality here and consider what the topic really is... abstraction. http://abstractionphysics.net/...
I only have a vague understanding of databases.
Actually I was heavily into scientific computing when I was in school. I'd like to get back into that.
I don't know whether it's changed any, but in 1993, the FORTRAN code used in high energy physics was an awful rat's nest. There was a movement afoot to rewrite it all in C++/
Please mail me URLs of software employers.
I graduated from Auburn University at Montgomery (BS in Business Administration, Management Information Systems major) and never took a foreign language. They used programming classes I took to meet my foreign language requirement.
FORTRAN vs C++. I dare you don't know either.
> select name as 'Clueless users' from users where clue=0;
+--------------+
+Clueless users+
+--------------+
+SunTzuWarmaster+
+--------------+
I'll have a look in the shitty pseudonyms table later.
Could you stick to car analogies or something ? Learning PL has nothing to do with learning foreign languages.
I'm a fluent French bilingual, but I learnt as an adult in Paris where they are about as patient as New Yorkers.
There's a huge difference between listening, where you have no control over the speed of delivery/level of difficulty and reading where you can take your time, look up 'words' [or pieces of unfamiliar syntax] and writing, harder than reading but you can still pace yourself and work around difficulties.
Otherwise there's anecdotal evidence that 'extra' natural languages are easier after the first one. I feel that's also true of programming languages, the first one is alien, lots of alien concepts [variables, file handles, operations] and the next few, in imperative languages contain the same thing with different syntactic candy. It's to do with memory, usage and repitition then, less with conceptual grasp.
On y va, qui mal y pense!
Just make it go away!
No, but it can, and often is, misintepreted. See: http://www.wired.com/wiredscie...
Can FMRI be used to program without keyboard or voice input?
That's what I really want to know.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
This is a false dichotomy; learning sufficiently advanced mathematics is like learning a new language.
One problem with the interpretations of the scan data, is that few of the medical doctors really understand computers.
We can understand that code in a subroutine can be used by many different apps. But the doctors, at least in the past, seem to assume each section of the brain has a fixed operation. Like a dedicated forming press in a factory. These areas are much more like a milling machine, able to adapt to many operations within a range of options.
The human brain is the most powerful computer that we know, and we don't have the specs or manual. Imagine trying to figure out the main computer in a crashed UFO ! No wonder they are a little lost... 8-)