How does D improve design practices over C++?

Jesse Phillips jessekphillips at gmail.com
Fri Nov 7 15:31:22 PST 2008


On Fri, 07 Nov 2008 16:09:58 -0600, Tony wrote:

> "Janderson" <ask at me.com> wrote in message
> news:gf0hf3$9nf$3 at digitalmars.com...
>> Tony wrote:
>>>> "Janderson" <ask at me.com> wrote in message
>>>>> Also #defines really arn't a problem for cpu at compile time, your
>>>>> right there.  I'm trying to point out that using #defines for const
>>>>> is totally rediculus (sorry for being so harsh).  No C++ book or
>>>>> expert would recommend it and it doesn't result in any run-time
>>>>> optimisation what so ever.
>>>>
>>>> Obviously I take language feature "recommendation" with a grain of
>>>> salt. I do #define because I've never had any problem with it (and
>>>> look at the Windows header files sometime!) and #defines don't create
>>>> a data object in memory. It's simply never been a problem. Now if one
>>>> is "hell bent/anal" about "doing away with the preprocessor, power to
>>>> them, "it ain't me" though. I don't want the template machinery
>>>> taking over the capability of the preprocessor: I use it to mutate
>>>> the language and experiment. I will probably implement a preprocessor
>>>> to replace or add to what I have with C++ before I jump into compiler
>>>> development for my language that is evolving.
>>
>>
>>
>> It seems you might need to think outside of the C++ box.
> 
> That's an odd statement considering that I came here to investigate D
> and am defining what to put into my own language (or one I wish someone
> would implement) because of the issues I have with major "features" of
> C++ (and D).

It sounds to me that D is not the "improvement" over C++ you are looking 
for. It sounds like you have done a lot of work in C++ and developed good 
coding practices for yourself and probably those you work with. I would 
guess that it has taken some time to develop the design habits you use.

It seems to me that the improvements D gives you have already worked out 
through convention in C++. D presents a much clearer path on what 
conventions should be used in programming. D provides other benefits, 
such as GC, that it appears you are not looking for.

I say D is not for you because, from what I have read, you are looking to 
have features removed. I see complaint after complaint about D/C++ having 
something you don't want to use, but very little/none on what you 
actually want added to the language. Take GC for example, rather than 
saying, "I don't want it" you can go with, "I want total control of 
memory management" If you still don't want to learn how to manipulate the 
D GC, then D is not for you.

I might suggest not commenting on something you find unimportant, if 
"stronger const" is insignificant, then ignore it and move on.



More information about the Digitalmars-d mailing list