Blog Post

Struggling with C#

,

I taught myself programming with Quick Basic (started with Turbo Basic but couldn’t find a book on it, so bought QB – best $90 I spent I think!) and I’ve used most of the versions of VB and VB.net since then. The language is comfortable to me and especially with .Net the sense of not being able to do some things that other languages (C and C++) has gone away. Typically I’ve written code to solve business problems of one kind or another, and mostly VB has served me well. When C# came out I wasn’t thrilled about moving out of my comfort zone for a language that compiled down to the same stuff at the end of the day.

Saying one is better the other is arguing Ford versus Chevy. Far more about preferences than anything else. If I could do 20% more, better, whatever – I’d be interested in changing, but short of that and that VB is still mainstream, why change?

But…not that I’ve changed, but recently I had to spend a few days modifying a web site written in C#. Frustrating couple days because I didn’t invest ahead of time in learning more of the differences. Figured I could get through it and I did. Concepts I get, syntax – wow, did that hurt. Case sensitivity, brackets instead of parentheses, parentheses on methods, semi-colons, different look to page events. All relatively minor changes, but together it easily took twice as long. I was basically taking some existing code from another app, making some changes, plugging into the new one. Using a VB to C# converter helped some, but often I just had to struggle with it to get it to work.

Not sure what lesson to learn from it. Even as I grasped the differences I didn’t see any place where the code seemed better, just different. Having to use brackets for if/then reminded me of the miserable begin/end in TSQL – it’s something the compiler should just figure out! I didn’t do anything advanced enough to probably see any interesting differences. Mostly it left me wanting to go back to the speed and comfort of the tools I know. Should I spend more time to be closer to bi-lingual? Or be content with what I’ve learned and learn more if I need to? The latter seems easiest, but right? Best?

If use VB or C#, try switching to the other for a day – and then let me know what you thought!

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating