Re: I think C# is forcing us to write more (redundant) code
- From: Lasse Vågsæther Karlsen <lasse@xxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 11:01:49 +0200
Neo The One wrote:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.'
If you are interested in what I mean, please look at this feedback my me:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3074c204-04e4-4383-9dd2-d266472a84ac
If you think I am right, please vote for this feedback.
Thanks.
Since the local variables are not guaranteed to be initialized to anything specific, moving this to a warning will guarantee that there's a lot of projects that will have strange crashes.
Since .NET has mechanisms built in to make sure data is always valid, and never inconsistent or corrupted (hence the need to initialize local variables), a warning will never be enough as a warning can be ignored, with unforseen consequences.
The effect on the garbage collector if you start to treat random memory adresses as .NET objects is probably the main reason for this.
So yes, I voted, but I voted 1.
If you want a change to the .NET compilers, you should add a suggestion that all local variables are zeroed out instead.
.
- Follow-Ups:
- Re: I think C# is forcing us to write more (redundant) code
- From: Neo The One
- Re: I think C# is forcing us to write more (redundant) code
- References:
- I think C# is forcing us to write more (redundant) code
- From: Neo The One
- I think C# is forcing us to write more (redundant) code
- Prev by Date: Can it Single Sign On on different machines?
- Next by Date: Re: I think C# is forcing us to write more (redundant) code
- Previous by thread: I think C# is forcing us to write more (redundant) code
- Next by thread: Re: I think C# is forcing us to write more (redundant) code
- Index(es):
Relevant Pages
|
Loading