BASIC was my first love. Notice the all caps -- that was how it was written back in the 80s. I discovered BASIC via a GW-BASIC manual I had found in my grandfather's boarding house, where a former tenant left it after graduation. From that lost book I was introduced to programming, and I moved from GW to QBASIC then to Visual Basic 4, jumping to VB 6 and finally, VB.NET. Visual Basic was my first foray into .NET, and with my skills back then, it was really, really good.
Along the way I met a bunch of other languages, though. In highschool we were also taught a data-oriented language called Clipper, and a weird semicolon-laden language called Pascal. It was the first time I saw line-terminators in a programming language. In college I finally got to meet C. Quite different a beast from BASIC, I nonetheless got the hang of C very quickly. It was terse, requiring fewer keystrokes to write in (there was no Intellisense back then) and I immediately kept all the keywords I needed in my head. It was great, but I didn't get to use it at once when I started working.
In the early years of .NET I was ambivalent between the choice of languages. I learned both Visual Basic and C# and said to myself -- what's the big deal between the two? Nothing much. So I just studied and learned and switched from one language to another, until one day I got introduced to object-oriented programming. OOP was a difficult, disciplined programming concept -- much harder to internalize than structured programming was. But that's where I saw what C# was good at: it was naturally geared towards OOP. I compared writing applications in both languages, and noticed that if I was doing OOP, it would be much faster if I wrote it in C#.
I had one last foray using VB.NET on a full-blown object-oriented designed application, and it just convinced me further that C# was the way to go. What nailed it further for me was when .NET 2.0, and then .NET 3.5 arrived. It was much easier to use and write generics, I could use anonymous methods (which wasn't possible in VB early on), LINQ was without hassles of unsightly underscores, and lambda expressions were just much more intuitively beautiful in C#. Likewise, with the ability to introduce unmanaged code, developers could also introduce more advanced tweaks that are impossible to include with VB.
C# empowers a .NET developer to realize the full potential of the .NET framework, aside from the language. This power becomes even bigger with the introduction of the dynamic keyword in C# 4.0, giving it the best of both worlds between static-typed and dynamic-typed languages. It is this power that convinced me that C# is the way to go.
So, why do you love C#? Why don't you like/love it? I'd love to hear your thoughts too.
Tags: C#, Microsoft, MSDN Sessions, MVP
Simple, really: VB is needlessly and significantly more verbose (therefore less readable) than C#.
I am with Andre, for me, the VB syntax is just really heavy. I find I can skim read C# pretty quickly and understand what the code is doing.. With VB, there is just so much more noise and my little brain can’t handle it!
I used to love VB (back in the 6.0 for me) because it made it easy to do the “cool” bits (i.e. creating GUI’s etc) and on the (relatively rare) times I would dabble in the actual code, it was in “English”..
Now, as I am on this journey of development, I find that I love THE CODE, this is where the real magic happens! I no longer want (visual) designers to hold my hand, nor do I want the code to be as verbose. I want the syntax to be clean, scoping to be clear, commonly used things to be aliased and focus on solving the actual problems at hand!
One thing that worries me with all this hype with DSL’s is that some people are trying to make C# more like VB..
e.g. – You see things *like* this (this isn’t from any actual code):
“Assert.That(x).Is.A();”
WTF?
Woops – looks like the blog engine didn’t like the use of generics
Once again it goes to prove that prgrammers with only a few years experience, base their preferences on what looks ‘cool’ and what will make them part of a herd.
The author of this C# article fails to mention even a single thing (a real example, in a real business situation) where he did something better and quicker because he was using C#
It is very clear that he associates VB with his first language BASIC; and because he wants himself not be considered a beginner (but a very experienced programmed well capable of using all symbols in C#) he chooses C#. It is C after all and not a Beginner languange.
Like all others, he goes on to compare Lambda expressions, which he certainly cannot live without; but fails to be able to talk about any business benefits (I am assuming that your code actually achieves something real in business)
Like all others, he is just comparing features. What I would want to know is where it makes more practical/business sense.
C# with its more cryptic looking code, certainly costs more to the business.
And if it is true that C# programmers cost 10% more, then I as a person who has been hiring programmers for 15 years, certainly do not want to bring in C#. Instead I will put my money in VB.NET which is easier to read and programmers cost less – so I save my company money – and achieve exactly the same results – in less time.
One more thing I would like to add – It seems C# coders ‘love’ their code. Please, you cannot fall in love with a programming language. Love is between real people, not between a person and code.
More importantly, almost all programming is done for use in a business environment. Which means there needs to be ROI, and the best one possible.
If I heard any of my programmers were writing software because they were in love with their code or they experienced code in ‘heavy’ or other emotional ways, I would simply replace them with programmers smart enough to think in business terms.
Of course ROI does not apply if you are doing non-critical (to business) programming work, in which case the longer learning curve of C# does not matter – as it is all for fun; but for serious business applications, Lambda expressions, and the odd features really do not matter.
Awesome comments Mike. Let me answer it in another blog post.
[...] few months back in my post Why I love C#, Mike left some really interesting comments about the preference of C# over VB and what he thinks [...]