Search code examples
cd

What makes D a good language?


My professor recommended I do my senior capstone in D. What can it be used for? What makes it good? He compared it to C/C++ and said it's better. Why?

This post just makes D less attractive to work with:

Why isn't D picking up?


Solution

  • Compared to C and C++, it is safer, meaning that it cannot create the same sorts of segmentation faults by accessing uninitialized or disallowed memory. It also wouldn't allow misunderstanding object types like C/C++ casts can do with pointers and explicit memory allocation and deallocation. This makes the language "cleaner" feeling in some sense.

    Prior to C++ standard version 2008, D also supported better delegation. Nowadays C++ is pretty close to D delegation capabilities by providing perfect forwarding.

    D delegation: http://www.docwiki.net/view.php?pageid=97

    C++ perfect forwarding: https://www.justsoftwaresolutions.co.uk/cplusplus/rvalue_references_and_perfect_forwarding.html