Initializers are Evil!

nazo lovesyao at gmail.com
Thu Jun 21 05:16:47 PDT 2007


I think that this is better for disable-initialization:
class Foo
{
  auto number = int.void; //assign nothing
}

mandel さんは書きました:
> Initialization is a good way to prevent undefined behavior.
> But you can also disable initialization when you assign void:
> class Foo
> {
>  int number = void; //initialization disabled
> }
> 
> nazo Wrote:
> 
>> I don't like initializer because need to remember two grammars.
>> dmd already support many literals so can replace initializers easily 
>> with expressions, I think.
>> Most script languages like Javascript don't have any initializers.
>> Why special-case initializers?
>>
>> #Sorry for my poor English
> 



More information about the Digitalmars-d mailing list