Friday, 21 November 2008

Can you read c#?

I've just found another very good reason for using Delphi Prism over c#. I’ve never really used c# in anger, but the little I have used it, case sensitivity just drove me nuts. It’s too easy to make a mistake. A simple piece of code such as

Foo foo = new Foo();
int64 FOO = 20;

is just not readable. It’s all too easy to get them mixed up and try to call a method on the class rather than on the object. Ok, the compiler helps, but that’s all lost time.

That’s a pretty simple example, I’m sure you could get yourself into all sorts of trouble. I don’t see the point in case sensitivity. It’s just another small thing that makes c# unreadable when compared to Delphi Prism. I guess you probably get used to it. I bet c and c++ developers coming to c# just love it, whilst Delphi/Pascal and VB developers loathe it.


Anonymous said...

I disagree.
OK, so mixed case works for your variable names in DelphiPrism. But you're still using the .Net framework, so "stringBuilder" is still not "StringBuilder", so any class you inherit from, or use, you still have to pay close attention to case.
And what about when you include a third party component someone else built? Does that have case sensitivity in its properties or not? I'm guessing it's compiler magic, so it would depend on wether you have the source for the 3rd party component or not?
And I guess it depends on if that component was VB, C#, or Delphi originally? I hope C# built assemblies don't act differently than Delphi asseemblies, or else C# coders wont want to buy DelphiPrism made components.

Anyways, so now sometimes case matters and sometimes it doesn't.... I'd rather have consistency through the whole project.

Babnik said...

You have a point. If you will be mixing Delphi Prism, and C#, then you need to be consistent with your cases. That kind of strengthens my point that case is one more complexity we could do without.

But I agree, it's not much of an advantage for Delphi Prism when we start thinking of mixed apps. (which is the whole point of the .net framework..language doesn't matter)