Is C# Putting On Weight?

by bob on July 7, 2007

Sometimes I wonder if the constant march of technological “progress” (or churn, or whatever you want to call it) isn’t getting in the way of making actual mastery of the technologies we work with possible. I realize it’s an article of faith amongst card-carrying uber-geeks that rapid change is a necessary part of the landscape and that the really Smart People stay awake nights surfing the zeitgeist. A case in point is the evolution of C# from its humble beginnings as a solid OO language to its impending wannabe status as a functional programming language.

I just read this hilarious post (via Joel.Reddit.com) and have to say that this fellow managed a balanced treatment of the topic. Couldn’t have done better myself, even if I weren’t swimming in Too Much Work. I highly recommend that you spend 10 minutes chuckling over it.

I tend to lean this way: most of us (call us Morts if you insist) will just continue using C# in straightforward ways, adopting some of the new functionality here and there without going crazy with it. People who write open source and commercial libraries, ORMs, and the like, will be the ones to plumb the depths of the ever-expanding C# landscape and those of us who are mere mortals with real jobs will rely on them to put sensible wrappers around the esoterica.

I don’t expect C# to force some kind of bizarre advanced lambda syntax on me unless I ask for it, so I don’t see it as a huge problem. In a way it’s nice that the extra horsepower is there, waiting for time of need. I welcome it, for the most part.

{ 4 comments… read them below or add one }

Marcelo July 9, 2007 at 7:33 am

In the immortal words of Jack Nicholson, portraying The Joker ( since we’re in a jocular mood, what better reference ), “This town* needs an enema”. Where * means language, and that language being C# 3.0. Lambda expressions ? When did the Haskell Curry fanatics take over the asylum ? They spend years in college trying to pound recursion, functional programming is the force ( use it, save you it can !) of all things. Recursion has it’s place, still I’ve only found the necessity to resort to do things recursively perhaps 1% of the time. Seriously.

Type inference is cute, but cute wears out. You save what, some typing in a variable declaration for the most part, c’mon, get real. And Lambda expressions, they’re just more window dressing, and remember, most of the time more, is just that, more.

Yet again, take something straightforward, and in my opinion elegant, and munge it up once more. Way to go MS, smooth move.

Merit July 12, 2007 at 6:41 am

Type inference is more than a cute hack to save typing, its really in there to make LINQ work. When you’re doing something like:

var deadbeats = from Customers
select Name, Address
where Balance > 1000;

(excuse the syntax, I haven’t played with it in a while)

What is the type of deadbeats? Its some new type you just created right there. You could probably come up with a way to declare it but it would be really ugly.

On the other hand I’m sure we’ll see abuse of var. I had a CS professor who started writing C# like this:

for( var i = 0; i

Marcelo July 23, 2007 at 7:19 am

Precisely why I think it’s a bunch of hoo-ey ( or as they say in Texas, the Southern output of a Northern bound bull ).

It’s the “Visual-Basic-izing” of a what has otherwise been an elegant and tres-useful programming language. Of course you’ll see “var” abused, and yet again, C# will become the laughing stock of all the java weenies.

Maybe someone really needs to sit and ask themselves, “What the hell was SO wrong with typecasting”, and for that matter if you want an object of type X from one of type Y that derives from type X because you only need interfaces of of type X, then just declare another variable of type X that set the Y object to it, and call it done. The only “gotcha” is if you had the silly notion of upcasting. Foolish Mortal, if you wanted to do that, pass the original type around.

Dave August 23, 2007 at 6:49 am

To mine opinion c# is growing a bit to hard. Why you might ask? Well, my problems aren’t only targetted to Windows environments. I also write a lot of Linux system utilities running on the Mono CLR.

Despite the developers of the Mono project are working (very) hard to implement as fast as possible new language features. They are always behind the official release of Micrsoft itself.

I also never use the ‘var’ variable. You should know what a linq query should return. In most cases IEnumerable. Luckily the compiler is smart enough to replace the ‘var’ variable with the correct type.

Leave a Comment

Previous post:

Next post: