Coffeehouse Thread

54 posts

Why is C# better?

Back to Forum: Coffeehouse
  • User profile image
    Lee_Dale

    Every new project I do now is in C#, I come from a VB background with a little C++ and Java knowledge but mostly VB.

    I started using C# instead of VB.Net as I noticed more clients wanted C# developers and I wanted to become fully proficient in it.

    But I struggle to think why C# is better than VB to be honest, can anyone give me a distinct reason to choose C# over VB if you was productive in both languages?

    For my money I would even go as far as to say VB.net was more productive than C#

    Anyone got any reasons why C# is better?

  • User profile image
    UlsterFry

    I come from a similar background..  the best thing about c# is the discipline element..  vb lets you get away with murder.

    ..oh yeah, and c# is less verbose Big Smile

  • User profile image
    Lee_Dale

    UlsterFry wrote:
    I come from a similar background..  the best thing about c# is the discipline element..  vb lets you get away with murder.

    ..oh yeah, and c# is less verbose



    In what way?  if you have option strict on then both languages behave the same?

  • User profile image
    Pace

    its horses for courses.

    If you are programming .Net then the language you choose is only talking to the framework anyway which is accessible by the .Net languages C#, vb.net, j# etc...

    From what I hear C and its varients are more of a OO approach but surely any class VB'er (amanda Silver?) could do that anyway.

  • User profile image
    littleguru

    This discussion is needless. Both build upon the .NET Framework and use the classes provided by that. Both are object oriented languages.

    One is there a little bit better, the other in some other place.

    It's personal taste that makes one language better then the other.


    If one language does something better then the other, you will see that in the next version of the other language. It's in Microsofts interest to have both languages even. They want support a broad band of developers.

  • User profile image
    Lee_Dale

    littleguru wrote:
    This discussion is needless. Both build upon the .NET Framework and use the classes provided by that. Both are object oriented languages.

    One is there a little bit better, the other in some other place.

    It's personal taste that makes one language better then the other.


    Thats what i'm getting at, is it just down to personal taste then. I didnt think there was any advantages using C# to be honest, just wondered why so many clients were asking for C# developers specifically Perplexed

  • User profile image
    Tensor

    Massif wrote:
    To be honest I struggled to see the difference in terms of features between C# and VB.NET.

    However, I'm not sure how that changes with .NET 2.0 - does VB support anonymous methods and suchlike? If not then it's a fair guess that C# 3.0 will make the difference more noticable.


    The differences have changed between versions as VB supports some stuff which only c# 1.0 did. There are some new differences as well though (such as anon methods as you mention). To be honest to me the main difference is the IDE experience. As of 2.0, I think the main differences are:

    C# allows unsafe code.
    C# supports refactoring out of the box (allthough there are plugins for VB).
    C# has better support for nullable types.
    C# has anon methods.
    VB allows late binding.
    VB has the My namespace.

    There are other subtle differences (such as how member hiding works). In the case of most business application development I dont see any of the above making much difference.

    You say yuo think 3.0 will widen the gap - in which way? LINQ will be implemented in both.

  • User profile image
    Tensor

    Blah, dupe.

  • User profile image
    Massif

    To be honest I struggled to see the difference in terms of features between C# and VB.NET.

    [edit:] I've just found out that operator overloading is a new feature in VB 2005. So it looks like VB has a different set of obscure language features.[/edit]

    However, I'm not sure how that changes with .NET 2.0 - does VB support anonymous methods and suchlike? If not then it's a fair guess that C# 3.0 will make the difference more noticable.

  • User profile image
    jwignall

    C# is better because pretty much all MS code samples are C# with the VB translation bolted on as an afterthought.

    I code in VB.NET having come from classic ASP and so VB.NET was the first choice to get up and running fast.

    Some things do look easier to do in C# but I've never come accross anything that wasn't possible in VB

  • User profile image
    UlsterFry

    leeappdalecom wrote:
    UlsterFry wrote:I come from a similar background..  the best thing about c# is the discipline element..  vb lets you get away with murder.

    ..oh yeah, and c# is less verbose



    In what way?  if you have option strict on then both languages behave the same?


    They don't behave the same, because they have their own compiler with different options.

    I used vb with Strict on, granted it tighten the belt a good bit, I feel my programming has improved by using c#, maybe it's just a personal thing. I just prefer c# over VB, some people like it the other way round. Just use what you are comfortable with.


  • User profile image
    Massif

    Tensor wrote:


    You say yuo think 3.0 will widen the gap - in which way? LINQ will be implemented in both.



    I was thinking more of Lambda Expressions and Extensible methods. It is these more obscure features which I THINK - and I'm stressing that this is just a guess - is going to be where the differences will come.

    As for the "is it just personal preference" question. All programming languages can achieve the same thing - it's always a question of which tool makes it easiest to achieve what you want, and which tool you like.

  • User profile image
    BenZilla

    /Dons flame suit/

    Ok, this is not my personal opinion, but this could be the views of buisness. From my times around here and other places sometimes VB devs are viewd as "lesser devs*" and maybe businesses think that C# developers are just "better".

    *Please note I do not think this way, this is just observations I have witnessed in peoples opinions.

  • User profile image
    JeremyJ

    I think that companies sometimes prefer C# for the maintenance aspect.  C# syntax is closer to C/C++ syntax.  There are more C/C++ developers available than VB developers.  Finding staff to work on a C# project would probably be easier than a VB project because there are more people comfortable with the C# syntax.

  • User profile image
    Sabot

    Does this topic come up like once a month or what?

    If VS2005 did a comvertion from one language to another as standard we wouldn't be having this silly conversation yet again.

  • User profile image
    jmacdonagh

    One compelling reason to use C# over VB.net on larger projects is the fact that VB.net compiles your application in the background constantly, which his how you get informative errors in your code as you type. On larger projects this can definantly slow down the development time.

  • User profile image
    Harlequin

    if(XXX == YYY)
    {
          BLAH
    }

    If XXX = YYY Then
       BLAH
    End If

    --------------------------------

    I think it comes down to the squiggly brackets being easier to read, but then again I guess that could be preference. I just know I would not want to see a 20,000 line page of VB.NET and have to find something Smiley

  • User profile image
    littleguru

    Who is saying that one language is better then the other is not a real developer. More a script kiddie or a rookie, perhaps an average programmer.

    The problems appearing are platform and language independent. They will appear on every platform and have to be solved somehow. It's not important in which language they are solved: the way is always the same.

    Most people do problem solving in some meta language - some pseudo code.

    As I mentioned here: they are even. You can do with both exactly the same. Both are turing complete.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.