Write Only Language

What you say of a maintenance-hostile language.

Contrast ReadOnlyLanguage for a different flavor of maintenance hostility.

The usual suspects on the language-bashing pages may also line up here.

Many languages also come with cultures that expect code to never be read or refactored.


Languages accused of being inherently "write-only":


I've often heard C and C++ being accused of being "write-only" languages. I've read and written C and C++ for years, and have found that one can create very readable programs in both languages. One can also create very unreadable programs; the InternationalObfuscatedCeeCodeContest is based on C (and I think C++ is too complex to make the contest interesting anymore). But this does clearly make it a problem of the programmer, not the language. -- JeffGrigg

Bad programs can be written in *any* language. People are thinking of C when thinking Obfuscated. C++ is a perfectly fine language. I don't understand why people have problems with it.

If you've never gotten a (literally) 30 line (or more!) error message involving templates that is nearly impossible to decipher, then you are not using modern C++ with templates and STL (just one of many things that could be mentioned here). If you have gotten such a message, then you are being disingenuous to pretend that it is "a perfectly fine language". I've been using it since 1988, and the more I use it, the more it makes me feel like I'm stupid.

Enough is enough; I'm not stupid, and I have professionally worked on the internals of several compilers for C++, and read the standards each time they came out, and read many books on best practices in C++, and followed the advice of many C++ gurus, etc, etc, etc.

I know many languages well, and I know C++ better than all of those others, and I can swear on my sainted grandmother's grave, C++ is just plain hairy, in utterly unnatural and needless ways.

Go ahead and love it; everyone has personal preferences. But don't pretend it has no problems. It is the only language I have ever used where I am fighting the language far more often than I am just programming in the language -- and note from the above, that is NOT because I don't know the language.

And although I'm not as much an expert in Smalltalk, Haskell, Lisp/Scheme, SQL, Forth, or APL (or modern J dialect), each of those is easier to program in than C++, even though each of them require you to think "sideways" in a new way. (I originally said "Prolog", but actually, okay, for anything more than a couple hundred lines, Prolog is a PainfulLanguage in a different sense.)

For you to claim that programming in C++ is no big deal, that it's a perfectly fine language, just makes it sound like you haven't programmed much in any other languages.

Here's a suggestion: try ObjectiveCee for some non-trivial project. It's much cleaner than C++. Objective C isn't my favorite language, nor is Smalltalk, nor is Lisp, nor is Haskell...I'm just incensed that you would be so complacent about C++. It has wasted so many years of my life...At least be a man and admit its weaknesses! :-)

I have been programming in it for 10 years and love it. Not only is it a fine ObjectOriented language, but a great Generics language as well. The CeePlusPlus I write is very readable. -- sg

Good. Now try some side-by-side comparisons with other modern languages. If you're that good in C++, you would probably be a world class master in some other language!

As to the following comment, sure, C++ has some features that allow programming superior to that in vanilla C, but, oy vey, it's (excuse the nasty metaphor) like being tempted to sleep with a beautiful woman but waking up to find you have a sexually transmitted disease. The "cure" is not worth it, despite the faults of C itself. Sigh. I've probably gotten offensive, there. Sorry. More than 25 years C, more than 15 years C++...I've got a lot of steam to blow off.

I too would say that C++ makes it easier to write readable programs (relative to C). But it has to be your objective, as a programmer, to make your code readable. -- JeffGrigg

Agreed, but that should be every programmer's objective anyway. Writing in Java or SmallTalk or CsharpLanguage isn't going to be any different.


The thing I'm most concerned about is how horrible the code produced by an _average_ programmer will be in language X. I have maintained code written by average programmers in C++ (bad, but bearable), Java (not bad), Python (surprisingly bad) and Perl (kill me now). Most if not all languages are OF COURSE capable of beautiful code in the right hands. The problem is the scarcity of right hands. -- JamesWilson


Ode to APL

  : There are two things
  : a man must do
  : before his work is done;
  :
  : Write two lines
  : of APL
  : and make the buggers run.


I'm surprised to see that the only references to Lisp here seem mildly positive. What I've seen of it is as unreadable as what I've seen of Perl, but without any variety in the line-noise punctuation; the term "meaningful identifiers" is generally lost on practitioners of both. C and Lisp both use abbreviated things (reminiscent of Unix command names), e.g. "strchr", "defun" ... makes me wonder if the same people are responsible for aspects of Lisp as are already known to be responsible for C and for Unix. As for Perl, a lot of what I've seen didn't even have any identifiers in it ... that I could identify.

OTOH, you can look at even fairly dubious code in C, C++, Java, Basic, and Smalltalk, and have a fairly good idea of what it does -- at least at the atomic level of individual statements and expressions, things like "x[i++] = i" notwithstanding, which are befuddling in any of the former three languages and actually vary in behavior from compiler to compiler in C and C++.


When short-term productivity (lots of features delivered quickly and cheaply) matters more than medium- and long-term team software maintenance, WriteOnlyLanguages can be the best tool around. It's a matter of choosing trade-offs wisely. TheRightToolForTheJob. -t


See PainfulLanguage, BadCodeCanBeWrittenInAnyLanguage, LispLacksVisualCues, HackerLanguage, SeriousVersusScriptingLanguages


EditText of this page (last edited November 12, 2014) or FindPage with title or text search