Things that may be removed

Nick Sabalausky a at a.a
Tue Dec 23 18:43:27 PST 2008


"Don" <nospam at nospam.com> wrote in message 
news:gio27n$2o0f$1 at digitalmars.com...
> bearophile wrote:
>> There are some things I'd like to see added to the D language, but what 
>> things can be removed from it?
>>
>
> * C-style declarations

I certainly wouldn't mind seeing these go. But then, I haven't tried to port 
much C/C++ code to D.

> * \n, \r as a string (free up the backslash character)
> * #line (make it a pragma instead)

Agreed.

> * Octal (it's not 1952 any more)

Disagree. Octal can often useful on low-level embedded stuff. Heck, I've 
worked on a recent microcontroller where even base-4 was extremely handy. If 
anything, I'd recommend adding base-4 to D, and certainly not removing 
octal.

> * the comma operator (allow in selected places, eg for(; ;++a, ++b)).
> * Object.toString(). Encourages bad design. It's not powerful enough to be 
> useful.

What is the problem with these?

> * The postincrement and postdecrement operators (make x++, x-- identical 
> to ++x, --x, except that it is illegal to use the return value. Allowing 
> operator overloading of the postfix operators was a silly hack in C++. 
> It's a freedom nobody wants).

I'm certainly not a fan of post??crement. They lead to confusing 
code/results. Plus, I don't know if this is still relevent, but back when I 
was using C++, doing "foo++;" instead of "++foo;" on a non-primitive was 
considered bad because (IIRC) it created a useless temp copy (or something 
like that). Granted, I'd much rather type "x++" than "++x", but the behavior 
of post??crement is something I could certainly do without.





More information about the Digitalmars-d mailing list