|
|
Jim Crafton wrote: Good for you! I'm glad someone is out there, living on the edge, developing dangerously!
I don't even write code anymore. I just stare at the IDE and it gets written for me.
|
|
|
|
|
Chuck Norris? Why did you change your name?
|
|
|
|
|
|
Bloody Mac users....
regards,
Paul Watson
Ireland & South Africa
Fernando A. Gomez F. wrote: At least he achieved immortality for a few years.
|
|
|
|
|
Good one.
|
|
|
|
|
In Framework 3.5, i find the datatype "var" especially in LINQ samples, does this mean we are going back to the good old (or bad old) days of Visual Basic VB6 and earlier when any and every variable was of type Object.
I have been involved in converting some VB6 apps to .NET and its been a tough job finding out the actual datatype and moreover you cannot use the handy Property Browser facility.
|
|
|
|
|
var has its place, but the potential for misuse is very high, even among CodeProjectors.
I say, if you know the type, use the type; var is for when you don't or can't know the type.
|
|
|
|
|
var is NOT the same as a Variant from the old VB days. It is a statically inferred type that remains that type through the duration of its scope. It is not like the old VB variant where the compiler had to leave enough "space" for whatever type of variable you put in. This kind of typing has been done for years successfully in functional languages like scheme and ocaml.
|
|
|
|
|
Gadbad Singh wrote: does this mean we are going back to the good old (or bad old) days of Visual Basic VB6 and earlier when any and every variable was of type Object.
Not at all. var is just an unfortunate keyword for type inference[^], which is very different from dynamic typing with variants.
|
|
|
|
|
Wasn't there some rumbling about putting this in C++0xx sometime within the next millennium?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: Wasn't there some rumbling about putting this in C++0xx sometime
Yes, but the keyword is different[^]
Jim Crafton wrote: within the next millennium?
Blessing and curse of a mature and standardized language - changes come slowly.
|
|
|
|
|
It would have been better if they'd come up with a different keyword. I've seen lots of confusion over it - even if it's only short-lived confusion.
Kevin
|
|
|
|
|
That question has been answered so many times that is getting bored.
var != VB6VariantObjectType
|
|
|
|
|
why are you getting so "bored" , i have not said that
var != VB6VariantObjectType
i just mentioned that var is similar to Object in C# or VB which is way too confusing when it comes to guessing the underlying datatype, something similar to var used in scripting langugage jscript used in in html files.
|
|
|
|
|
It's not like object as the compiler does check for it's type. If it were an object the compiler would eat it if you assigned a string first and an integer later. variables declared as var can be quite useful when working with anonymous types in LINQ queries, in fact it is required.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
Read the docu about the var KEYWORD (see other comments) it's not RTTI... It's main use is for very long type names like "List<list><someobj>>>"
But the compiler "knows" the type at compile-time - so everything keeps strongly typed.
|
|
|
|
|
why..... because it's newer, newer = better (hopefully).
Ps. I'm in research
|
|
|
|
|
Yes..... but it is newer, so less people have it
|
|
|
|
|
Not really an issue within research I find...
|
|
|
|
|
Cameron_DeW wrote: but it is newer, so less people have it
Does it matter? The installer will get rid of this.
Best regards,
Jaime.
|
|
|
|
|
Yes, it does matter.
Since MS dropped support for Win2K with .NET 3.0, all our customers with Win2K could not be served if we used anything newer than 2.0, and there's still quite a lot especially in health services here in Germany.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: Yes, it does matter.
Since MS dropped support for Win2K with .NET 3.0, all our customers with Win2K could not be served if we used anything newer than 2.0
I agree 2.0 is still the best choice - supported on every system and has all the features typical developer needs. Plus most users (people eage 30-50 now) when buying software expect same looks as win 95 or 98 - aame datagrid look same dialog boxes and so on. 3.0 and later versions give developers cool new features like LINQ or XAML - no argue about that. You can make your app look like a xmas tree =] but this will confuse 99% of older users (they usualy own a company and they decide if a new software will be purchased =]). Also 2.0 works on Linux (haven't done any app for Linux myself but a lot of people do, it's a great way to expand your aplications "SUPPORTED SYSTEMS" menu ), higher versions are still not available - this will change but for now 2.0 is the only option.
|
|
|
|
|
mav.northwind wrote: Since MS dropped support for Win2K with .NET 3.0
Things are due to get murkier given that Silverlight 2 (effectively a subset of .NET 3.5) is slated to include Win2k as a target. They should really have kept Win2k targeting form .NET 3 or else not made VS 2005/.NET 2 available or Win 2k.
Kevin
|
|
|
|
|
I target 2.0, as it can reach more people....
What version do you target, why?
|
|
|
|