Announcement

Collapse
No announcement yet.

VB.NET vs. C# what is better?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB.NET vs. C# what is better?

    I realize this is an age old comparison and I've come across many blogs and forum posts that cater to this topic, but most are filled with a lot of bias. I'm looking for an objective perspective. I'm really interested in knowing what would be best with respect to my career. Currently I've been spending some time with C# as it is considered the "flagship" language in VS.NET, however I can't help but long for the verbosity VB.NET offers.

  • #2
    As a user of both, i believe that VB is much faster in making apps than c# but lacks speed and some features of c#

    Comment


    • #3
      There are some details which differ between the languages, but for all intents and purposes (for normal application development) they're mostly the same.

      It comes more as a matter of personal preference, although if you're considering job markets, you might be better off with C# (might differ depending on location).

      Don't know what speed the previous poster is talking about, but the applications developed with either language will execute at the same speeds.

      Me, I write actively c/c++/java/perl5/c#/vb.net (and asm on occasion) and there simply are some jobs for which I prefer different languages. Although, vb.net is in the minority as c# is so similar in syntax to java so I've accustomed to it.

      Comment


      • #4
        Originally Posted by Maccara View Post
        Don't know what speed the previous poster is talking about, but the applications developed with either language will execute at the same speeds.
        U guessed right. I meant the execution speed. U are a more experienced programmer than me so u know better. I have heard although (haven't seen a difference myself) that VB is a bit slower than c# when it comes to application execution. I first learned VB6 (in the beginning of this school year), which I taught myself most of the features. Later, I taught myself VB.NET using vs2005, and recently (not even a month ago), I began teaching myself c#.

        It is obvious that I am quite inexperienced concerning c#, and I prefer VB because it is much more simple than c#.

        It is sad, although that vs2005 does not support filelistboxes etc. and uses those shitty dialogs (I still import them from VB6 when making an application )

        Comment


        • #5
          Just my 2 cents

          Originally Posted by echo_03 View Post
          U guessed right. I meant the execution speed. U are a more experienced programmer than me so u know better. I have heard although (haven't seen a difference myself) that VB is a bit slower than c# when it comes to application execution. I first learned VB6 (in the beginning of this school year), which I taught myself most of the features. Later, I taught myself VB.NET using vs2005, and recently (not even a month ago), I began teaching myself c#.
          It is obvious that I am quite inexperienced concerning c#, and I prefer VB because it is much more simple than c#.
          It is sad, although that vs2005 does not support filelistboxes etc. and uses those shitty dialogs (I still import them from VB6 when making an application )
          The execution time for VB.NET and C# are similar, as the compiled application is build using the same framework.
          With that being said, you can get some performance gains with C# over VB.NET, using the C# ability to do Unsafe code. But for most applications the performance is the same.
          Small projects tend to compile from the VS.NET IDE faster when using VB.NET, but the IDE slows down when the solution i getting up to a larger size (+30 projects).
          Then there is the Advantages of the languages.
          VB.NET
          • Support for optional parameters
          • Support for late binding
          • Support for named indexers
          • The with construct
          • Simpler Event handling
          • Catch ... When ... clauses

          C#
          • Support for unsigned types
          • The using statement
          • Explicit interface implementation
          • Ability to make unsafe code

          Some would argue that VB.NET's ability to use the "Microsoft.VisualBasic" namespace to implement the VB's legacy functions is a plus for VB.NET, but that in my appenion only makes the road to learning VB.NET longer than nessary. Do yourself a favor and turn that of in the IDE. :wink:
          So there are lot og pros and cons for both languages. But i always recommend learning C#, even for former VB programmers (like myself). And the reason is that once you ar comfortable with the C# syntax, when searching the net for code samples, you do not care if what you find is VB, VB.NET, C#, C++ or Java. You understand the syntax of them all, and can then transform it into your syntax of choice.
          Is i always tell the people i tried teaching how to code. "Programming is the language to learn. The rest is just syntax".
          So use the syntax you are most confortable with. Then it is the most fun, and you will be the best programmer you can be, when it is fun.
          Grenz
          Reality is an illusion caused by lack of alcohol

          Comment


          • #6
            Originally Posted by grenz View Post
            Reality is an illusion caused by lack of alcohol


            i don't have any prob with vb.net and except the filelist boxes i don't use any other vb6 routine.

            i know how to use dialogs but.... i don't like them since u can't customize the form (maybe i am wrong at this point) of the window and add some features which u may like.

            c# is a great language and i don't believe that the speed of the IDE is a problem 4 me (at least right now because the biggest application which i ever amde is 200 kb ) but for an experienced programmer it could be.

            Comment


            • #7
              Grenz is correct on advantages and disadvantages. It all boils down to planning and choosing the language you'll use depending on the situation. There's no point coding in asm what you can achieve with a 5 line perl script.

              In terms of speed...I hate managed code. I hate interpreted languages and JIT compiling. But then again I hate WinAPI too, with it's mess of COM objects :P Once you start coding in *nix, you'll find yourself installing cygwin on every windows system you own... Now Vista includes SUA and I'm intrigued to explore that path since it offers native x64 performance, something that cygwin lacks.

              If I had to absolutely choose between those 2, I'd choose C# due to the ability to write unsafe code and because I'm addicted to C. I'd take GNU C/C++ with the occasional inline asm any day.

              And when it comes to syntax, almost every decent language uses what we call "C-like syntax".
              Co-Creator of Akkadia MUD Game Engine Codebase (GPL 1999)
              In /dev/null no one can hear you scream!

              Comment


              • #8
                I have to fully agree with Grenz and Nodens here (could've given more details in my post too, but wanted to just keep it simple "use whatever you're comfortable with" ).

                About the IDE speeds, I'm working as a consultant on one particular project which consists of apprx 3 million lines of code (that is counting the stored procedures also) of mixed projects (C#, VB.NET, C++ & ASP) and you definitely notice some sluggishness when VB.NET background compiling is doing its stuff in VS - can't almost work at all on the VB.NET projects without a dual proc machine.

                There's been some work in getting rid of some of the VB.NET code there and breaking down some of the projects in to smaller pieces (there's quite a bit of legacy code converted from VB6 too) but of course it will take some time.

                For that, I'll always be thankful of cygwin and Emacs.

                Comment


                • #9
                  Some interesting points of view here, I've heard that C# is the more prominent language, but I can't help but gravitate towards the simplicity of the VB syntax.

                  Comment


                  • #10
                    http://www.lacoude.com/docs/public/VBversusCsharp.aspx

                    Comment

                    Working...
                    X