Most developers don’t really know any computer language
What does it mean to know a language? I can count to ten in half a dozen human languages, say please and thank you, tell people I’m English and a few other phrases that will probably help me get by; I don’t think anybody would claim that I knew any of these languages.
It is my experience that most developers’ knowledge of the programming languages they use is essentially template based; they know how to write a basic instances of the various language constructs such as loops, if-statements, assignments, etc and how to define identifiers to have a small handful of properties, and they know a bit about how to glue these together.
There are many developers who can skilfully weave together useful programs from the hodgepodge of coding knowledge they happen to know (proving that little programming knowledge is needed to write useful programs).
The purpose of this post is not to complain about developers’ lack of knowledge of the programming languages they use; I appreciate that time spent learning about the application domain often gives a better return on investment compared to learning more about a language. The purpose is to suggest that the programming language community (e.g., teachers and tool producers) acknowledge how languages are primarily used and go with the flow rather than maintaining the fiction that developers know anything much about the languages they use and that they should acquire this knowledge to expert level; students should be taught the commonly encountered templates, not the general language rules, developers should be encouraged to use just the common templates (this will also have the side effect of reducing the effort needed to follow other peoples code since the patterns of usage will be familiar to many).
I suspect that many readers will disagree with the statement in this post’s title, and I need to provide more evidence before proposing (in another post) how we might adapt to the reality to be found in development teams.
The only evidence I can offer is my own experience; not a very satisfactory situation; a possible measurement approach discussed below. So what is this experience based evidence (I only claim to ‘know’ the handful of language I have written compiler front ends for, with other languages my usage follows the template form just like everybody else)?
- discussions with developers: individuals and development groups invariably have their own terminology for programming language constructs (my use of terminology appearing in the language definition usually draws blank stares and I have to make a stab at guessing what the local terms mean and using them if I want to be listened to); asking about identifier scoping or type compatibility rules (assuming that either of the terms ‘scope’ or ‘type compatibility’ is understood) usually results in a vague description of specific instances (invariably the commonly encountered situations),
- books that claim to teach a language often provide superficial coverage of the language semantics and concentrate on usage examples (because that is what is useful to their readers). Those books claiming to give insight into the depths of a language often contains many mistakes; perhaps the most well known example is Herbert Schildt’s “The Annotated ANSI C Standard”, Clive Feather’s review of the 1995 edition and Peter Seebach’s review of later versions,
- the word ‘Advanced’ has to appear in programming courses for professional developers with 3–10 years of experience because potential customers think they have reached an advanced level. In practice, such courses teach the basics and get away with it because most of the attendees don’t know them. My own experiences of teaching such courses is that outside of the walking people through the slides, the real teaching is about trying to undo some of the bad habits and misconceptions individuals have picked up over the years.
Recent graduate think they are an expert in the language used on their course because they probably have not met anybody who knows a lot more; some professional developers think they are language experts because the have lots of years of experience, in practice they tend to have spent those years essentially using what they originally learned and are now very adept with that small subset.
How might we measure the program language knowledge of the general developer population?
Software development question/answer sites such as Stack Overflow contain a wealth of information. I think I could write a function that did a reasonably good job of deducing the programming language, if any, being used in the question. Given the language definition (in some cases this might not exist, e.g., Perl and PHP) and the answers to the question of how do I figure out the language expertise of the person who wrote the answer?
First, we need to filter out those questions that are application related, with code being incidental. Latent Semantic Indexing could be used to locate the strongest connections between parts of the language specification and the non-source code answer text. If strong connections are found, the question would be assumed to be programming language related.
Developers only need surface knowledge to sprinkle any answer with phrases related to the language referred to; more in depth analysis is needed.
One idea is to process any code in the question/answer with a compiler capable of generating references to those parts of the language definition used during its semantic processing (ideally ‘part’ would be the sentence level, but I would settle for paragraph level or perhaps couple of paragraph level). A non-trivial overlap between the ‘parts’ references returned by the two searches would be a good indicator of programming language question. The big problem with this idea is complete lack of compilers supporting this language reference functionality (somebody please prove me wrong).
I am currently stumped for a practical technique for a non-superficial way of measuring developer language expertise. The 2013 Mining Software Repositories challenge is based on a dump of the questions/answers from Stack Overflow, I’m looking forward to seeing what useful information researchers extract from it.
Hello, Derek.
The sentence “most developers’ knowledge of the programming languages they use is essentially template based”, taken out of context, can be interpreted at several levels. A popular family of submissions on http://thedailywtf.com/ used to be that of submissions that could be summarized as “The programmer does not know about for loops. Ha, ha!”. I suspect we are seeing fewer of them because the moderators eventually grew tired of them. Would it change the argument if you removed the for loop from the list of templates in the first part of your post?
This said, I wholeheartedly agree about the vocabulary difficulty pointed out in the first item in the second half of the post. When discussing C structs, I never know whether to call the labels in them “fields”, that everyone seems to call them including Wikipedia (http://en.wikipedia.org/wiki/Struct_(C_programming_language) ), an usage that the standard itself implicitly acknowledges when it calls a related notion “bit-field”; or “members”, which appears to be the official name.
@Pascal Cuoq
Sorry for the delay in replying, had web site trouble and I have been out since early morning.
An early draft of this post did say for loops rather than just loops, I thought that version was never publicly visible (perhaps something related to the rather odd website fault). You are right that some developers only ever use one kind of loop (i.e., a while or a for).
Yes, perhaps the term ‘template’ might be read the wrong way by C++ users. I sometimes use the term ‘pattern of behavior’ when talking about this topic but thought that was more likely to be ambiguous in this context.
The title makes me think that “knowing the language” means that I must know all of the weird corner cases (like the result of prefix vs postfix increment notation for pointers in C in every context) that only a compiler designer would need to know. This means knowing the result of even terribly designed algorithms.
I do not agree with this implication. I think that “knowing the language” means that the programmer understands what “idiomatic” code looks like and can spot, and correct, code that does not follow the style in the language. I pride myself on knowing (and not using) weird corner cases in languages (like when an instance of String == a string literal in Java).
If a person is writing Javascript like Java code (trying to do classical inheritance for example) or writing Haskell in a procedural manner, then that person obviously does not “know the language”. But I argue that someone can “know” C without knowing the result of “p[++i] = i++;”.