12.18.2009

The transition from C# to VB

For not having written any visual basic code in about a year, the transition from C# back to VB has been a slightly rough one.  I noticed an endless barrage of squiggly lines indicating syntax errors have plagued my code.  VB's compile-time syntax checking in Visual Studio didn't help either.  It let me be even more aware of my failure to comply with VB's rules.

The biggest offender was in my variable declaration.  Yes!  In the variable declaration!  I shall declare all my variables with a Dim.

I shall declare all my variables with a Dim.
I shall declare all my variables with a Dim.
I shall declare all my variables with a Dim.
I shall declare all my variables with a Dim.
I shall declare all my variables with a Dim.
All your base are belong to us.

The point here is, like that of spoken languages, computer languages too need to be learned and perpetually practiced. Just like that violin you quit playing the moment you got accepted to a good university.  Don't neglect it or you may never get it back.

Ok, that's being overly dramatic.  Fine.  But, honestly, going from language to language is more of a nuisance than anything else unless you program in all of them everyday.  I quickly got over the Dim thing. I got used to the absence of the symbols in the beloved C-Style language: { } [ ] ; . I didn't like the fact that I had to google everything from "VB ternary operators" to "VB linq to sql examples."  I'm pretty good with Linq in C#, but in VB it seems so foreign to me. Man, I wish I saved my search history. But, in the end everything got done... with a 30% drop in productivity. Just kidding.

As for the long standing C# vs VB debate, here's my view.  Who cares?  For those of you who share the same passion as I do, we can have a language preference but that doesn't mean should refuse to work on projects written in a different languages.  Besides the fact that we might get fired, it's just not right.  We programmers are taught to learn to how learn.  Our programming languages course showed us how to adapt to other languages.  Where's the fun in exploring new ways to the do same thing?  So what if C# developers get paid more than their VB counterparts on average? Wait, I do.

No comments:

Post a Comment