3 ms·
Seems a bit like apples and oranges, no? If someone's going to use a language with a GC, why not go and use a full blown VM powered language in the Java or .NET
by iam 15y ago
Seems a bit like apples and oranges, no? If someone's going to use a language with a GC, why not go and use a full blown VM powered language in the Java or .NET ecosystem?
The advantage of C++ is knowing exactly what happens when, and being able to tightly control the memory footprint. If that's not the requirement, I see no reason to spend extra effort on the language's verbosity.
That being said, the only feature D seems to really have that C++ doesn't (besides gc) is compile time reflection aka traits (granted, it's possible to derive some of those like boost traits, but for others like virtual function detection it's impossible without compiler support).
- bad_user 15y agowhy not go and use a full blown VM Because you may not need a full blown VM; also D allows for manual deallocation of memory if you seek predictability, something that full-blown VMs like the JVM or CLR cannot do. C++ is still used for applications development a lot, in instances where people recommend these full-blown VMs. And while companies/individuals are naturally conservative, this also does say something about the viability of Java/.NET for development of applications. I would also add here that I've never seen a Java application that I liked, or that .NET has a stigma attached so that many people won't touch it with a ten-foot pole. D is somewhere in the middle of Java and C. It is low level enough to provide predictable behavior with little overhead, but it is also high-level enough to be comfortable and does guard (somewhat) against shooting yourself in the foot, in many cases in which C++ does not. the advantage of C++ is knowing exactly what happens when But you don't know exactly what happens and when in C++, this being one criticism against it -- in some instances D even has more predictable behavior. I see no reason to spend extra effort on the language's verbosity. It's not the language verbosity that's an issue with C++ ; it's more about many constructs being hard to use and error-prone. D fixes some of that. It's also about the C++ language being hard to parse, that only companies with big budgets like Microsoft/Borland can produce usable IDEs. It's also so hard to parse that you'll always find inconsistencies between compilers and this is also why the world has standardized on only 2 compilers: GCC and Visual Studio, while using anything else (while wanting to maintain compatibility) is seriously asking for trouble. Not that D has many compilers (it doesn't) but its syntax was specifically designed to be easier to write tools for it.