digitalmars.D - D better than c++?
- ert (1/1) Mar 22 2006 how is D better than c++? any comments appreciated
- David Medlock (12/14) Mar 22 2006 1. Inner functions!
- clayasaurus (2/5) Mar 22 2006 http://www.digitalmars.com/d/sdwest/
- Hasan Aljudy (24/27) Mar 22 2006 D's syntax is simple, elegant and consistent. For example, the template
how is D better than c++? any comments appreciated
Mar 22 2006
ert wrote:how is D better than c++? any comments appreciated1. 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
ert wrote:how is D better than c++? any comments appreciatedhttp://www.digitalmars.com/d/sdwest/
Mar 22 2006
ert wrote:how is D better than c++? any comments appreciatedD'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