Does D have too many features?

bearophile bearophileHUGS at lycos.com
Sat Apr 28 13:00:52 PDT 2012


Walter:

> which features in D are redundant and/or do not add significant 
> value?
>...
> What's your list?

Finding things to remove now from D is hard, in my code I have 
used most D features now. And many suggestions I have seen in 
this thread are very bad, like removing foreach_reverse (that I 
use often), or "Phobos is too fat" (that is the opposite of what 
I'd like, I'd like D with more batteries).

The features I have not used in my programs so far are:

1) Typesafe Variadic Functions for class objects (never used so 
far).
2) >>>=  >>> (Never used so far).
3) Floating point comparison operators (never used).
4) Delimited Strings / heredoc strings (never used so far in real 
code, despite Perl programmers use them now and then).
5) lazy (as function argument. I have used "lazy" in some test 
programs, but not in real code so far).
6) Anonymous classes (used only in demo code so far).
7) Shortened floating point literals as .6 or 6.


Other things that I don't like:
1) Mixed C/D array declarations 
(http://d.puremagic.com/issues/show_bug.cgi?id=5807 )
2) I'd like to disallow (or fix!) default arguments of out and 
ref arguments (http://d.puremagic.com/issues/show_bug.cgi?id=5850 
).
3) Automatic joining of adjacent strings (a bug-prone 
anti-feature: ["red" "green", "blue"]).
4) Comma operator, it gives more troubles than flexibility.
5) The most complex parts of the is() syntax (to be replaced with 
other things).
6) Two kinds of tuples. I'd like a single tuple type in a 
language, but I understand this is hard to do.

-------------------------

I'd also like to see some limits removed like:

struct Foo {}
void main() {
   auto f = new Foo; // currently not accepted, silly
}


BigInt x;
switch (x) {
   case BigInt(0): break;
   default:
}


And I'd like some features added/improved, like:
- tuple unpacking syntax;
- computed gotos;
- a static foreach 
(http://d.puremagic.com/issues/show_bug.cgi?id=4085 );
- attribute hiding error or warning 
(http://d.puremagic.com/issues/show_bug.cgi?id=5187 );
- safer typesafe variadics 
(http://d.puremagic.com/issues/show_bug.cgi?id=5212 );
- Named arguments;
And few other things.

Bye,
bearophile


More information about the Digitalmars-d mailing list