[fpc-devel] Templates / Generics

Marco van de Voort marcov at stack.nl
Mon Nov 7 14:58:45 CET 2005


> Micha Nelissen wrote:
 
> Consider for example the following: Is Java bad because it looks like C++?

No. But it inherits from C syntax in nearly all forms. 

The test is consistency. Java is consistent if it follows C(++) syntax,
(the rest of the language is C(++) like), (free)pascal not,

> Or is PHP bad because is looks like C++? 

Most scripting languages are basically historical amalgam of syntaxes, which
is also why they are not very suitable to write very large programs.

FPC is a general purpose language, which should be suitable to write large
programs. This requires some orthogonality of syntax, to make the errorrate
(due to syntax) as low as possible.

> I think it is even advantageous for programmers these languages have a
> similar syntaxis.
> 
> Just as + means addition in most programming languages, <> is used for
> generics as far as I know in most languages supporting generics.

The problem is that all langs you list are C derivates. At least on the
syntax level (e.g. {} for blocks, semicolon as statement terminator etc)

> I think if other considerations tie, we should therefore choose for <> as
> well. I think this will at least add to popularity and also reduce RSI ;)

I won't speak out in favour or against <> here. I did this several times in
syntax discussions with Peter (and Florian/Jonas/Daniel too) before, and he
was always right.

One simply can't say do "this" up front, but really has to look into (or
know) the insides of the language to be able to predict if a change could be
ambiguous, and avoid loosing consistency of the language.



More information about the fpc-devel mailing list