Re: I freaking HATE var!!




"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:%23RD%23iYifHHA.5052@xxxxxxxxxxxxxxxxxxxxxxx
Not to marginalize your post, but your last statement pretty much axes all the effort you put into it:

If only it wasn't too late. The tsunami is coming. But our engineering team will NOT take the plunge into C# 3.0.

If you don't like it, don't use it, end of story.

While I won't, the basis of my frustration was the other coders--not myself. I know how to write good code. It's having to support the output of coders who code as if they just learned VBScript that is bothering me.

Outside of how you use it, and the engineering team that you work with uses it, what do you care if someone else uses it?

Because "it" very quickly dwindles into a proprietary standard.

It's not going to break any of the code you have now, so that's a non-issue.

Thank God. But I still hate var.

Your coding standards are going to dictate what you can use and how you name your variables, and your ecosystem will be preserved.

Yes, *my* coding standards. *Our* coding standards. But by our being forced to stick with v2.0 in order to avoid var,

a) our team would be forced to withhold ourselves from taking advantage of other 3.0 features than what var uses,

b) I personally, and the other engineers on our team, would be presented with an unpredicted and undesirable dillemma of whether to offer engineering services, whether to the public or to an employer, as a C# 2.0 purist or as a C# 3.0 cutting edge Microsoftie who drinks all the kool aid that gushes out of the fountains of Redmond and participates in the very bandwagon that will ultimately make a mess of the output of C# coders everywhere, and

c) put in context, the point was, add us to the list of people who don't subscribe to the appreciation of 'var'. "Don't like it, don't use it," phooey, what are you doing here? I'm here to discuss this sort of stuff--even if in a monologuish soapbox stance. :p

However, in order to get projections to work, there is no way around var.

Yes. There is. Auto-generate the inferred type information directly in the code rather than at compile time. Actually, you and others talk as if projections were a necessity in themselves. What I'm getting at is, if 'var' is the necessity of a new feature, my hatred of 'var' is greater than that feature. I loved the LINQ idea, but that was when I heard about C-Omega as C#-based language, not as C# v3, supposed successor to the language I work with everyday.

Granted, having VS.NET wire up the code for you in known types will be nice (and it should do something like this, converting projections/anonymous types to known-types), but the amount of code you would have to write by hand if you didn't have VS is enormous, and they can't depend on the IDE to pick up where language features fail.

That doesn't make sense to me. I see var as the failure. But at least we agree that VS should try to auto-populate "var" with known types.

I agree that those that use var when they know the type of what is being used (and yes, even in the case of those long generic types, use the using directive to alias it instead) should be skewered, but really, it's not that bad.

Not that bad? I spend half my coding time already pulling my hair out looking at other people's lazily written or generated code--XML node or Control lookups that should have been referenced by name or ID are instead referenced by index, referenced ASP.NET control names plopped in with namespace of "uc1" rather than origin, variable names as numbered type names rather than purpose, little "thorn in the side" things that make my job one minor bit less enjoyable. And now 'var'? Ugh.

It's also Friday, I'd save this kind of rhetoric-filled post for Monday. That's what Monday's are for.

LOL .. well we differ here :) I use the weekends to zoom out and ask myself questions like what the heck am I doing it all for.

....


.



Relevant Pages

  • Re: How effective is SW training from VARs?
    ... I love my VAR but after attending quite a few MasterCam ... the the "winner" of the CAD market. ... sales advantage. ... long time SW users) about some of the more advanced features and there ...
    (comp.cad.solidworks)
  • new here, my lang project...
    ... afaik this group is about programming, oo, and programming language design. ... var a=pool; ...
    (comp.object)
  • Re: isnt there anything like typedef in C# like c++
    ... you would only need the type specified in the actual cast of the value used to ... I believe we don’t have var in there. ... And I heard it was introduced becuz of the Linq extensions to the language. ... C# has a lot of things that C++ doesn't have, and in large part _because_ of design decisions in the language that result in this kind of difference existing. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: I freaking HATE var!!
    ... You can eschew var, as well as extension methods, and the syntax that translates queries from the C# 3.0 language and actually chain the static method calls yourself, passing anonymous delegates and known types as the return. ... There are ALWAYS going to be new technologies that are coming out and you, being a professional in the field, will have to decide on how you want to leverage those technologies in what you do to provide for how you make a living. ... What I'm getting at is, if 'var' is the necessity of a new feature, my hatred of 'var' is greater than that feature. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: I freaking HATE var!!
    ... of other 3.0 features than what var uses, ... the syntax that translates queries from the C# 3.0 language and actually ... There are ALWAYS going to be new technologies that are coming out ... greater than that feature. ...
    (microsoft.public.dotnet.languages.csharp)