Docs: Section on local variables

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sun Apr 22 01:46:47 PDT 2012


"Jakob Ovrum" <jakobovrum at gmail.com> wrote in message 
news:tavnewhepsyaqfsyngmv at forum.dlang.org...
>
> I've used C# a fair bit too, and this has never even happened to me (not 
> in Java either using Eclipse). Of course, this is just a personal 
> anecdote, but if anyone has had problems with the CFG approach in these 
> languages, I'd like to hear more about it.

Yea, I don't think I've even seen that occur or heard of a case of it 
happening. Of course, I'm sure *someone* has done it at some point (What 
*hasn't* been done?), but it's just doesn't seem to be the natural knee-jerk 
reaction Walter has voiced concern over it being.

I dunno, maybe it's a culture issue. One of the key characteristics of C# is 
"safety before convenience/performance". So maybe C# people are just more 
likely than others to be the "look before you leap", "meaure twice, cut 
once" type. Just speculating, of course.

> As it stands the claim that people would be tossing in half-assed explicit 
> initializers all the time is simply not the reality. Even if the compiler 
> gets it wrong once in a blue moon, I would happily trade that for the 
> massive benefits it gives you in writing readable, maintainable code.
>

As would I.

On the rare occasion when I would get a false error from C# on that, any 
instinctual twinge of annoyance was quickly diffused by the thought of 
"Well, better to have it conservative like this than risk silent errors in 
other places." So if that means once in a while it's gotta say "Umm, hey, 
uhh, is this really correct? Yea? Ok, just making sure." then that's 
perfectly fine by me.

> I don't think this ship has sailed for D. If it were to be implemented, 
> you could easily transition into it slowly like @property.

Well, I'll be happy if you're right about that ;)

> Also, the same implementation could be used to solve the problem of 
> statically checking when const/immutable constructors are cooked/baked, 
> which remains an unsolved problem.

I'm not sure I understand what that is.




More information about the Digitalmars-d mailing list