Wednesday, September 14, 2016

Which is the most difficult programming language to learn?

 Most Difficult Programming Language To Learn


Have you heard of Brainf… nvm. (Why do people not read answers? Why do I ask this question when I know that it doesn’t matter?)

I’m going to add two concepts:
  1. The most difficult language is that language with the biggest knowledge gap, which is generically any spreadsheet. While I didn’t work on spreadsheets for my PhD research, I know people who did. The number of people who write/maintain spreadsheets, and how much of the world is run on spreadsheets, is mind-boggling, and of course few of these people have any software engineering education (seeEUSES for more information), and spreadsheets are very difficult to test.
  2. The most difficult language is the language with high defect frequency. Many people forgot that one of the key purposes of Java was to reduce defects (bugs). About 15 years ago, well into the Java era, a study was done and found that C++ had much higher defect frequency than other languages studied. It wasn’t a perfect study partly because it was based on static analysis, and partly because there are so ways to screw up C++. There was a joke that in an Interview About C++, Stroustrup admitted that he created C++ to be intentionally difficult to raise the salaries of programmers (which some people took seriously).
  3. The most difficult languages are those for which obfuscated program contests exist. The Obfuscated Perl contest was short-lived but wonderful; here’s Mark-Jason Dominus’s 2000 entry Obfuscated Perl Program. The most famous is the The International Obfuscated C Code Contest (which explains what an obfuscated code contest is about), and my favorite entry is http://www.ioccc.org/1988/westley.c, which calculates pi based on a rough circle made in ASCII.
For me, in practical terms, the most difficult language to learn is C. It’s not a blindingly difficult language from the perspective of syntax, and The C Programming Languagebook helped me become a better programmer in general, but the purpose of C (at its creation and in its current use) are two of the most complex pieces of software: operating systems and compilers. Compilers follow a very complicated logic based on characteristics of language, but there’s an underlying logic. However, operating systems… it’s not that any one concept is particularly challenging, but building such a complicated piece of software in a procedural language… it mystifies me, but there are good reasons why C is used, the most important of which is that the UNIX operating system and the C programming language were designed and built together. Both were fairly radical approaches at that time, and there is no equivalent hybrid low-level/high-level language. People talk about the challenge of languages outside of the imperative paradigm (Lisp and Haskell are often mentioned), and I’ll admit I’m biased in this regard (I’ve taught and used functional languages), but even a multi-paradigm language like Scala is no match in complexity for a language that’s designed to serve as the basis for a bootstrapping compiler and an operating system at the same time. It’s like taking a Ferrari and strapping a giant snow plow on the front and somehow having it work well for both tasks. To put it more simply, you don’t understand C until you understand compilers and operating systems, which makes learning memory management in C++ seem like a trivial exercise in comparison.

0 comments:

Post a Comment