Verbose Language | Qomp Language |
MODULE Example; IMPORT StdLog, OtherModule; PROCEDURE Msg(s: ARRAY OF CHAR); BEGIN StdLog.String("Showing message: "); StdLog.Ln; StdLog.String(s); StdLog.Ln; StdLog.String("Done"); StdLog.Ln; END Msg; PROCEDURE OtherProc(VAR SomeNumber: INTEGER; OUT SomeString: ARRAY OF CHAR); BEGIN (* some code goes here *) END OtherProc; END Example. |
unit Example; use StdLog, OtherUnit; proc msg(s: astring); b Ln('Showing message: '); Ln(s); Ln('Done'); e; proc OtherProc(v SomeNumber: int; o SomeString: astring); b // some code goes here e; e. |
More verbose code that does the same job does not mean more maintainable code or less time spent fixing and concentrating on important bugs. In fact, the compiler can waste time informing the developer of issues that are so obvious they are not worth reporting.
Why not for example repeat the end of the IMPORT clause with IMPORT_END, to ensure the imports are ended? Why not repeat the parameter declarations with PARAMETER_END also? How about VAR END and CONST END as matching phrases for VAR and CONST? What about VAR BEGIN and CONST BEGIN?
Where Niklaus, Cobol authors, SQL authors, and others are wrong: programming is not "English". It is not just some repetitive essay, repeating itself over and over again. Yet that is what we see in programming languages like Cobol, Oberon, Ada: needless, repetitive, eye straining noise. Add the CAPS LOCKS to the mixture and some programmers feel like vomiting. Feel free to stop reading if you are offended right now - the author has absolutely no soft feelings for you.
Programming should rather be a notation, as math is. Words should be used for labelling commands to do tasks.. words should not be abusively used for every thing in the language! That defeats the purpose of programming, or math.
One has to ask himself:
A mathematician could argue that "ADDITION_TO" is more readable than "+" but we don't hear these arguments from intelligent mathematicians. It seems some programmers are not experienced or awake enough to understand that notation must do the heavy work for us. There is a crowd of programmers who believe we should have heavy notation do light work or no work at all.
The key, of course, is to use words where they are really useful - as labelled commands, methods, procedure names, and function names. Words offer flexibility and extensibility. One can generate a new word out of several letters! Should fixed reserved words such as CONST, VAR, BEGIN, ANSISTRING, END, etc. benefit from this flexibility that words (combined letters) offer us? Of course they cannot - because they are fixed reserved words!
In Algol style languages with a read only param feature, often programmers skip using the feature since by value parameters skip the ugly CONST notation. It gets in the way of an interface or header and clutters up the source. Using heavy CONST and VAR words all over an interface takes away from readability, and causes repeated splattering of "CONST" all over the source. Programmers choose "by value" params often not because CONST params are not useful!
In other words, the syntax and notation of a language, if too baroque and complex, causes programmers to avoid useful features. Worse, it is not immediately apparent to the programmer that he is working around his language instead of with it. Subconscious habits build up, and the programmer works around the language skipping its useful features due to their complex hideous nature. Readability of sources improve when a programmer skips using certain useful notations. Isn't this sad?
Much sadder is the fact that programmers do not realize they are working around their language. Programmers even lie to themselves and argue with other programmers about how "their language is more like English" and how a more verbose language causes "less errors and is more readable". Hypocrites they are.
Yes, psychologically a programmer doesn't realize that often he or she skips using a useful notation such as CONST or ANSISTRING for the mere reason that CONST or ANSISTRING is too large, ugly, baroque, and less readable.
Ironically, verbose languages are supposed to be more readable (maybe to the casual user or child passing by), when in fact they seem to clutter the screen and cause programmers to find ways to defeat the verbosity (like shoving the big clunky BEGIN on the same line as THEN or END ELSE).
How about Dijkstra's and Leibniz's recommendations of "letting the symbols do the work" and Dijktra's advisement against creating languages that have too much notation that is much like English, or too much like COBOL or BASIC? Taking it one step further, I (Lars) coined a phrase "letting the notation do the work" since it is not just about symbols. Notations are not limited to one letter characters or symbols - they are just short notes which can even be composed of a few letters (but not too many, otherwise they are no longer notes, but full phrases and words).
Unfortunately, most of Dijkstra's articles were not publicly available and only a few insiders were able to read all of his articles at the time of language invention. When some of Dijkstra's articles did get published, people misinterpreted a lot of them - such as the famous "GOTO Considered Harmful" (which Dijkstra did not title "harmful", someone else did. Dijkstra noted later that the people making religions about it misunderstood the intention of the article, which was about showing valid cases against GOTO). People, will therefore, often misinterpret the quote "let the symbols do the work" to mean that Perl and APL were being suggested (->*#%@#<-).
Letting notation do the work does not mean taking everything and turning it into symbols. Words and descriptive labels and names have their use. Words are very extensible and compositional, due to the fact that several combinations of letters make new words! Reserved syntax, however, is not about making new words - and hence there is a separation of concerns. Words should be used for descriptive commands, methods, items added to our modules, types of things. However, large words should not be used for common tasks such as "BEGIN OF THIS CODE BLOCK", "CONSTANT DECLARATION", "END OF THIS CODE BLOCK", "ADD THIS ITEM TO THAT ITEM", "VARIABLE DECLARATION", "READ ONLY PARAMETER", etc. In fact that begs question: why was VARIABLE shortened to VAR? VARIABLE is more readable than VAR. Why wasn't BEGIN shortened to "BEG" to match the three letter word END? Why was CONSTANT shortened to CONST, if the full word "CONSTANT" would obviously help readability and create more reliable programs? The answer is that continual hideous verbosity (instead of precise notation) does not lead to more readable or more reliable programs. COBOL and original BASIC even offer evidence of this.
Obviously there is hypocrisy to be noted: verbose language advocates are willing to create terse useful symbols like "VAR" and "CONST", but at the same time might violently argue against shortening REPEAT to "REP", or BEGIN to "B" or "{".
The more often we use a powerful tool (symbols are tools), such as the plus operator, the more we should consider shortening it into a notation. This is why a plus operator was chosen as "+" by mathematicians instead of ADD_LEFT_AND_RIGHT_ITEM.
The fact that a language like Ada offers safety features, modules, and important abstractions is why Ada is relatively successful. That is not a problem. However, its extreme verbose and complex syntax and philosophy makes it much less successful than it could be. This is hard for programmers to admit who are already in love and religiously protecting their existing syntax, notation, and philosophy.
Several people could ridicule Wirth for trying to simplify Algol (he created AlgolW which was an obvious rip off of Algol) and yet his AlgolW successor called "Pascal" became popular since it was simpler and less complex than Algol 68. Cee was of course also popular because it was simpler than Algol 68, and it had practical implementations available without the serious limitations or hefty notation of Pascal and Algol.
Qomp openly admits to stealing and ripping off useful ideas from modular and structured programming family languages, along with stealing ideas from the extensible programming languages (buzzword is Object Oriented). Heavens though, Mr. Wirth's CAPS LOCKS, Algol's ridiculous verbosity, C++ and Ada's ridiculous complexity, Cee's inside out syntax and declarations and ugly VOID's, and Java's hideous public static class repetition will be abandoned without any regret whatsoever. One must steal only the good ideas - and leave behind the bad ones.