C#:
var Skoobideebop = new {UpperLeft = New Point{X = 0, Y = 0}, BottomRight = New Point{X = 5, Y = 5}};
So far we have:
1. Var shouldn't be used with primitives. This avoids possible mis-decleration.
C#:
var area = 25; //did I actually want a float here?
C#:
var myRect = new {UpperLeft = New Point{X = 0, Y = 0}, BottomRight = New Point{X = 5, Y = 5}}; //uuhh...that's a rectangle, I think. Lemme decihper that.
C#:
MyVeryLongGenericTypeName<MyVeryLongClassName> foo = new MyVeryLongGenericTypeName<MyVeryLongClassName>(...); //something.something.something.superlongclassname is another example of a long class name
//becomes
var foo = new MyVeryLongGenericTypeName<MyVeryLongClassName>(...);
I'm kind of going out on a limb with this to try and make something positive come out of this thread. Is there anything else? Can we make these better? Do some of these not belong?
Last edited: