Karl Seguin

Sponsors

The Lounge

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Language Proficiency - C# or VB.NET?
In a somewhat unrelated comment to Sahil's really-should-remember-but-gonna-forget-and-get-bit-in-the-ass post, Scriptor pointed out how little VB is used here at CodeBetter. While I'm too new at CodeBetter to really comment to that specific charge, I've always have something to say about the VB.NET vs. C# thing.

When it comes to writing .NET material, it obviously depends where your material is going to end up. Although blogs have become leading sources of technical information, it's unreasonable to ask bloggers to use more than one language (I know that's not what you were getting at Scriptor). When you are writing an online publication however, any downloadable samples should be available in both languages (unless the example is extremely trivial). If you only make it available in one language, someone will ask for it in the other (sooner rather than later). What about code samples within the article? Well, every time I wrote an article for MSDN, I was gently encouraged to make sure the samples were available in BOTH languages.  Personally I find this makes articles too cluttered and is really unnecessary (though I did do it at first). I strongly believe that the best approach for article samples is to use C# and VB.NET interchangeably. I haven't written a book, but I'd think that's the best solution there also (unless you want to sell a C# and VB.NET version, which I consider lame in most cases).

Now, this really leads to my main point. Every VB.NET developer should be able to easily read C#. Every C# developer should be able to easily read VB.NET. First, it's bound to come in handy more than once. Second, it's nice to have on your resume or in interview tests. Third, neither language is the dark side - stop being such a nerd. Forth, it should take a very small amount of time to get up to speed with the new syntax. Fifth, if everyone writes their articles/books the way I think they should (see above), you won't have a choice. Spend 2 hours every Friday with Snippet Compiler and play around in the other language.

Although you should be able to easily read both languages, what should you write real code in? Whichever you feel more comfortable in. If people are telling you that one's better than the other, or that VB.NET sucks, then there's a good chance they aren't very good programmers (ignorance isn't a good quality to have in this business). VB.NET isn't more productive, and C# isn't more powerful. A good programmer will write good code in either language. A bad programmer will write bad code in either language. Part of me wants to say VB.NET makes it easily to be sloppy, for example one could turn off option strict or use on error resume next, but a bad programmer in C# could just as easily only use System.Object and swallow exceptions. I do wish VB.NET had a 3rd "option really really strict" option that disabled a handful of more "features", but in the end it really is the person and not the language.

Posted 03-31-2006 12:14 PM by karl

[Advertisement]

Comments

Sahil Malik wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 12:39 PM
Tell ya sump'n funny. At a recent MVP get together, folks raised this issue of "Why am I a C# MVP, when I do ASP.NET/VB.NET/...".

So the MSFT guys said - Don't get too religous about your language.

My answer was - We're not religous, we're spiritual.

So yes, it is the framework, and lets not get too hung up on the language.
Jason Bock wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 12:57 PM
Why people still talk about "VB vs. C#" is a mystery to me. Use what's best for the problem at hand. Knowing the framework is a bigger key than "picking a language." I use both, although most of my clients have used C# in the past year or so. I'll use F# or IronPython if they want me to. Languages are fun - let's make the conversation, "VB and C#".
Pete Koutoulas wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 1:57 PM
Bravo Karl! That could be the best single piece ever written on the C# vs VB holy wars. Can we now declare it a draw? (Not likely...)

*STANDING OVATION*
Raymond Lewallen wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 2:13 PM
I try to mix it up in my posts, but do more VB than C# because over time, people have commented on how they appreciate the fact I did my posts, code and examples using VB.  Nobody has ever said "thank you for doing this code in C#".  This is because the primary language you find is C# and people appreciate the VB stuff when they happen to come across it.
Sam Gentile wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 2:34 PM
The language wars are stupid and make CB look crappy as we have been doing this a million times since 1999. Its disapointing that we are stooping this low again. There are no languages per se in .NET anyway as 98% of the code in *any* .NET program is either the CLR or a .NET Framework Library call. The quicker people realize that and that "Its The Runtime Stupid" (http://codebetter.com/blogs/sam.gentile/articles/141815.aspx), the better they will be as .NET programmers. Any C# program is virtually interchangable with any VB.NET program and vise versa. Its all the framework calls.
karl wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 3:17 PM
Jason:
Despite my title, i think it's clear that the intention of my post was indeed "c# AND vb.net", so I couldn't agree with you more. Languages are fun, and useful to know (even if it is easy), thus everyone should be able to understand both.

Sam:
I'm not sure you understood what I was trying to say, or I don't understand what you're trying to say. My point was three fold: authors should target both languages as best as possible, everyone should know both language because it's easy and useful and the language wars ARE stupid.

I can't say I agree wth your statement about there not being a language in .NET. I'm not sure how realistic it is. I think it might be somewhat out of touch with the challenges some developers continue to face. Sure it'd be great if every programmer was a master architect, but they aren't, and calling them stupid isn't the way to solve the problem. Like it or not, people DO have a hard time with languages. HR DOES want to know if it ought to hire VB.NET or C# developers. And I DO have to maintain someone else's code in C# or VB.NET - not IL.

General programming concepts are far more significant and fairly language agnostic - agreed. But no one's stooping low by saying people should understand both C# and VB.NET, because not everyone can. And suggesting that people make sure samples are available in both C# and VB.NET is a good one, because mixing languages for a given project has some obvious drawbacks.
Sam Gentile wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 4:23 PM
I misinterpreted your post thinking it was another "stupid" language war. I stand corrected as I agree with your three conclusions. I am not calling anyone stupid. "Its the Runtime Stupid" is an expression of something thats obvious (see Google search for Its the XXX Stupid http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGIC,GGIC:2006-02,GGIC:en&q=Its+the+Stupid ). No one interpreted it as calling anyone stupid when it was published in 2002 and there were more than 50 collected agreeing posts. Sorry for the misinterpretation.
Sam Gentile wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 4:35 PM
karl wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 4:41 PM
No harm no foul..sorry if I got slightly defensive :)
Sam Gentile wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 4:43 PM
No problem and welcome to CodeBetter BTW, glad to have you.
Sahil Malik wrote re: Language Proficiency - C# or VB.NET?
on 03-31-2006 4:52 PM
Okay now Microsoft will create so many differences between VB.NET 3.0 and C# 3.0 that this post will be invalid huh?
Jason Haley wrote Interesting Finds
on 04-01-2006 6:34 AM
Derek wrote re: Language Proficiency - C# or VB.NET?
on 04-03-2006 4:45 AM
Personally, I prefer VB.NET.  The intellisense was a lot better IMHO in VS2003.  But now with VS2005, it's a moot point.  I still prefer VB.NET over C#.  But I do agree that any ".NET programmer" should be able to read (and code) in both languages.  And maybe an obscure RPG.NET or other rare example as well.  Excellent post.
Jordan wrote re: Language Proficiency - C# or VB.NET?
on 04-03-2006 11:55 AM
Yeah, any upcoming changes which would branch vb.net and c# further apart are about worrisome, no?
Jay wrote re: Language Proficiency - C# or VB.NET?
on 04-28-2006 1:55 PM
Hmmmm.. Excellent! One question: I heard a rumor that Microsoft is gonna make VB.Net obselete??? Is that true??? I'm 99% sure its not gonna be. What do you guys say?
karl wrote re: Language Proficiency - C# or VB.NET?
on 04-28-2006 3:54 PM
There are certainly no sign of it slowing down any time soon. From past conversations with some of the VB.NET team, Microsoft is standing firmly behind VB.NET.
muhannad wrote re: Language Proficiency - C# or VB.NET?
on 08-28-2007 5:16 PM

dddddd

phx wrote re: Language Proficiency - C# or VB.NET?
on 09-09-2007 10:55 PM

"..and C# isn't more powerful.."

Anonymous methods.

A non-broken ternery operator.

"Unsafe" blocks.

Theyre the valid reasons. Then my pet peeves about VB:

Hard to read nullable types (and generics)

Verbose syntax - and redundancies like "readonly" on properties

Functions not returning values only a warning?

anon wrote re: Language Proficiency - C# or VB.NET?
on 08-12-2008 1:45 PM

There is another good reason to use C# over VB.NET, If you want your program to run on OS X or Linux or Solaris or HP-UX or AIX... etc you need to be able to run it using Mono which only supports C#. Hell, Apache can even run ASP.NET C# pages.

gabe wrote re: Language Proficiency - C# or VB.NET?
on 09-17-2008 7:31 PM

With a computer language you're just going from a human level to tell a computer what to do.

You wanna speak computer, learn assembly language of the chip your talking too.

No wait, now it's a Intel vs Motorola chip war.

Humans, what idiots we are...

Dave wrote re: Language Proficiency - C# or VB.NET?
on 12-12-2008 4:16 AM

M$ marketing cause this language war. Vb.net & C# users are the victims.

I don't trust M$ anymore since they killed of VB6.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?