Saturday, May 9, 2015

For the love of C#

I've spent a good part of the preceding semester making the biggest upgrade in my programming skills since I learned C++ about four years back. In the intermediate time, I've also learned C and FORTRAN (for backward compatibility) and Excel VBA (which is a piece of cake for anyone used to formal languages as opposed to scripting languages). But C# is a different game altogether. Consider this

int number = 32;

This makes perfect sense in C, C++ and C# (and other languages too). But:

int32 number = new int32();

Now, this is garbage in everything but C# (and also, I'm told, Java). So that's it? The difference is just in syntax? Oh no, there is a difference in syntax (and you can just use the old syntax for the most part as well) but that's because the underlying idea of the language has changed. There are no values anymore, everything is an object, everything comes from an underlying class and the .NET framework builds all that, making it very easy to write programs.

In fact, now that I'm pretty comfortable with C# and know its powers, I'm surprised that just a year ago, I had ignored sane advice and sided with C++! The future is C# certainly - but I've mainly learned it to use WPF so that I can move beyond WinForms on VB (who in their right mind uses VB when they have other options?!). And yet, I'm told WPF too is dying in favor of WinRT, although as far as pure desktop applications go, WPF is still the big daddy around.

Because of my intense self-study of C#, I think I'm in a bit of love with it. I think about it all the time, what I can do with it that would've been so hard with C++ (though mostly I just think about how great C# on its own is - no exes!). Ah, C#, where have you been all my life?

What did the Java programmer wear glasses? Because he couldn't C#!

No comments: