Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Delphster
C, C++, C#, Java, Pascal, Object Pascal are all Algol-60 based languages, so there isn't much to knowing one if you know another. C# looks like Delphi because C# looks like C++ and Object Pascal is essentially stolen from C++; even most of the keywords and syntax were lifted. The few parts of C# that look explicitly like Delphi and not C++ are things that for the life of me I cannot understand why they were not in C++ to begin with (like closures.) They actually were in C++Builder, which was a great product. But those few got to C++Builder from Delphi, not the other way around, as most of the rest did.

The few improvements that make C# a better C++ are not many, but they definitely do exist and have Hejlsberg's signature.

The one place where NO language has come anywhere close to C++ even now is in template metaprogramming and Generics. The Generics in Java are just OK, they are OK in Delphi, better in C#, but nobody has yet gotten a generic programming model as good as C++. And given design limitations of the CLR, C# is not likely to get there, stubborness on the part of the Java committee Java is never going to get thre, and the fact that Delphi is running out of steam (and $) I don't see it getting there either. Pity, really, because generic programming is a huge idea; and it's been like, "well, the C++ people expect generics so we'll do some half-assed implementation to make them happy."

Metaprogramming in .Net has gone in a completely different direction.

58 posted on 02/02/2013 10:27:10 PM PST by FredZarguna (VB and Objective-C: because you should only be allowed to program with a rich man's toy language.)
[ Post Reply | Private Reply | To 51 | View Replies ]


To: FredZarguna
C, C++, C#, Java, Pascal, Object Pascal are all Algol-60 based languages,

So one could truthfully say that Al Gol is largely responsible for the Internet.
72 posted on 02/03/2013 4:48:33 AM PST by Dr. Sivana ("C'est la vie" say the old folks, it goes to show you never can tell. -- Chuck Berry)
[ Post Reply | Private Reply | To 58 | View Replies ]

To: FredZarguna; Delphster
The one place where NO language has come anywhere close to C++ even now is in template metaprogramming and Generics.

This is incorrect; Ada has a wonderful generic system.
subprograms can be parametrized on a type (or other functions, ranges, tasks, values, packages, etc.), as can packages themselves; wikipedia has an entry about Ada's generic-system on it's generic programming page.

The consequence of the above is you can make programs with a high amount of safe reuse (decomposing common elements); for example:

  1. You can define an interface (or abstract base-type in Ada 95/2005/2012) for operating on via PostScript,
  2. You can make a generic package defining a type which uses the interface from #1,
  3. You can make another generic package defining a [type of] stack, instantiate it using objects of the interface from #1,
  4. you can make another generic package which takes the package [from #3], defines four [IIRC] stack-variables (two for working, two containing "dictionaries" for functions), and operations thereon
  5. and another containing the [rest of] general postscript commands
and you'd have a PostScript interpreter.


Now some people think that the template/metaprogramming ability is more powerful than the generic facility of Ada because it is Turing-complete; this is actually quite a step backward WRT safety -- because it is Turing-complete you can state your problem in the template itself, which is not guaranteed to finish (precisely because it is Turing-complete).

78 posted on 02/03/2013 12:09:42 PM PST by OneWingedShark (Q: Why am I here? A: To do Justly, to love mercy, and to walk humbly with my God.)
[ Post Reply | Private Reply | To 58 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson