Is VB.Net better or C#.net? Or is .Net a .Net either way?

As a .net programmer at some point in your life, you probably have gotten into a discussion or at least faced a choice between VB.net and C#.net. Though the argument is never ending on both sides, how do programmer that are bilingual or someone who is just learning feel? What long term productivity impact does this have in development shop or team in general?

Well for me, I clearly have choice in mind, but instead of presenting my views today, I will publish the following list our good friend Jeff Lanning compiled from various sources few years back. Though some of the points have changed with new version of .Net, I hope it provides a good reference for anyone dealing with such a choice. Here it goes; don't forget to put in your two cents:

Reasons to Choose C# over VB.NET:

C# was designed expressly for the .NET platform and Microsoft is standardizing their company on it, which means they have a much deeper investment in C# technologies (language features, compilers, dev tools, etc) than they do in VB.NET. In fact, both Visual Studio and the .NET Framework where written in C# (using C++ as a backend). Furthermore, C# was submitted to, and standardized by, the ECMA group as an open standard while VB remains proprietary.

The C# language is very similar to the other major languages (like Java, JavaScript, C/C++, PHP, and Perl) and shares many of the same concepts, keywords, and syntactical elements. These similarities means a C# programmer will be more able to read, write, and borrow code from those other languages. Most programming books not specific to any one programming language (e.g., books on UML, data structures, OOP concepts, etc.) are likely to include examples in Java.

Outside of the endless language features debate, C# has become the defacto standard for .NET development. A majority of third-party and open source components are written in C#. A majority of advanced programming articles are written in C#. Microsoft's application blocks and other development resources are also provided first in C#, and later converted to VB.NET. If anything, .NET developers owe it to themselves to learn C# for that reason alone (even if they think VB is still the greatest thing since the Apple IIe). As long as they never have to modify or inspect anyone else's .NET code, it may be fine to ignore C# for the time being, but chances are that isn't going to be the case for very long if they want to take advantage of the rapidly growing .NET community's resources.

Most students coming out of college have experience with Java and/or C++, making the transaction to C# quite natural. In addition, these young professionals will likely see VB.NET in the same light as COBOL with its legacy-ridden, verbose BASIC syntax, and be drawn to C# as the best long-term choice for professional grown.

The learning curve going from VB6 to either VB.NET or C# is about the same given that 95% of the effort will be spent learning the object model of the .NET Framework, the new development tools, new OOP concepts, and all the new techniques involved in developing Windows or Web applications in .NET. While VB.NET might seem to be just an improved version of VB6, they are really two languages that are eerily similar, but perversely different. In fact, many experienced VB developers may find C# easier to learn (although a bit more uncomfortable at first) because it helps draw a clean distinction between the two development platforms and avoids many pitfalls associated with bringing a VB6 mindset into the .NET world (like using "On Error GoTo"). There is much to be said for starting with a clean slate.

VB.NET does not have native support for XML embedded documentation, which is used by IntelliSense and to auto-generate class reference documentation directly from the code (with tools like NDoc, DocGen, and many others). The absence of this feature alone is a strong reason to avoid VB.NET on large development projects. This limitation will be fixed in the VS2005 release.

Over the next few years, Microsoft will be differentiating the VB.NET and C# product lines. VB.NET will diverge to provide a better RAD (Rapid Application Development) experience, while C# will diverge to provide a better experience building complicated business frameworks, backend services, application architecture, and reusable object-oriented components. For smaller projects, either language will be a fine choice, but as the size and complexity of applications increase, the productivity gain from C# will likely outweigh that of VB.NET.

Language-specific reasons C# is a better choice…

- less verbosity (e.g., easier to find the "important" words in the code)

- assignment operator is not the same as the comparison operator

- Native XML code documentation (which drives IntelliSense notes)

- does not hide "Advanced Members" of classes

- simplified type casting syntax (instead of directcast(), ctype(), cbool(), etc...)

- case-sensitivity (allowing for better variable names in many cases)

- 'OnError GoTo' is impossible

- option explicit by default (enforces correct type usage)

- cleaner null test expressions ("obj != null" rather than "not obj is nothing")

- better variable scope containment in loops and code blocks

- automatic logic short circuiting (streamlining common test/use logic)

- 'using' blocks for clean/safe resource management

- continue / break statements supported in loops

- embed special string characters ('\n', '\r', '\t', etc…)

- string escaping ('@')

- comment support is just better (multiline comments, XML comments, single-line comments, etc…)

- as operator (string s = obj as string)

- native increment/decrement supported ('--' and '++' )

- intellisense is much less interfering

- arrays are defined with number of elements, not the upper bounded index

- hierarchical constructor calling (ctor() : ctor("defaultValue"))

- array/collection indexer is not the same as a function call ('[0]' vs '(0)')

- 'ByVal' is very misleading (it passes a pointer (ie reference), not a value; whereas 'ByRef' passes a pointer to a pointer)

- unsigned values (uint, ulong)

- P/Invoke makes much more sense, and is uberly easier to figure out

- doesn't hide delegate usage (AddressOf)

- more optimized MSIL generation

- operator overloading

- pointers

- event syntax

- delegate syntax

- unmanaged/unsafe code supported

- 'Default Namespace' doesn't just prefix your classes namespace

- EntryPoint isn't hidden ([STATThread] static void Main(string[] args))

 

From a discussion thread:

Actually I'm little concerned about VB's future with the graduating generation of programmers. Most of today's universities are teaching Java as a primary learning tool. And usually the academics view VB as a clumsy language for lazy programmers. Decades ago the most supreme business language was COBOL. Those who had a chance working with it know it is an outstanding language that is dead meat, not because it is not used anymore (70% of World's applications remain bounded by it) but because the new generations learned from their teachers that computer science is science, COBOL is for business and C is for math (math is science). Some may argue that there is COBOL.Net, however, seniors can't stand OO way of thinking, juniors can't stand OLD language stigma so it is also dead before it is born. Having C language culture and nowadays Java transferred from teachers to students, what do you think IT managers will prefer for their departments growing potentials if they choose to acquire .NET?

 

If I was a manager I would surely choose C# for several reasons:

1) So I can get the brightest of new (low paid) grads up and running in no time.

2) So I can get to that C++ like language fame surrounding my projects and yet get it RAD.

3) So I can leave infamous VB lazy clumsy programmers gossips roam as they wish without feeling their sting.

 

But I am a developer so I choose C# for:

1- No job is secure, so I'd better get used to curly brackets and once I learn most of XML, web services, SOAP, etc., then I am empowered to switch easily to that other half of corporate world that is using J2EE.

2- It's more stylish and attractive (yes it does matter if you are going to spend most of your day on something then better love it).

3- Because VB's parents Bill and Mic seem to undermarket it in favor of C# (could it be they are trying to abandon the ship?).

 

From a discussion thread:

We chose VB.NET a year ago and we regret it. We have 25 very bright developers and a substantial ecommerce web site with plenty of traffic. One year ago we kicked off our port to .NET and we chose VB6 because our existing code base was VB6 and ASP. A few of us here had significant C# expertise from previous jobs and warned the bosses that the "advantages" of VB.NET were a mirage and that there were some clear disadvantages. They actually thought the "automatic conversion" tools were going to buy us some time. The pointy-haired contingent won out and not a day goes by that we don't curse them for forcing VB.NET on us.

As other's have said, you take a big hit moving to .NET at all. The tiny additional hit of moving talented VB6 developers to C# is more than offset (IMHO) by the increased developer productivity achieved over the medium to long term in C#. (If your team is not very talented -- or not talented in that way -- YMMV.)

Why do I think I am more productive in C# than in VB.NET? Here are a few reasons:

1. VB.NET has abysmal static code analysis: functions that don't return values, uninitialized variables, unused variable declarations, etc... This is what a compiler is *for*. I wish VB.NET had an "Option ReallyStrict On" so it would check things as thoroughly as the C# compiler does. You can spend hours trying to track down which uninitialized variable or non-returning pathway in a function is the source of a bug, when the compiler could just tell you.

2. VB.NET has more aggressive background compilation that you can't turn off or control in any way and which is buggy! We have solutions for our web site with 30 projects and some projects with hundreds of files. You can't add a method to a class without taking a coffee break while intellisense chews up a CPU. We're reduced to having to buy double cpu machines for developers so that they can just type at full speed. And even then all that CPU is wasted because the background compilation just can't keep up. I wish there were an option for intellisense so that you could *tell* VB.NET when to recompile and when to just chill out because I'm typing a raft of code.

3. VB.NET (still) has lurking intellisense bugs whether you use project dependencies or file dependencies. Whichever you choose, you're stuck with a different set of problems ("can't copy dll X [v1.1.3000.1] over dll X [v1.1.3000.2]" or "dll A requires a reference to dll B" or "can't copy dll Y to c:\foo\bar\y.dll because it is locked")

4. VB.NET has no "using" directive. I know it's just syntactic sugar... but I want more sugar. The truth is that interacting with non-managed resources (ie. the OS or the database) in .NET sucks even in C#. But having to write "Dim x ... Try ... Finally .... x.dispose EndTry" all the time is just pouring salt in the wound.

5. VB.NET has no multiline comment syntax

6. VB.NET has no within-the-line comment syntax

7. VB.NET has no multiline string syntax

8. VB.NET has a limit on line continuations (what is it, like 10 lines)?

9. VB.NET projects cannot have pre-build or post-build steps (large, real-world projects inevitably need them)

10. VB.NET has no built-in comment->documentation generator

 

And in case anyone is still reading... it's hard to think of any advantage we've seen in using VB.NET. Maybe one: it made some COM coding easier because we could use late binding. I'd say if you are doing lots of COM interop especially if you need late binding, VB.NET is necessary. But I don't recommend doing any more COM interop than you absolutely have to and late binding is worse than evil.

 

I think that pointy-haired types think that VB.NET will make it "faster". That the learning curve will be less steep or that fewer changes will need to be made to the code. It just doesn't work that way. Your project will take 2 or 3 times as long as you anticipated, even if you pick VB.NET. And when you choose VB.NET you may get started faster but you'll be paying a tax forever, because the language and tools just aren't as good as C#. I'm crossing my fingers for VB improvements in 2005, but I'm not holding my breath. Doubtless something else will be "missed" (like multi-language projects were this time) and we'll still be stuck in a VB.NET ghetto.

Print | posted on Thursday, February 07, 2008 10:45 PM

Feedback

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Rodrigo at 2/8/2008 5:52 AM
Gravatar I couldn't agree with you more.. I worked with C# for the last three years and now I am forced to use vb.net ..man that sucks big time !!
And I am an ex vb6 developer..but C# is just more productive...thats it...

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Jim Arthur at 2/8/2008 7:32 AM
Gravatar Seems like the answer to the question creates an answer rather than a discussion. Seems a shame to have such a one sided approach in an article that starts out suggesting this was to be a comparison, not a sales pitch. I suspect most self-made programmers over 25 started out in basic rather than a college language, so your Visual Basic support base is as large, if not larger, than your Java / C++ base and the crowd at the starting line is about equal.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Robert S. Robbins at 2/8/2008 8:09 AM
Gravatar In an ASP.NET project, you can use both C# and VB.NET in your App_Code directory. I'm contemplating throwing in some J# just to make life interesting for anyone who inherits my project.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Bigyan Rajbhandari at 2/8/2008 9:02 AM
Gravatar Jim, I couldn't agree with you more that VB has been around since long time. Well, when I first started programming 14-15 years ago, I started with Basic. But the case, I am trying to present deals with question of being productive after being bilingual? Though the tone seems little bias, I think it presents a good reference for anyone who is trying to pursuade a client, collegue or anyone else.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Wayne at 2/9/2008 1:18 AM
Gravatar I started with Basic and VB, ASP and finally VB.Net. Then I began to realize that all the beta documentation referred to C#. Well it just never ends. I made the switch from VB to C# during 1.1 days and it was pretty hard. During those times I was maintaining several apps that were written in vb.net.

heh, I had an app that I started writing a collection of web services in vb.net, but the client portion was all C# that I wrote while I translated and learned C#. Worked out well, but I hated having to explain to the receiving developer why it was half and half. It would have taken too much time to re-write the VB side.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Kevin at 3/12/2008 6:16 AM
Gravatar I also moved over to c# because of better documentation in 1.0 and 1.1 days. The problem is that I can't go back to VB. I think microsoft made the mistake of not marketing and promoting VB properly in the beginning.
VB is simply dead, throw it out and let's concentrate on C#, accept, adapt and move on.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Steve at 3/12/2008 6:52 AM
Gravatar This is a very one-sided article. I've been a developer for over 20 years. Started writing C on a PCs and mainframe computers. I then moved on to C++ on various Unix systems and later started writing VB (from version 1) on PCs again.
I moved on to .NET with everyone else and like everyone else just used the .NET language that what closest to the one I had been using - for me VB.NET . I have done a couple of client projects in C# but to be honest there ain't much difference between the two.
Each has it's quirks.
C++/C# code is visually much cleaner than VB/VB.NET making it easier to see the logic flow of larger chunks of code.
On the other hand I've found it easier to maintain VB code written by someone else. C# programmers tend tend to comment less and give less meaningful variable names.
The verbosity of VB always kills me when I switch back to it. The case-sensitivity of C# has me pulling my hair out.
If they added a case-insensitivity/'pick up the case of the variable' option to Visual Studio for writing C# then this would definity swing it for me.

The C# snobbery that some people have is just plain ignorance. It reminds me of arguments I used to have with people who 'think Vi is the best editor'/'say Oracle is a proper database unlike SQL Server'/'Apple Macs are better than PCs'/'Unix is better than Windows'. Having a false superiority complex does not make you right.



# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Mark Wisecarver at 3/19/2008 7:34 AM
Gravatar Please write a "part 2" where you stick to the advantages of VB 9.0 and C# 3.0, pretty please.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Yugiro Fuma at 4/6/2008 9:23 AM
Gravatar Good talk everyone!

Do anyone know what programming language is used to control a Satellite?

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Thomas Worvo at 6/9/2008 6:57 AM
Gravatar Having 5 years of VB6 experience and 3 years of VB.NET, I found the C# transition difficult. Firstly, it was very intimidating. I think that's the core problem most vb'ers face when switching. Second, I wasn't very agile. Monolingual programmers get stuck in ruts very easy, and adjusting to the syntax change took a few weeks.
The transition made me a better programmer, though - I've since expanded my repertoire to include about 10 more languages. Most modern languages are curly-brace, so learning C# makes the transition to Javascript and Actionscript easier.

At this point in time, I'd rather walk in bare feet over a pile of rusty nails than have to touch VB.NET with a 10-foot pole. I can't believe how long I endured the verbose, and non-nonsensical syntax.

I feel very sorry for those who still haven't made the switch. My last co-worker finally switched a few months ago, and he's now a C# addict.

Switch now, not later. The less VB.NET code you write, the better - you'll despise maintaining it after you switch to C#.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by jl at 6/17/2008 11:21 AM
Gravatar I am an MCT and, though I now serve in an I.T. Director level capacity for a healthcare company, I have faced this question in class settings. There a devSnob in EVERY room who has some argument (usually nearsighted or, worse, hearsay) as to why C# is better than VB. I offer the following analogy...

If I want to want to find out the specials at my favorite local Mexican restaurant, I would be best equipped if I asked in Spanish...

If I want to make sure my shirts DON'T get starch (Dang it!!!), It would really be helpful if I could speak Korean...

If I want to go driving on the Autobahn, it sure would be helpful if I could read German roadsigns...

thus...

Which language is best depends on what you want to accomplish; what your intent is. You could get by with either though each has strengths. It's true and no small thing that C# has a much larger community of dev's out there and it's the primary language used at MS. In my personal experience, VB tends to be easier for RAD situations and even has a few syntactical elements that are better than the C# equivalents (such as the simple "Handles" keyword for event wiring).

The bottom line, going back to the (off the cuff) analogy is that one may be BETTER than the other "here" and the other BETTER "there" but it's always BEST to be acquainted with BOTH! They both compile down to the very same MSIL code therefore they are going to execute at the same speed and have the same runtime resources to utilize (can you say "COMMON" language runtime (i.e. CLR)?

I personally find people who are C# zealots to be as simple minded, near-sighted, and obnoxious as the masses of MAC end users who feed on the the MAC guy/PC guy propaganda and then turn around and assert MAC's supremacy over PC publicly while privately knowing little more about the technology than how to open Safari and browse eBay listings. On the other hand, I offer my respect to those expert developers who know how to best leverage the benefits of the language, whether VB or C#, in ways that make it shine for what it shines best for.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Bigyan at 6/18/2008 1:27 PM
Gravatar Well, I guess I should be more clear that my intention here is not the spread the propaganda on VB.NET or C#. I couldn't be more happy with tons of choices in terms of programming languages that are available in IT currently. All in all, the variety helps to make our lives easier as a IT workers. May I should have worded the title differently as to why someone may find more productivity on one language vs other.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by david at 7/29/2008 5:28 AM
Gravatar great post! my company had moved to C# from vb.net 2 years ago.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by brad at 8/3/2008 10:28 AM
Gravatar Programming is not my primary responsibility at work but I use it as a tool for writing utilities just for use in-house.

At first I was reluctant to become involved with a .net language and I have always liked the curly brace club since Turbo C2.01, anyways it has been 3 years now and I have become very comfortable with c# (lots left to learn) and since the framework is part of the windows install there is no more worry about distributing our in-house utilities.

The factors that drove my decision to adopt c# was :
1) I like curly braces
2) I like the name

brad

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Scott at 8/7/2008 10:40 PM
Gravatar As a VB.Net developer who does so based on need vs desire I can tell you I use VB.Net because of the quirks with the C## version of the Microsoft IDE. I have tried some other IDEs as well and found they suffer from the same problem. Intellisense/code completion is one of my main beefs with the C# development environment. It is the main reason I choose to continue developing with VB.Net. With VB I get increased productivity from the interface. If I want to use an integer as a string I simply use it. In C# I must type myInt.ToString()

If I do need to use the ToString method in VB I simply type myInt.To and hit space when the intellisense pops up the ToString method. In c# if I hit space I have found that the "code completion" does not place the () at the end of the ToString method, whereas VB will place them. It seems like a small thing but when development time frame rules for me this is a big plus to my "lazy" habits.

I just tested this with a test C# project and it displayed the "not finished" behavior that I describe above. Maybe my settings are not write in the VS ide. Until the IDE works as well as the VB.net ide I have no desire to switch to C#.

I do agree that C# will be a more sought after development language that VB.Net in the future. But since I do not see myself wanting to do programming for the rest of my life I see no reason to switch to make myself more marketable from a programming aspect. Not that C# is hard to pickup. I follow it quite easily but simply the vb.net ide is more productive.

S

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by JT at 8/11/2008 6:22 PM
Gravatar This article is not only outdated but its not a comparison, you don't mention any of the benefits of programming in VB.NET only its disadvantages. First Off, VB works better with MS Office product even office 2007. Second, even C++ had default parameters and since C# does not you are forced to overload all of your functions instead, why not use VB.NET since they still let you use optional parameters which makes adding new functionality to old functions way easier. I also like VB.NETs intellisense and C#'s intellisense I just wish someone at MS would combine the benefits of both. I do agree with all of VB.NET's downfall's, and I therefore use both languages but to say that C# is the best is rediculously one-sided and false. I actually can't find anything that I can't do in VB.net that I can do in C# so it seems to me that if a programmer performs better in one language than the other he should be encouraged to. Lastly, your arguement that by adopting C# as your primary language will encourage the best and brightest is based on nothing, I have seen geniuses work on FORTRAN for years and are able to outperform any .NET developer at what they do... rant rant rave rave :D

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Mike at 11/6/2008 2:59 PM
Gravatar I was forced to work in VB.Net for 10 months. The background comipler was just killing me. No way to turn off.
As for intelliSense, it did not work they way I wanted and it was annoying in VB.Net. With case sensitive in C#, intelliSense shines and makes me very productive.
I like defining my sql statements with the @ so the following works.
string myVar = @"select * from sometable x
where x.field = 'abc'
and x.something = 0
and x.another = 'X'
";
I can easily read the sql and copy and paste into a my sql tools.
And I can easily comment a piece of the sql as a test.
string myVar = @"select * from sometable x
where x.field = 'abc'
and x.something = 0
// and x.another = 'X'
";

The vb line continuation makes multiline easy white space readability cumbersome.
I use the "as" operator a lot in C#.
Many vb codes find the handles on a method a good thing. Not me. I want the += way. This always works in the design and in coding and allows one method to handle multiple events.

My background is Delphi and I learned many good coding practices from Delphi which still serve me well in C#. Too many bad and sloppy practices from VB6 and earlier are carried over to VB.Net
VB.Net does have a with statement which is nice but C# 3 now has initializers which negates this VB.Net advantage.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Matt at 12/11/2008 9:41 AM
Gravatar What a load of rubbish. Seriously rubbish. The only difference between C# and VB.NET is whether or not an employer uses the language. More use C#, so C# will probably make you more employable. Anything else is just utter rubbish. They compile the same, there is nothing you cannot do in vb.net .net3.5 that you can do in C#. The syntax might be different but who cares. You can have a badly written app in C# just as easily as vb.net. Its down to the knowledge of the programmer. A great vb.net programmer is going to be much better than a c# freshman and vice-versa. Scott Gu and Joe Stagner at MS have blasted this rubbish before. Its very yawn.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Olivier Costa at 1/16/2009 4:30 AM
Gravatar I'm not 100% sure but i think that using c# with JetBrain's Resharper, negates most of the problems developers have with C# (well based on what i read here anyway)

I find that the support c# gets from tools written by the community makes me more productive. This is only a benefit though if you are using those tools and not trying to write everything yourself (reinventing the wheel etc...), or that you don't need tools like nDoc, nDepend, .... (they seem to primarily support c#, and then try to make it work for vb as well.)

I'm accustomed to work in a TDD kind of way where i write my specifications first and then let resharper generate the skeleton of the implementation for me. This seems much harder in vb.net. But maybe i didn't try hard enough...

This and the way vb.net's verbosity get's in the way of making the useful code visible made me a c# advocate. oh and by the way, I too come from a vb6 background and am capable of working in vb.net projects.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by white at 5/19/2009 9:58 AM
Gravatar abc

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Roland at 6/8/2009 7:00 AM
Gravatar I can't work with both, but I've heard C#.net is better.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by Johann at 7/6/2009 5:02 PM
Gravatar VB *was* better, when it had late binding and was simpler to program that C++ or Java. If it had gone forward, it'd be the simplest, best, fastest way out there. But it didn't go forward, it took a wild left turn and turned itself into a Java clone.

Now it's just more of the same, VB was murdered by Java zealots.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by software development company at 8/14/2009 7:48 AM
Gravatar Interesting,

I always knew that c# is better but know i why it is better than


Keep up the good work

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by VB reader at 9/23/2009 3:16 AM
Gravatar I am working for the past 8 years with vb5,6 and vb.net 1.0,1.1,2.0,3.5. almost all versions right after vb5 i have hands on. After my 8 years of experience i have been forced to write a C# component(where i cant decide the programming language).

Initially i thought it is going to be hard. Believe me, only syntax is different and i didn't feel any problem writing code as fast i can write in VB. yes there were little hickups but google is there in few seconds to find the solution for it.

Now, i dont know why C# developers unable to switch to VB.Net. This is where the problem comes in. if you learnt VB.Net switching to C# is not going to be a big problem as C# resembles java and c++. but if you dont have any knowledge on VB, it is going to be bit hard for you to switch.

While i was working in C# i reallised the following.

1)when ever i wrote a first line in function after pressing a enter will bring the end if immediately. but in C# you need to type { } manually

2)the same goes for all loops and conditions VB able to close the loops and conditions properly while c# is not

3) on clearing errors after immediately you corrected the errors, errors will go off immediately from the errros list in VB.but in C# we need to recompile.

4)as Jl said handles keyword is the best one to write the events

5) for writing events i can select right from the code window, i dont need to go to markup for writing events and its handlers.

when a product is being compared it should be Pros and cons should be taken both the sides.
in C# i love refactoring. however i liked even better to use Devx Refactoring support for VB.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by John Doe at 9/26/2009 7:44 AM
Gravatar Excellent article. My 2 cents: being a (limited) VB6 programmer and general n00b when it comes to programming, I wanted to familiarize myself with .NET. I tried my hand at VB.NET first, figuring that at least I wouldn't have to learn a different syntax. Very quickly however, I discovered that, at least for me, that same syntax actually complicated things for me, for .NET forces an entirely different (OO) mindset, and being able to still do things 'old-style' was confusing to no end. I am now trying to learn C#, and while it's learning curve is pretty steep, it does 'feel' more logical. It also seems to have a larger and more active userbase, which makes it much easier to Google for answers when I'm stuck (I spend A LOT of time on Google:). If forced to choose, I'd go with C#.

# re: Is VB.Net better or C#.net? Or is .Net a .Net either way?

Left by probabilites au blackjack at 12/15/2009 5:45 AM
Gravatar Background compilation is a feature of the Visual Studio IDE whereby code is compiled as it is written by the programmer with the purpose of identifying compilation errors without requiring the solution to be built. This feature has been available for Visual Basic since .NET 1.1 and was present in early versions of Visual Studio for Visual Basic .NET. However, background compilation is a relatively new concept for Visual C# and is available with service pack 1 for Visual Studio 2008 Standard Edition

Your comment:





 
Please add 2 and 1 and type the answer here:

Copyright © Bigyan Rajbhandari