C# forces you to set a default value for out parameters, and I
personally find it annoying. The very nature of out parameters is
often that you use it in a situation where there *may* be a
result. Again using a C# example, 'bool
Dictionary.TryGetValue(key, out foo)'. I don't care what the
value of foo is if that returns false, yet the method still has
to manually initialize it to what that particular implementation
feels like (which is not guaranteed to be any particular value).
I prefer D's approach where you have a guaranteed value that it
gets default initialized to, and don't have to manually
initialize it to some value if it doesn't make sense to assign a
value.
- Re: Not initialized ou... Walter Bright via Digitalmars-d
- Re: Not initializ... Jonathan M Davis via Digitalmars-d
- Re: Not initializ... bearophile via Digitalmars-d
- Re: Not initi... bearophile via Digitalmars-d
- Re: Not initi... Jonathan M Davis via Digitalmars-d
- Re: Not initializ... Walter Bright via Digitalmars-d
- Re: Not initialized out argument e... Timon Gehr via Digitalmars-d
- Re: Not initialized out argume... bearophile via Digitalmars-d
- Re: Not initialized out ar... Walter Bright via Digitalmars-d
- Re: Not initialized out argume... Jonathan M Davis via Digitalmars-d
- Re: Not initialized out argument error Kapps via Digitalmars-d
- Re: Not initialized out argument e... Jesse Phillips via Digitalmars-d
