Worst ideas/features in programming languages?
Timon Gehr
timon.gehr at gmx.ch
Tue Oct 12 22:23:41 UTC 2021
On 10/12/21 11:50 PM, surlymoor wrote:
> On Tuesday, 12 October 2021 at 21:38:48 UTC, Timon Gehr wrote:
>> - .init
>
> Is the issue default initialization or that the property is named `init`?
Uninitialized variables are not an option, so default initialization
and/or some flow analysis unfortunately seem to be necessary given the
limited nature of D's lexical scoping rules. The issue is that every
user-defined type is by default assumed to have a default state. It's
null pointers with extra steps. I'm not a big fan of the possibility of
accidentally hiding a type's `init` using a user-defined field, but this
is a lesser issue and at least this way it can be @disabled, though I am
not absolutely sure that this completely denies access.
More information about the Digitalmars-d
mailing list