Programmer Paradigms and Programmer Audiences
I have been reflecting a lot on the age old question of the “optimal” programming language for a while now. First I’ll issue the usual disclaimers about apples and oranges and how they need to be fit appropriately to the problems they need to solve. But more than anything else one thing stands true. This one thing I rarely see mentioned:
The optimal programming language is the one the programmers who will be using it are best suited to.
This doesn’t mean that it’s the one they already know. This means it’s the one that matches their skill level and the way they think. It’s more important to match up the language with the programmer than the problem that is being solved or any other criteria. There has been a lot of talk lately about “bondage and discipline” languages, dynamic typing and expressive power in programming languages. People think in different ways for different reasons. People have different skillsets. And others can be productive in an environment with rules and can create spaghetti in one without.
If I had a small team of top-notch programmers I would love to fully embrace and use a language like lisp or a purely functional language. That being said I have worked with a large number of programmers who can’t understand the basics of object oriented programming. They know the syntax but klduge the code into something that grinds to a halt and is unmanageable very quickly. The thought of the meta-languages those same programmers would create in lisp send shivers up my spine.
I hear a lot of crap about “the heat and the kitchen” and “if you don’t have the highest quality programmers you are doomed to failure”. Frankly that is pure crap. A certain percentage of programmers are “beyond repair”. But a large number of programmers are extremely solid when in the right environment. Frankly they need more structure and less wiggle room. And then maybe 1 in 10 programmers is the type that can be given full range to “be trusted” to use the full set of programming paradigms in any way they see fit. It may seem a little heavy handed, but show me any experienced team lead who disagrees.
Personally I find “bondage and discipline” languages to be best suited to the real world. We’ve all heard the statement “Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.” That statement is almost correct. I would redact that statement to the following “Any sufficiently complicated and well engineered program contains an implementation of Lisp.” The first statement simply isn’t true by itself because,if nothing else, many implementations of Lisp have been written in C. “ad hoc, informally-specified, bug-ridden, slow” - these added bits certainly don’t have to be the case.
I’ve done a lot of game programming in the past. A very common technique is to have the core in C++/C and have a scripting language sit on top of it. Often times it’s LUA or a Javascript-like language. The programming teams working on the scripting languages vs. the core C++/C code are different groups.
Design patterns are another way of embedding these principles in the language that’s being used. You often hear, “Design patterns! - those are bad smells! The programming language is insufficient - this is the only reason the design patterns are important”. I disagree. Design patterns may involve “wordier” constructs than a language that supports those concepts natively. This involves less expressive languages having more lines of code to express the same concepts. This part always makes me laugh. I don’t care what the programming language is - the number one problem I have seen again and again is TOO MUCH CODE and not enough THINKING. I’m not talking about lines of code - I’m talking about code control points or cyclomatic complexity. Your XP junkie would cry foul but some programmers should learn using a punch card type mentality. Once they have mastered their craft only then should they be able to rebuild and modify “on instinct”. Carpal tunnel syndrome should never be a programmers fear.
I have worked with C code that was object oriented. Yes, I can hear you coughing. It is wordier than any language that embraces some form of OO but it can be done. And once it’s done it isn’t that terrible. Encapsulation using static inside compilation units, function pointer tables and a system to manage it, the whole 9 yards. Turing complete is turing complete.
Sometimes creating a barrier to entry to implementing more advanced concepts can be a good thing.
How many languages could be an optimal number to have at our disposal? With all considerations taken - hiring new coders, etc., etc. Some contenders based on popularity, power and potential include ones from several camps:
1. Java/C# - These guys are today’s C++. And they pretty much shine for the same reasons. Any good programmers you hire will be able to code in them with reasonable proficiency.
2. Lisp and it’s spawns - These guys seem great for that core of coders that will be building domain specific languages and need the expressive power. It’s hard to find programmers that will do it justice (as opposed to kludge up something truly clumsy), but when you do you will have some terse truly elegant code that is both flexible and powerful. But throw the code into a normal pool of programmers and they will beg to rewrite it in Java/C#. So definitely don’t do that.
3. Javascript - Sure it’s Lispy. But it is stands apart because of its ubiquity. You can find plenty of coders who think they can do it justice. And under constrained environments they may be right.
4. Truly functional languages - Haskell, etc. - I’ll be frank. I really can’t say I fully grok the trade-offs with these languages. I definitely don’t see these languages ever going mainstream simply because of the difficulty in finding people to use them appropriately. In certain domains they will rule, in others they will simply be overkill.
Those languages seem to have strong enough support and be sufficiently different to justify their utility.
That being said a lot of the conclusions I have come to are based on “justified” instinct based on my background. The languages I’ve coded in extensively since 1982 include (chronologically) 6502 machine language, “Bill Gates” Basic, Borland’s Turbo Pascal, 80×86 assembler, C, C++ and C#. I have also done some commercial projects in Visual Basic, PHP, Java, and Javascript . I have written code for a large number of languages but my career has involved those listed above.
I feel that in today’s world specialization is in order. Programmers should be able to choose different tracks and learn different languages in school and for their careers. We draw a distinction between digital logic design and programming languages. I think we should also break programming into specialties.
The programming paradigm should fit the programming audience (those who code to it). Like math or any science, programming is becoming a broad enough discipline that specialization is needed. After all, would you want your brain surgery performed by any doctor? I wouldn’t think so.











