Hacker News new | ask | show | jobs
by nnoitra 1315 days ago
No, you can't. How many dialects of C++ are there or of Java.
4 comments

> How many dialects of C++ are there

Dozens. The standard language has been through numerous revisions (C++ 2.0, 98, 03, 11, 14, 17, 23), with no doubt many more to come - each version is a dialect. And there have been dozens of compilers, all of which define extensions to the standard - some of those extensions are copied by other compilers (and may eventually end up in the standard), others are unique to that implementation - so each compiler (even each of its successive major releases) can be viewed as a dialect. And then there are dialects defined, not by the core language features, but by which features are used, by which external libraries are used, etc. One C++ programmer is addicted to esoteric template metaprogramming, another avoids templates and treats C++ as a slightly improved version of C. One C++ programmer uses every Boost library they possibly can, another refuses to use any third party dependencies. One uses exceptions and RTTI heavily, the other always turns them off. Aren’t those all effectively different dialects, even if they are both using the exact same version of the same tools?

And then there are entire languages defined as extensions of C++, such as Apple’s Objective C++, or Microsoft’s Managed Extensions for C++ and then C++/CLI and C++/CX - and also more modest extensions such as OpenMP

Considering C++ is an object-oriented extension to C, it belongs alongside other such extensions - most notably Objective C and D (and even, to a lesser degree, Java and C#) - and there have been other attempts at that which weren’t successful - aren’t they all (in a sense) C dialects?

Are Java and C# different languages, or just a trick with the name by Microsoft to avoid the requirements of Sun?

(I think that the difference between Java and C# is similar to the difference between Common Lisp and Scheme.)

So once upon a time they were very similar but over the years they drifted apart until they were as different as whales and elephants?
No, you can. It's like asking, "why make c# when Java already exists. Isn't it just another algol dialect with gc?"

The answer is, "because somebody made it because they weren't happy with what already existed"

A large factor in the push for C# was that MS was sued by Sun for their not-totally-compliant Java dialect, Visual J++, and had to drop it as part of a settlement.

They also had Visual J# which ran on .NET, allowing Visual J++ and Java programs to target that platform.

There is also a non-Microsoft open source implementation of Java on top of .NET, IKVM.NET - I was sad to see it die when its original developer lost interest (although I just learnt it has since been revived by others)
s/Lisp/Programming Language/g not `a programming language`.