Why I love C++

Pages: 12
@Fredbill30: then why did I come back to C++?
closed account (S6k9GNh0)
I think I could deal with D if it wasn't so integrated with the garbage collector. Some people will tell you you can remove the GC but the likelihood that the code based on the loss of the GC is bugged is so high, it's ridiculous and removes any reason to have high-level syntax. For instance, replacing GC functions with malloc stub functions will result in implicit memory leaks since almost the entire std library allocates memory than leaves to never even give the GC hints (even when able too). Some things aren't possible without the GC which is fine (and could be fixed without a GC as well but that's another topic) but when you use those mechanism, they don't emit any errors or warnings since no compiler at the moment is smart enough to tell you the problem.

So the result is that in order to use D reliably without a GC, you are required to remake the entire runtime and std library which is no small task. You could then just make error stub functions that will provide clear messages when something isn't supported (or available without a GC or memory management mechanism).
Last edited on
closed account (N36fSL3A)
L B I think its because the D wasn't enough fulfill your needs.
D is a great, elegant language. Its library is also very nice, making the C++ standard library seem crude and limited (poor filesystem support, no memory mapped files, no arbitrary precision arithmetic, few algorithms). And then it also has libraries for XML, MD5, ZIP, sockets.

The main reason why it didn't replace C++ is because C++ has eons of momentum buildup. It otherwise is a poorly designed low-level language, trying to seem high-level.

And for those who don't like the GC in D, no offense but you probably sound a lot how early C++ programmers sounded, defending stdio.h and refusing to use C++ streams.

GC is the better way, especially if D tries to become functionalish. Might as well get over it.
Last edited on
RAII is the better way. And personally I hate stdio.h. Also, I don't think you can bash a language for having a small standard library - there are other libraries (eg Boost) that can easily do hat you want them to do fr you.
RAII is not enough to do real functional programming.
GC + automatic resource management blocks are the better way.
^ Agreed. I wouldn't want to be managing memory in an FP language, it just gets in the way.
Topic archived. No new replies allowed.
Pages: 12