DIP 1031--Deprecate Brace-Style Struct Initializers--Community Review Round 1 Discussion

jxel jxel at gmall.com
Sun Feb 16 01:18:13 UTC 2020


On Saturday, 15 February 2020 at 23:54:17 UTC, Walter Bright 
wrote:
> On 2/15/2020 6:39 AM, Steven Schveighoffer wrote:
>>  From the perspective of the user, the complications in the 
>> compiler or library are of zero significance.
>
> The complication is in the language. This affects the user:
>
> 1. the language is larger
> 2. user has to decide "should I do it the A way or the B way?"
> 3. documentation is longer
> 4. anyone writing a book/tutorial on D has to become proficient 
> with it
> 5. introduces bugs (such as the one just noticed that the { } 
> allows access to private fields)
>
> It is not at all zero.

You could remove quite a few features, and prevent new ones for 
those reasons. Named parameters to start, especially with the 
current DIP that just introduces complexity for very little 
benefit and increases the burden on library authors to maintain 
compatibility. The new @live attribute, that's going to add way 
more complexity. The "in" and "out" qualifiers aren't really 
needed, and kind of useless and redundant. The ?: operator, don't 
really need it, just use a normal if statement. The "const" 
qualifier could be removed and nothing of significance would be 
lost, no body uses it anyway. Interpolated strings as well, its 
just syntactic sugar. The in and out contracts, there's a bunch 
of bugs with those and really just having asserts in the body of 
the function provides basically the same functionality. I don't 
really see anyone using that feature. I'm sure I could go on with 
some more. Deprecate 'real', it should be a 128 bit float, no 
body uses 80 bit floats and just having it be the largest 
possible dp unit is just repeating c's mistakes. Anyways for sure 
now, there's probably more features that you could remove for the 
same rationale you are giving as this one. D has numerous issues 
with not following private. Its cause its not something that 
someone pays attention to. I forget if allMembers was updated to 
not all private access.or to allow it, either way its not just 
this one feature that breaks private.


More information about the Digitalmars-d mailing list