Modifiers Before Or After Nouns

[ThreadMess moved from ItsTimeToDumpCeeSyntax]

I don't like the type name coming before the variable. The variable name is usually what one is looking for, not a type name, and the type at the front makes them not line-up, so the eye has to work harder to find specific variable declarations. I prefer it after, PascalLanguage-style.


I agree. CeeLanguage is a procedural 3 GL. It adds no significant new concepts to Algol.

C is an unfortunate accident of history. UnixOs as the first global OpenSource OS was a major economic change, and a move forward.

C was a virus that used Unix as a disease vector to silently spread a diseased syntax pandemic. C if had not been free with free Unix I doubt that the disease would have spread.

Hmmm... there are billions upon billions of lines of useful C code out there. So if it's a virus, it's been a beneficial one.

Popularity alone is not a valid argument. For one, people cannot pick and choose the features of a given language separate from each other. It's a bundled deal. C may have enough benefits to outweigh the drawbacks. Popularity alone doesn't indicate which specific features are benefits or drawbacks.


This is an accident of economic history. If Unix had been written in almost any 3GL language that language would have proliferated. Unix provided a secret marketlaunching platform for C.

People bent their minds to fit the backward language syntax because people can learn to do such mental contortions and after a while it seems "normal". People can be conditioned to do many tragic things. The boss says code so they code and the cash roles in ... "and the rest is history".

Once a language achieves a critical volume of key systems, proliferation accelerates in a positive feedback loop. Exponential growth follows like any successful viral epidemic. If the "market" calls out for more software it will get more software, whatever the language, whatever the quality of the syntax.

But the type declarations are short in C (such as "int"). When they grew longer in OOP languages, such positioning became a liability.


Speed used to be an argument used by some people for using C. This is largely irrelevant, and has always been irrelevant, to the issue of perverse syntax. Code speed for such a 3GL depends mainly on compiler design for a particular architecture. Free source code, and many smart brains, produced faster optimized C compilers, in spite of the bad syntax.

But you just said syntax was irrelevant (which it is) to performance.


Irrelevant to system performance, in a 3GL, with a good compiler, but not to human performance in processing the information. Bad syntax obstructs human performance. Which it may be argued is more critical than machine performance. Producing errors faster because of semantic confusion is of marginal value.


AlgolLanguage can be AsFastAsCee on some architectures with optimized Algol compilers.

But who wants to program in Algol? There are many reasons Algol failed, having nothing to do with performance. In the case of Algol-60, the lack of portable I/O primitives (see AlgolSixtySyndrome) doomed the language. For Algol-68, the sheer complexity of the beast (and the public trashing that Algol-68 received from the likes of TonyHoare) doomed it.

"Some language designers have replaced the objective of simplicity by that of modularity... " - CarHoare from "Hints on programming language design" 1973


Algol-68 I am not advocating, and all those environmental and political and economic historical factors may be true. It is useful to have a simple 3GL to avoid assembler wherever possible, no doubt of that. Function points per line of code and all that. It is just the ceesyntax style I am complaining about and maybe not all aspects of it.


Would anyone in their right mind have given up such elegant syntax as AlgolLanguage, PascalLanguage ... for such a syntax disaster as CeeLanguage if it had not been for UnixOs?

Here is a one level Syntax Chart for Algol68 Language:
http://www.reddit.com/r/programming/comments/13wflg/1980_syntax_charts_from_informal_introduction_to Algol68
Officially Algol68 uses a two level gramma, the 2nd level allows the formalising of Language semantics.
Algol68 is kind of the missing link between 'C' and PythonLanguage.


I'm starting to wonder if I might be responding to a troll here...

Trolls are people too you know. Where is that light? It is awfully dark in this cave, good thing my night vision is so good. Is that an ogre I see? Oh, it's just a Shrek clone, that's OK. -- Shrek.clone.hi!


e.g.

public static string blah blah blah ... getname() ... public static string blah blah blah ... reversename(string aname) ... public int blah blah blah blah ... countlettersinname(string aname) ...

Uh, "public" isn't and has never been a keyword in C; and C++ doesn't use this particular syntax. You should be pointing your flamethrower at Java for the above. If you're going to criticize something, do take the trouble to be accurate.

public|dynamic|void|static|int|string ... whatever, the language keyords are for Ceelike syntax (C, C++, Java ... all copied the same style) I don't like the procession of keywords before the identifier. That's all I am complaining about, at the moment.


How could anyone "design" such a noisy syntax as C and not realize what a semantic mess they have made. Just read out a a typical list of a few C functions out loud.

It is a phonetic disaster. It is also a visual disaster. It does not assist meaning it obscures meaning. The noise exceeds the signal.

Disagreed. While I won't argue particulars like whether modifiers should come before or after the name, C function declarations are quite concise. Originally, they were too concise, which is why AnsiCee added prototypes to the language definition. That line of argument is similar to a non-Smalltalker complaining that

 anObject msg: anArgument msg: anotherArgument
is hard to read... study the language for more than five minutes and it becomes bleeding obvious.


Quite so! Notice the qualifiers (the message parameters) follow the noun "anObject". That's exactly what I prefer.

Smalltalker msg: thanks msg: yougotit


It is mainly all those modifiers before the identifier that irritate me.


The problem is that all the technical housekeeping key words precede the main semantics of the statement. So your eye has to jump over all these keywords before you can extract the primary meaning from the statement. After that you may need to jump back again to examine the keywords. This destroys the linear sequence of reading the statement; to what useful purpose? None that I can imagine. Was this oversight, perversity, dyslexic thinking ... who knows but it is a mess. "The emperor has no syntactic clothes" but unfortunately still reigns far and wide, a tragic pandemic.

I find the reversal of primary semantics and keywords locations intensely irritating. Yes I know hat "public", "int" ... do have some semantic content but it is secondary to the main concept you are looking for such as "getname".


Here is an example from a "natural" language, a Pacific pidgin dialect where they have got the syntax the right way round, I believe:

"mixmasterhimbelongjesuschrist"

Which clearly means helicopter, :-). Notice the primary noun "mixmaster" comes first followed by the modifiers (qualifiers)about celestial origins.

So let's rewrite this with the ceesyntax style, a ceechange

"himbelongjesuschristmixmaster"

It just does not fly with the same panache!

I vote for the Pacific pidgin dialect not the ceechange.


BTW English is also the wrong way round we put the adjectives before the noun. The large red naughty barking mad... dog

None of which has prevented English from being the most prolific language on earth, whatever the crazy grammar structure. Politics, economics and history were the causitive agents not the quality of English syntax.

French is more sensible, adjectives follow the noun, normally. Le chien grand rouge mechant aboyant fou ...

None of which has made French the most prolific language on earth.

French dumped (most) declensions and thus most of the inflectional grammar of Latin, but it still needs every damn noun to have a gender. English manages to be about as orthogonal a language as it gets, which allows it to borrow lots of syntax handily. French has the legacy of the ultra-reactionary Acadamie Francais to ensure the language becomes more and more ossified...


=> language proliferation is mainly caused by political power and economics not syntax, unfortunately.


public dynamic string blah blah blah ... WhyDoYouPutUpWithSuchRubbish?

void public dynamic blah blah blah ... BringBackAlgolSyntaxToCommonUsageIn3GLs

void public dynamic blah blah blah ... thethethethatsallfolks()

dynamic? Now that isn't a valid keyword in C, C++, or Java. Sheesh!


public|dynamic|void|static|int|string ... whatever the language keyords are for Ceelike syntax (C, C++, Java ... all copied the same style) I don't like the procession of keywords before the identifier. That's all I am complaining about.

Vive Pascal!

Hmm.... BlaisePascal was a Frenchman, so it only makes sense that the language named after him sticks the type after the name in the declaration. (Not to mention GustaveEiffel? and the inventor of his eponymous language, BertrandMeyer... both also French).

{I wonder what kind of programming language Yoda would come up with?}


I'm offended. I demand equal time for a discussion of verbs. Time for verb discussion I demand. I want to guys making silicon to arrange it so that the bloody verbs are submitted before the parameters, just like it's written in English and Danish and other infix/prefix languages.

Bloody cheek, making processors explicitly RPN in their handling of values versus verbs. I mean, what fool thought up this idea of

  |  AX <= 1
  |  BX <= 2
  |  ADD
in order to get 3? Don't they know that the mechanics should mimic my language? Effing nerve!

 Pipe that into stick it smoke and.
   or is it
 That pipe into stick and it smoke?
   let me get my manual ...

Neither. It's this:

 that pipe your stick  it smoke  sequential-and

Leave it to a Forth programmer to show how you should properly arrange prose so that every word is a combinator. ;D


CategorySyntax


EditText of this page (last edited December 8, 2012) or FindPage with title or text search