From documentation:
Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them
var i = 5;
var s = "Hello";
var d = 1.0;
var numbers = new int[] {1, 2, 3};
var orders = new Dictionary<int,Order>();
Is it me or does this take maintainability way down (especially when you through in a few 10's to 100's line of other code - what was s again? Now we get back to declaring objects:
strUser;
intID;
objWorkflow
decAmount;
Yeah - it's a pain enough to deal with in JavaScript - I don't really want to have to support this in compiled code too! Readability goes threw the floor, and if somebody has commented well or has a poor naming convention - good luck buddy!
Also they don't mention what happens if you do this:
Does it throw a compile error? a run-time error? accept it?
Listen, I'm all about new features for increased output, but honestly - this is a step backwards when you think that a majority of the cost of an enterprise application isn't spent initially building it, but maintaining and extending it over time.
In fact I'd really like to see what all the 'features' of C# 3.0 are truely for - the way C# works now is pretty darn good IMNSHO and I'm a big believer in 'if it ain't broke don't fix it'. What are the business objectives being solved by these new features? Who really benifits? What is it doing now that can't be done currently? Is the current work arounds that these are solving that much trouble? How much of maintnance nightmare is going to cause? In otherwords a problem now I know what to look for, but now if that problem can be caused by doing some 1.1 way, 2.0 way, and 3.0 way - I have to look for 3 differant programming styles for a bug rather than one.
Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them
var i = 5;
var s = "Hello";
var d = 1.0;
var numbers = new int[] {1, 2, 3};
var orders = new Dictionary<int,Order>();
Is it me or does this take maintainability way down (especially when you through in a few 10's to 100's line of other code - what was s again? Now we get back to declaring objects:
strUser;
intID;
objWorkflow
decAmount;
Yeah - it's a pain enough to deal with in JavaScript - I don't really want to have to support this in compiled code too! Readability goes threw the floor, and if somebody has commented well or has a poor naming convention - good luck buddy!
Also they don't mention what happens if you do this:
Code:
var s = "Sam";
//50 lines of code
s = 0D; //notice I changed it to decimal
Does it throw a compile error? a run-time error? accept it?
Listen, I'm all about new features for increased output, but honestly - this is a step backwards when you think that a majority of the cost of an enterprise application isn't spent initially building it, but maintaining and extending it over time.
In fact I'd really like to see what all the 'features' of C# 3.0 are truely for - the way C# works now is pretty darn good IMNSHO and I'm a big believer in 'if it ain't broke don't fix it'. What are the business objectives being solved by these new features? Who really benifits? What is it doing now that can't be done currently? Is the current work arounds that these are solving that much trouble? How much of maintnance nightmare is going to cause? In otherwords a problem now I know what to look for, but now if that problem can be caused by doing some 1.1 way, 2.0 way, and 3.0 way - I have to look for 3 differant programming styles for a bug rather than one.
Last edited: