Does D have too many features?
Timon Gehr
timon.gehr at gmx.ch
Sat Apr 28 13:24:33 PDT 2012
On 04/28/2012 08:47 PM, Walter Bright wrote:
> Andrei and I had a fun discussion last night about this question. The
> idea was which features in D are redundant and/or do not add significant
> value?
>
> A couple already agreed upon ones are typedef and the cfloat, cdouble
> and creal types.
>
> What's your list?
- Associative array literals as non-associative array initializers [1]
- C style array declarations [2]
- 'align' declaration [3]
- 'synchronized' [4]
- special treatment of built-in types during parsing [5]
- the arcane restrictions on which exact kind of argument can be
used to substitute which kind of template parameter
I think all other language features are useful and except for new
instance.Class and 'this' template parameters, I think they all occur in
my code. (But those would certainly come in handy for a somewhat more
OO-like style of programming.)
(There are a few features that I'd like to give a (mostly syntactic)
overhaul, but that is not what is discussed here.)
Explanations:
[1] Actually I think the functionality is very useful, but the syntax is
probably confusing for many fellow D programmers. CTFE should enable a
library implementation.
[2] They violate the 'same syntax, same behaviour' rule, and they don't
add a lot of value.
[3] I have not understood until now what exactly the guarantees are that
it gives, so take this with a grain of salt. I know that it is not
useful as implemented DMD for typical alignment tasks, and that GDC
implements different semantics. Can you explain to me what it is useful for?
[4] It adds memory overhead for the monitor to every single class, even
though most classes are explicitly _typed_ as unshared.
[5] It is for example impossible to directly string mixin "int".
More information about the Digitalmars-d
mailing list