www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D better than c++?

reply ert <ert_member pathlink.com> writes:
how is D better than c++? any comments appreciated
Mar 22 2006
next sibling parent David Medlock <noone nowhere.com> writes:
ert wrote:

 how is D better than c++? any comments appreciated
 
1. Inner functions! 2. Garbage collection. 3. True modules. 4. More powerful templates(more parameter options/static if/is...) 5. Object references instead of pointers. 6. True array/string support. 7. Foreach iteration 8. Delegates. 9. Explicit casts. Did I mention inner functions? :) -DavidM
Mar 22 2006
prev sibling next sibling parent clayasaurus <clayasaurus gmail.com> writes:
ert wrote:
 how is D better than c++? any comments appreciated
 
 
http://www.digitalmars.com/d/sdwest/
Mar 22 2006
prev sibling parent Hasan Aljudy <hasan.aljudy gmail.com> writes:
ert wrote:
 how is D better than c++? any comments appreciated
 
 
D's syntax is simple, elegant and consistent. For example, the template syntax doesn't look any different from say, classes or functions. In D, you don't need header files. Just write your functions, and if you need them in another file, just import the original file. You don't need forward references. Write your functions/classes in any order you like!! Classes are written in one block (like Java). No :: or -> operators. Only the dot '.' is used, whether you're referring to a static function, an object reference, a struct pointer, a namespace, or anything like that, you just use the '.'. Writing code is just so simple and easy with D. You just type your code away, without having to worry about any of the crap that C++/C gives you. Namely, * You don't need to split your definitions across multiple files. * You don't need to worry about the 'lexical order' of the definitions. D is also simpler to parse than C++ (by magnitudes). This makes possible for a set of helper tools, like the build tools, which reads your main source file, and automagically determine all the dependent files that need to be compiled. So you don't need to maintain a make file. If you have a large project with 50 files or more, you just need to call build and pass it the file that contains the main function. (That's a bit of a simplification, it's the general case, although there maybe some corner cases, but they are easy to deal with).
Mar 22 2006