Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: dan1123
You can use var instead of a type and the compiler will infer the type (aka duck typing).

I see, new for version 3.0. I wonder why they put it there. The example is bad IMHO, because you should know the types you're getting from the database. There goes Microsoft, always wanting to add more features, screwing things up in the process.

77 posted on 07/07/2009 4:52:52 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 76 | View Replies ]


To: antiRepublicrat
There goes Microsoft, always wanting to add more features, screwing things up in the process.

I was trying to think of a good use of that in a statically typed language, but everything I thought of had pitfalls and better solutions through inheritance, generics/templates, or other type-safe methods.

79 posted on 07/07/2009 5:08:13 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 77 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson