I have had colleagues and others ask me, “what is it like to use those non-mainstream languages?”. I have never given an answer that I think is satisfactory. It doesn’t seem possible to answer this question satisfactorily, without educating on all the fundamental programming and mathematical concepts that are on hand. I want to convey what it would be like to someone who is familiar with the typical mainstream languages such as Java and C#, without having to dive into a lecture about category theory or type-classes or what-have-you. It is also hard to answer this question when there is so much pseudo-science around; I have to contend with absurdities such as ‘design patterns’ and ‘X driven development’ and sometimes even the hijacking of terminology such as ‘automated testing’ and ‘type-safe’ and … (I could go on and on).
Instead, I propose a hypothetical scenario that the inquirer is likely to be able to imagine. Then point out what it is like from their position in light of this hypothetical position. Hopefully then, I can simply say “it’s like that” and have the question answered satisfactorily. On with the story…
Imagine there was a programming language called Java Prime (Java’). It was just like Java, except it had no such thing as java.lang.Object or a common supertype. Instead, to represent universal type arguments, we used generics, even for such functions as equality i.e. {<T> boolean eq(T t1, T t2);}. We maintain the usual Java rules of invariance in type arguments i.e. C<T> is a C<U> iff T = U as opposed to say, covariance, C<T> is a C<U> iff T is a U. For example, in Java, a List<String> is not assignable to a List<CharSequence> even though String is a CharSequence.
Now imagine a new programming language called Java Prime Prime (Java”). This language is not as powerful as Java’ because it doesn’t have generics! Now imagine that Java” had mass adoption because learning generics is too hard, ‘not for the real world’ and ‘only relevant in academia’. We could hypothesise about how the result would look. Here is one scenario; you cannot write a function to compute the length of a List; instead, you have to write a function for each and every type that may be applied to a List. Then, some bright guy would register listlength.com and start the ListLength project. He would ship a JAR file containing the length function over many different types. He would attract fellow contributors and even write some kind of plugin facade that would allow you to compute the length of Lists of types in third-party APIs. listlength.jar would be a 100MB jar file that you could download.
However, some other guys aren’t into the length library. After all, it only works on List; what about Set and all the other types? Furthermore, the function should be called ’size’ not ‘length’. So now we have a debate about the correct name of the function and size.jar is 150MB and has Eclipse integration (somehow?). The debate is quite circular and often attracts personal attacks and so on. You watch this debate from the sideline; sometimes laughing at its silliness, sometimes feeling quite empathetic toward its proponents.
The hypothetical size of listlength.jar and size.jar is infinity. It could indeed go on forever and it keeps many people employed. To threaten the monopoly on list length would attract the harshest of criticism, despite any irrationality of that criticism. Imagine walking passed a ‘length guy’ and a ’size guy’ having a discussion and whispering into each of their ears, ‘generics’. You would attract many kinds of irrational responses and you could even catalog each one perhaps assigning some to the blatant logical fallacy group, the anti-intellectualism category and intersections of categories and so on, anticipating and sometimes even making predictions which response is about to be used based on body language. You could chart them and determine which response is likely to follow from which and so on. In fact, you could get a darn good idea of the way the system works; much better than the length or size guys ever will while their bubbles haven’t popped.
The fact of the matter is that you just wrote infinity lines of code by saying a single word. This might sound knee-jerky and quite out-of-nowhere, but it is absolutely true. The fact that the statement appears both extreme and is absolutely true should start ringing some alarm bells for the length and size guys, but they have already prepared their defence against these kind of attacks. You might even say things like, “the length and size libraries are the most useless things I have ever seen” even though it is so popular that it appears on some people’s CV! You don’t write a web application without first downloading listlength.jar or size.jar (depending on which establishment you subscribe to).
So you plod on, using generics in Java’ as it were, having already written the list length function (and the set length function and… oh wait, I’m not going there :)) once and for all and you have no choice but to ignore the length and size guys, despite their curiosity about what it is you are doing. If you ever present your length function to them, be prepared for charges such as ‘how confusing’ or ‘look, it’s longer than my length function! (while pointing at the <T> declaration)’, but if you’re like me, just sigh and keep on working.
Imagine, however, that you were placed under duress to use and even contribute to the length library. Suppose you worked for Java Joe and Joe, the Senior Architect, demanded that you use the length library, because of the usual irrationalities (too hard, not for the real world and so on). You question him, but the authoritarianism is clear and so there you sit, about to write a line of code for the length library. Suppose now you type 20 characters of code. Have you made progress? Do you feel like typing another 20? You sit there totally aware that the very act of typing 20 characters is no different with respect to progress as it is to doing nothing at all. You wonder if you should even just sit there; why not just go to the beach? After all, you’ll be making the same amount of progress as Java Jim; your colleague madly bashing away at his keyboard. It’s quite an anxious feeling to sit there in a state of logical inconsistency as a result of suppression of reason and thought. How would you deal with it?
That’s what it’s like.
- Attempting to make undeluded progress against the wishes of a well-controlled establishment
- As a devout humanist, I watch people labour over a completely futile task under what appears to be nothing more than a spell
- Dealing with the irrational criticism and charges of blasphemy that are attracted by making statements that challenge the establishment (despite their truth value)
- Dealing with suppression of reason, stupidity and (often inadvertent) authoritarianism
I hope that gives you a taste 