This site will look much better in a browser that supports web standards, but is accessible to any browser or Internet device.

Anomaly ~ G. Wade Johnson Anomaly Home G. Wade Home

July 04, 2013

Sturgeon's Revelation of Code

One problem with comparing different programming languages is finding a valid comparison. It's pretty hard to really compare two different languages. On the other hand, it's pretty easy to compare example code from the two languages. Unfortunately, comparing code examples is likely to run into Sturgeon's Revelation, or Sturgeon's Law:

90% of everything is crap.

Comparing Languages

From Sturgeon's Revelation, it is reasonable to assume that 90% of the code written in any language is crap. If you want to make your language look good, compare an example of the 10% of non-crap code from your language with an example of the crap code from another language. This sounds like a pretty underhanded way to argue, since you are explicitly not comparing equivalent examples. I suspect that the reality is less malicious.

Let's say you want to compare a language you don't know to a language you know well. You will probably spend some time finding or writing a good example in your language to show its advantages. Since you don't know the other language, you can only pick a random piece of code to compare against. From Sturgeon's Revelation we know that 90% of the code you are likely to pick is crap. So, you end up comparing really good code with crap. Thanks to confirmation bias, this happens to match up with your opinion anyway, so it must be right.

Conclusion

This tendency to compare code seems to be much more common for people who only know one or two programming languages. Someone who knows two languages well enough to choose good examples from both languages will be less likely to be biased toward one or the other. In my experience, the more languages you know, the more likely you are to see the commonalities rather than the differences.

This is not guaranteed. I have worked with languages that I have gotten competent with that I really don't like. But, on the whole, it's hard to take a hard line against a language that you really understand.

The next time you see someone using examples of code to prove which language is best, watch out. Sturgeon may be hiding in the crowd, laughing.

Posted by GWade at July 4, 2013 10:22 PM. Email comments