C# version 3.0

I like C#. It’s Java done right, particularly Mono the Novell sponsored .Net CLR. But this is pretty silly, particularly the var keyword.

The new object initialiers are cool, but the var keyword sucks. Shall I say it again?

Furthermore I can’t see the the reason for anonymous types as sysntactic sugar for anonymous classes. I suppose it’s like a dictionary object in Python, or a Perl hash.

Lastly, Python has no concept of an abstract method. That’s strange.

4 Responses to “C# version 3.0”

  1. Des Traynor says:

    Mono is not done right in my opinion. It’s not easy enough to get to grips with and their is fuck all useful books on how to get started with it.

    I think the var is pretty weird alright, but in fairness, I don’t think it will matter. There is pretty much no value to it, but I suppose to some extent it future proofs code. i.e. if they change the class String and call it say… GString, or String32, then it’ll break any of your code that has

    String des=”hello”;
    but will not break
    var des=”hello”;

    I like the new Object initializer, and I hate the new anonymous types, that said I hate anonymous methods as well . The extensions are pretty handy too. I’d love to be able to do that with Java Swing stuff. I.e. a JFrame should close when you click the X by default.

  2. Dave says:

    Shouldn’t use be using patterns such as an adapator class if want to be using GString instead of String.

    As for the var value, I think it could preahps lead to more bugs within the code by people assigning the wrong value type to var.

  3. Des Traynor says:

    Dave,
    a) No, a lot of banks and institutions use “in house” programming languages specifically to implement this type of thing. For example, they may want to make it so that every time a String value is displayed on screen, it’s integrity must be checked by default. They have 2 ways of doing this
    a) Check every piece of code manually
    b) Implement a new class (an adapter if you like), but this means that the newcomers have to be trained in on the nuances of this particular dialect of say, the String class.

    Basically, this allows you to create your own defaults in a project, while using standard code. Its a nice feature, and I don’t see the downside of it. I’m sure men with beards and pipes will question language purity here, but no one will listen, cause those people rarely leave their office/porch/rocking chair.

    Your implication that var will produce more bugs is akin to saying that Ruby is inherently a buggier language than Java, as you don’t *have* to specify a type. As the type conversion is done at compile time, I believe the compiler can spot any type mismatches, through static checking. i.e. a piece of code should contain
    a) var j=”Hello”;
    b) j=new GStreamerObject();
    at different points in the code. It’s possible to detect this through static checking. (No, this is NOT the Halting Problem, it can be checked in the source)

  4. Albert says:

    Hi and thanks for spending some time to explain the terminlogy towards the learners!

Leave a Reply