Archive

Archive for February, 2011

C# vs Java: casting objects and calling members

February 11th, 2011

Given these two functionally identical code samples in c# and java, what is the output?

C#:

public class A
{
  public String Method()
  {
    return "this is A";
  }
}

public class B : A
{
  public String Method()
  {
    return "this is B";
  }
}

A thisA = new B();

thisA.Method();

Java:

public class A
{
  public String Method()
  {
    return "this is A";
  }
}

public class B extends A
{
  public String Method()
  {
    return "this is B";
  }
}

A thisA = new B();

thisA.Method();

What does thisA.Method() return?

It turns out that there are two different answers to this. In .NET/C# it returns from A (“this is A”). In Java, it returns from B (“this is B”).

So far it appears that this is a type issue; new B() must be getting cast back to A in C#. Looking for some documentation on this specifically. Links anyone?

.NET, Interesting, Technology , ,

Red Gate Reflector: end of the free version

February 2nd, 2011

Red Gate announced today that they will stop offering a free version of Reflector. You can read the details over at Red Gate’s site.

No big deal, right? You can just get the current copy or an old copy and be good. Surely Lutz Roeder has a copy stored somewhere on the internet. Yeah, sure, only it won’t work.

All version of Reflector (both Lutz’s and Red Gate’s) have a little “feature” that causes Reflector to stop working after 6 months. This time bomb has always been a part of Reflector and forced you to update to the latest version.

Surely Red Gate would release a version of Reflector that doesn’t expire and won’t stop working in 6 months, right? Wrong. In 6 months the only way to use Reflector will be to pay up. Too bad you can’t use Reflector on Reflector.

Oh, and never mind Red Gate’s promise to keep it free and for the “community”, as they said back in 2008 when they acquired it from Lutz. They sure proved the anticipated “scepticism” wrong didn’t they!

But why not just release a one-time, non-expiring version of Reflector prior to making it pay-only? Is that too costly?

When I first read the news, I hit up the blogs and I have to say that I’m a little surprised at the number of devs that jumped on this and defended Red Gate without even looking into the facts. It’s almost like they are on the take from Red Gate.

The price isn’t terrible, but doesn’t sound like a great value either; as it’s basically the current version snapshot minus the time bomb. Next version? Pony up again cowboy. At $35 it’s not even close to a no-brian buy. Oh, and don’t remind me about the rising price of gas.

UPDATE: JetBrains, what a tease!

.NET , , ,