Quote:
Originally Posted by Damien
I prefer using Int32 because I prefer the highlighting in Visual Studio for it  . As for var, there is little point in this case because I know the type of the variable, for the sake of clear code it is easier to explicitly declare it. Anyone reading the code will be very clear on what data type this is. (Also, Not everyone uses C# 3.5, which introduced Implicitly typed variables)
|
At the end of the day, it's your code, your choice, this is just how I've been taught by SAMS, Microsoft and tutorials across the web
The main advantage of using var is that unlike VB, it doesn't mean 'Variant' - CSC actually determines the most appropriate type for it based on your code - meaning less error margin. (i.e. say I used an integer then later in the code parsed values of over 2,147,483,648, it would auto assign it to be a double)
And I think you're getting your version numbers mixed, .NET 3.0 introduced C# 3.0 and .NET 3.5 is the most current version.
Quote:
Originally Posted by Damien
My example was writing to a String Builder which had a debug at the end. I changed it to console at the end. Probably should have added that.
|
That's fair enough

---------- Post added at 10:46 ---------- Previous post was at 10:44 ----------
Quote:
Originally Posted by danielf
|
Yeah - I chose Bubble Sort because from the basic programming challenges that were requested it's one of the simplest algorithms to use. By far not the fastest, but simple and easy to understand.