Is C# Better?

  • Gary, yes, features are different, there are global functions in VB that can't be accessed with the same type of object reference as in C#. However when it comes down to delivery of a complete application the difference in language features is never a reason to choose one language vs. another. I have never met a single programmer who'd say "I picked VB for project A, and C# for project B because I felt that was the most efficient language for the job". The truth is - the more efficient of the two is determined by your personal experience and constrains of the existing environment… and good or evil will of your IT manager…. depending on your approval of his choice 🙂

  • I look at it this way. There are many spoken languages and no one is any better than the other. English isn't better than German or French or whatever. All of them serve their purpose, to provide a "common" way for people to communicate with one another and express concepts, ideas, share information, etc.

    Similarly, programming languages, although varied, are intended to help us develop solutions. In a lot of cases it just comes down to personal preference. There are times where a specific language might be used because of historical reasons or rare occasions where it's necessary to use a specific language. For example, if you're creating a boot loader you're likely to use Assembly because you need that low level capability.

    In the end, if it gets the job done, who really cares what language is being used? Day to day I deal with everything from scripting (javascript, TCL, *nix shell, etc.) to actual languages (C#, VB.NET, Java) to databases (PL/SQL, TSQL) and it makes no difference to me so long as problems are solved at the end of the day. Since I already understand the concepts it's all just syntax (grammar in the case of my spoken language analogy).

    Happy Coding!

  • I use both VB.Net and C# in my job. I started with VB.Net because I had to port a VB 6 app over to .Net and it was very easy to do this in VB.Net (I was able to copy/paste) the code and then rework it to add the new features we needed. From then on, I've been using C#, I prefer the syntax a little better, except in one situation.

    VB.Net supports optional parameters which C# does not, and this comes in extremely handy when you are writing Office automation applications. We have an application that drives Word, and using VB.Net over C# saved hours in typing, even when you take into account all the End If statements.

    And someone said there is no try catch blocks in VB.Net? That's simply untrue.

  • Ed W. (11/13/2009)


    VB.Net supports optional parameters which C# does not.

    You'll like C# 2010 then:- optional parameters!

  • At first glance neither I came from a VB 4/5/6 background and learned C# as my first .Net program and used it for three years

    before using VB.NET

    Both VB.Net and C# have strengths if I were to begin from zero VB.Net is a much easier syntax to learn.

    There are things about how VB. Net handles the creation of window objects program objects i.e. excel without

    knowing what version is on a system that in my mind make it better. If I were to use it to create a Windows service

    I prefer C#. Most books on CLR in stored procedure seem to me to be in C#

    When I use SMO objects I use C#.

    My take is VB is probably easier to use it is the default language without some configuration changes of scripting

    in SISS. There is an inherent superiority that is undeserved C#. C# is closer to Java then C++ and if you want

    to use C++ use C++.Net otherwise there is little difference between the languages.

    I think VB.Net comes out ahead of C# based on the ease syntax . If I already knew one language I would not learn the other.

    If I were to stay within the tools provided and only program in SQL I would select VB.Net. Your life would be easier than C#;

  • Back in the days of VS 2002 and 2003, there was a larger gap between C# and VB.NET in terms of constructs and language features that were available. Quite frankly, C# was way ahead of the game. In VS 2005 and 2008, the two languages have come much closer together in terms of features. There are still some differences, but not nearly as many nor as significant as there used to be.

    I use VB.NET because that is what my department chose to go with before I was hired. When I first started, they were on 2003 and I found it frustrating on an almost daily basis to look up examples and discover that the constructs used were either C# specific, or much more difficult to implement in VB.NET. Now, we use VS 2008 and I hardly notice a difference.

  • If I get to choose the language, I tend to use C#. It was the first language I used for serious work (Yes I'm that young).

    I have had to, and still do, maintain systems coded in VB and I like to think that I use both languages equally well.

    To me, I think, it's the matter of aesthetics - I just like the looks of C# better. I like the semicolons and the curly braces. I think it looks neater somehow - it's hard to explain.

    To be very generalizing, languages are just syntax, the fundamentals behind all the languages are all the same. That's in my very inexperienced opinion. 🙂

  • to some degree it's personal preference.

    with the common .net runtime structure, managed code, garbage collection etc, all the languages are essentially constrained to the same set of capabilities

    C# is comfortable for c++ programmers, though it is missing some of the really powerful and elegant inheritance structure that c++ has, also it is much more restricted in low level machine access and the ability to control how machine code is generated.

    In the end the family of .net languages has subtly (but significantly) trimmed and modified the highly individual flavors (eliminating details that made each language unique) so they have simply become APIs for the .net structure rather than distinct languages in their own right.

    [Can you imagine a full (ie keeping all the functionality) .net implementation of Forth? or Lisp? I remember years ago when Borland tried to introduce a version of Prolog that was built on the procedural Pascal structure.... it looked like Prolog and had 'most' of the features of Prolog, but the stuff missing (missing because it simply could not work in that runtime structure) made in unusable for anything beyond a demo program]

    ...

    -- FORTRAN manual for Xerox Computers --

  • I don't think there is a big technical difference, however I believe there is a stigma that VB.Net programmers are not good programmers, and C# programmers are. I actually saw a job posting on that said "...If your last project was written in VB.Net, DO NOT APPLY."

  • By and large, I think this is a personal preference - most times having to do with personal history and experience. If you've been working with VB for a long time, given the choice, folks tend to stick with it. If you've been working with C/C++ for a long time, given the choice, folks will stick with that.

    But you'll have the same types of people in both camps that are bent on making it a religious war...very similar to the Mac vs. PC debate...

  • Jason Williams 42 (11/13/2009)


    I look at it this way. There are many spoken languages and no one is any better than the other. English isn't better than German or French or whatever. All of them serve their purpose, to provide a "common" way for people to communicate with one another and express concepts, ideas, share information, etc.

    though, to take your analogy further, there ARE differences in spoken languages that DO vary, some concepts are easier to explain in some spoken languages than others (few of us are fluent enough in multiple unrelated languages to see that, I just have to accept that statement from people who are)

    On interesting example, a few years ago there was a successful stage production in Britain about standup comedians and they decided to produce it in Germany. After an extended time, they failed to translate it, because many of the jokes relied on setting up a statement with one implication and flipping the whole meaning of the sentence by the last words. The more rigid word order structure of German simply killed those jokes.

    I have also been told (again second hand knowledge) that jokes are told very differently in ASL (American Sign Language) than in most spoken languages.

    ...

    -- FORTRAN manual for Xerox Computers --

  • I'm not a language purist, but I prefer C#. I've used both C# and VB.NET, but having taken a lot of C and Java in college, along with my brief experience with Perl and PHP, I've come to like the verbosity and clarity of semicolons and curly braces.

    As far as which is best, I haven't found anything that can be done in one langugage that can't be accomplished in the other. As you stated, both compile to essentially the same byte code, so it's a matter of preference.

  • My background is mostly VB and VB.NET but was once put on a C# project. I had very little problem switching from VB.NET to C#. Whether developers will admit to it or not, I think the term Basic in Visual Basic is a turn off for some. Technically and functionally, they are about the same. C# sounds cooler.

  • I was struck by the poster that said human languages are pretty much the same.

    I must disagree. They really aren't.

    Sure, they get the day-to-day jobs done. "I want food" "Where's the bathroom" "Joe is a moron." 🙂

    However human languages have encoded in them the world view of the language originators. For example Japanese has a very striking emphasis on status of the speaker as compared to the the listener. It also has the structural simplicity of Go, along with Go's subtelty and complexity.

    English is the generalist language. It's horrifically complex but as a jack-of-all-trades it lacks the interpersonal emphasis of Japanese (for example). Chinese has tones which make it difficult for most people to learn. Spanish has a beautiful elegance and simplicity from its consistancy--they don't need spell checkers, for instance. 🙂

    Computer languages are no different. Most may have been intended for general purpose languages (excluding things like TADS or Inform) but each emphasizes a different world view. C-family languages emphasize conciseness and core simplicty--at the expense of clarity, trading power for risk. They also abound in syntax-sugar, which for me is extremely bitter and unpalatable.

    Basic-style languages are more verbose but clearer for people who aren't developers that still want to review the code. (Managers for example... :))

    Python languages trade compiler-nannies for simplicity and elegance.

    And then there's LISP. Land of Infinite Stinking Parentheses...sigh.

    I've been in the business for 33 years now, and learned probably 50 different languages and dialects. My personal favorite from an admiration POV is Python, but my bread and butter is earned from VB-style languages (for a long time VBA).

    C-style languages are my least favorite, but then I've never been a fan of braces and semi-colons, and I really dislike languages that don't treat line breaks as syntactic elements. Although I will admit some constructs are more natural as multiline than single line.

    As far as C# vs VB.NET, give me VB.NET any day. But that's entirely from a syntactic preference, .NET languages, by and large, work the same way. The more you use .Net libraries, the less functional differences there are.

    It really is just a matter of syntax preference. And in my opinion that is the *point* of .NET.

  • I'm a VB.Net developer. I learned BASIC years ago in the 70s, but I actually started programming in classic ASP with Visual Studio 6 (ugly). I have nothing against C#. I use javascript on the client side and wouldn't mind learning C#.

    However, I prefer VB to C# for two reasons:

    1) I know VB better than the C languages

    2) VB is not case-sensitive - one less thing to worry about.

Viewing 15 posts - 46 through 60 (of 176 total)

You must be logged in to reply to this topic. Login to reply