How does D improve design practices over C++?
Janderson
ask at me.com
Thu Nov 6 20:19:22 PST 2008
Tony wrote:
>>
>> In C++ its standard practice by most programmers to disable the copy
>> constructor for many of the classes they create. Some companies it
>> mandatory to either disable it or implement one.
>
> I do that too: I "disable" (declare private and don't supply an
> implementation") the compiler-called class functions by default when
> designing a class and putting them back if they are needed.
>
You are repeating what I just said. The point is D its opt in rather
then opt out which is the point of the original thread "improve design
practices". In C++ if you didn't know you had to do that its something
you'd need to learn. In D its not.
C++ is a huge language, and not many know the entire language. Case in
point, you didn't know what Delegates where yet many C++ programmers use
them frequently. Its better if the language makes it easy rather then
requiring the programmer to do something to be correct. Just like
expecting an email program to have spell check your emails. Modern
languages should do the same.
-Joel
More information about the Digitalmars-d
mailing list