Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. difference between C# and VB.Net except syntax Dinesh Says Thanx ....

difference between C# and VB.Net except syntax Dinesh Says Thanx ....

Scheduled Pinned Locked Moved The Lounge
csharpbusiness
68 Posts 36 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Igor Velikorossov

    Christian Graus wrote:

    The truth is, they generate the same IL

    no they don't.

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #44

    Igor Velikorossov wrote:

    no they don't.

    Maybe not exactly, but not different in any way that has a significant effect on performance, or anything else. The suggestion that C# IL is faster than VB IL is, frankly, ridiculous. Christian Graus - Microsoft MVP - C++

    I 1 Reply Last reply
    0
    • D Dejan Petrovic

      Christian Graus wrote:

      if you have a choice between a skilled VB team and a skilled C# team ...

      Christian Graus wrote:

      If you have a choice between a C# team and a team who went to VB.NET from VB6 ...

      Is there a single VB.NET team that does not have an origin in the VB? :-O

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #45

      Lots of people are picking up VB for the first time because of Express. VB6 has been out of date for 4 years, surely someone learned VB in that time ? Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • C Christian Graus

        Igor Velikorossov wrote:

        no they don't.

        Maybe not exactly, but not different in any way that has a significant effect on performance, or anything else. The suggestion that C# IL is faster than VB IL is, frankly, ridiculous. Christian Graus - Microsoft MVP - C++

        I Offline
        I Offline
        Igor Velikorossov
        wrote on last edited by
        #46

        Christian Graus wrote:

        The suggestion that C# IL is faster than VB IL is, frankly, ridiculous.

        Christian pls point me where I have suggested that.

        C 1 Reply Last reply
        0
        • I Igor Velikorossov

          Christian Graus wrote:

          The suggestion that C# IL is faster than VB IL is, frankly, ridiculous.

          Christian pls point me where I have suggested that.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #47

          Fair enough, I apologise for the assumption, but it's claimed often enough, and beyond that, I didn't see any reason to point out that the IL isn't exactly identical. All I meant was, the compile to the same intermediate language, not that the IL would look exactly the same. Although, I would contend they will run basically the same, for the same code. Christian Graus - Microsoft MVP - C++

          C 1 Reply Last reply
          0
          • S She chewy

            :confused:If VB6 is so good, why microsoft still throw in the money to invest on C#? Chewy

            S Offline
            S Offline
            sultan alsouz
            wrote on last edited by
            #48

            Think about it, if XYZ company solid cars with no choice, just black color, surely people would go for other car brand, its marketing and promotions. I still think it is better to address the competitive advantage rather than disadvantages of each language. One advantage of VB programmers is that they can focus on the business process implementations and not just debug code (funny, why compile twice, once in your brain and second in computer’s CPU) , too much space for errors can confuse and make you loose track of your goal. To get knowledge you must share it first.

            1 Reply Last reply
            0
            • D DineshSharma

              can anybody confirm me theat whats the basic difference between c# and VB.Net. why should I use the C# for my business application development and why vb.net Dear all ...Thanks a lot for your suggestion and a lot of responces.......Thanx:laugh: Dinesh Sharma -- modified at 8:01 Tuesday 16th May, 2006

              N Offline
              N Offline
              nobel tele gl
              wrote on last edited by
              #49

              It's my experience, with .NET framework 2.0 that it's a matter of syntax, both languages have almost the same feature, is true that in VB you would need to write a little more code, and some people i know also says that VB is a "messy" language, but you can do practically the same things i both languages. It's my opinion that nothing is impossible, it's "just" at matter of enough knowledge, time and money.

              1 Reply Last reply
              0
              • M meywd

                that is a limitation for OO languages, C++ allow multiple inheritance, but C#,VB.NET(which you can call, an OO copy of VB), and java doen't allow it,because they are a full OO lnaguages

                G Offline
                G Offline
                GEAK
                wrote on last edited by
                #50

                Responses to a couple issues: I used to teach OOP using C++ in college and although I came up with examples using multiple inheritance I never encountered a real-world situation where it was necessary. IMHO, I don't think multiple inheritance is all it's cracked up to be. As to the difference between C# and VB.Net, I've programmed in both (moreso in VB.Net) and found very few differences between them. As well, the more current the version of the .Net framework you use (ignoring syntax), the fewer differences exist. Having said that, there is one major difference I have found: Among the developer community - at least in the region I'm living in - there appears to be a tremendous bias against developing in VB.Net. I suspect this is a throwback to the earlier versions of VB. I've found that 95% of the programs I wrote in C++ could easily be written in either C# or VB.Net and my personal preference would be VB.Net. But when I list VB.Net as my second language on a resume I'm usually declined interviews - the employers appear to be avoiding VB coders. GEAK

                K 1 Reply Last reply
                0
                • D DineshSharma

                  can anybody confirm me theat whats the basic difference between c# and VB.Net. why should I use the C# for my business application development and why vb.net Dear all ...Thanks a lot for your suggestion and a lot of responces.......Thanx:laugh: Dinesh Sharma -- modified at 8:01 Tuesday 16th May, 2006

                  H Offline
                  H Offline
                  Hemanth M
                  wrote on last edited by
                  #51

                  C# is a clean language.Its completely object oriented...where as VB.NET supports procedures along with classes.If your project is very big...u will feel the difference while maintaining the project. Hemanth

                  1 Reply Last reply
                  0
                  • S Super Lloyd

                    if you remove the syntax issue much is left out.... Anyway, here on CP are a few articles doing comparison: http://www.codeproject.com/dotnet/vbnet_c__difference.asp[^] http://www.codeproject.com/useritems/vbdefamation.asp[^] And I want to add VB is much more verbose, same code is about 10% bigger, because of longer keywordand syntax. This 10% more opportunity for bug! Althoug VS.NET autocompletion is good at getting rid of them...

                    K Offline
                    K Offline
                    Kenneth Kasajian
                    wrote on last edited by
                    #52

                    It's true that more code can mean more bugs, but code bloat because keywords in one language are longer than in another is not going to contribute to "more code".

                    1 Reply Last reply
                    0
                    • S She chewy

                      :confused:If VB6 is so good, why microsoft still throw in the money to invest on C#? Chewy

                      H Offline
                      H Offline
                      Habeeb Rushdan
                      wrote on last edited by
                      #53

                      Good question. I was wondering the same thing too when I first heard that Microsoft had hired the former Borland Delphi guy Anders Hejlsberg to be become their lead C# architect several years ago. However, I quickly realized a good reason why those clever guys at Microsoft did it. You see, C# is very, very, and I mean very close to the syntax of Java. Therefore it is easy for Java developers to pickup C#. I have personally worked with several developers that have made the switch from Java to C# and they were pleasantly surprised at the ease of transition. To see the syntax differences for yourself I suggest you check out this excellent comparison website I found while searching on google. http://www.harding.edu/USER/fmccown/WWW/java1_5_csharp_comparison.html[^] Thanks, Habeeb Live long and code proper!

                      1 Reply Last reply
                      0
                      • G GEAK

                        Responses to a couple issues: I used to teach OOP using C++ in college and although I came up with examples using multiple inheritance I never encountered a real-world situation where it was necessary. IMHO, I don't think multiple inheritance is all it's cracked up to be. As to the difference between C# and VB.Net, I've programmed in both (moreso in VB.Net) and found very few differences between them. As well, the more current the version of the .Net framework you use (ignoring syntax), the fewer differences exist. Having said that, there is one major difference I have found: Among the developer community - at least in the region I'm living in - there appears to be a tremendous bias against developing in VB.Net. I suspect this is a throwback to the earlier versions of VB. I've found that 95% of the programs I wrote in C++ could easily be written in either C# or VB.Net and my personal preference would be VB.Net. But when I list VB.Net as my second language on a resume I'm usually declined interviews - the employers appear to be avoiding VB coders. GEAK

                        K Offline
                        K Offline
                        Kenneth Kasajian
                        wrote on last edited by
                        #54

                        Good post. I find multiple-inheritence to be quite useful -- it's a clean way to apply the mix-in pattern. In ATL, for instance, it's kind of slick the way you can add different functionality to your class by inheriting from an implementation. The problems with multiple implementation inheritence have been discussed in great detail by others, and they are real. However, it is also not the case that it is completely useless. In program in both C# and VB.NET. I use C# for professional development, for products, and custom solutions. I use VB.NET of in-house IT related coding. It's easy to hand over VB.NET code to an IT guy who's not really a programmer, but knows a bit of scripting, then giving him C# code. It's easier because of perception, but not reality -- but you know what they say about perception. A feature that I find invaluable in VB.NET is how you can use late-binding, similar to old VB, and VBScript. This makes script like much cleaner looking. C# lacks automatic language-level late-binding the way VB does so when you write code, it looks a lot more bulky. The downside with late binding is that you don't find out you got a problem until it's too late. I would never use it for production code -- but for IT scripting style coding, it's much better. Another thing I like about VB.NET are the new "My" variables. It's just a lot easier than using the .NET framework classes for common operations. I am so utterly indifferent about syntax, that I just can't bring myself to have an actual opinion as to which style is better -- it's just doesn't matter to me -- I'll let others debate whether BEGIN / END is better or worse thatn {, }. It would be a futile discussion with no tangible outcome. Give me a completely different language such as full ANSI Common Lisp under .NET, then we're talking about a different programming paragidm that could be interesting. But C# and VB.NET pretty much are the same thing.

                        D 1 Reply Last reply
                        0
                        • C Christian Graus

                          There is a degree to which you're asking about the difference between Roman Catholic and Orthodox here - a degree to which the two sides will say 'the other will burn in HELL'. The truth is, they generate the same IL, so in the hands of a good programmer, there's no difference. However, VB contains a lot of stuff that Microsoft wanted to kill, and the VB community would not let them, C# is by far a better designed language, IMO. I also personally hate VB syntax, it gives me a gut ache. Some people feel the same about C#, I'm told. So, if you have a choice between a skilled VB team and a skilled C# team, and you don't care about the stigma of VB, toss a coin. Otherwise, if you're going to learn a language, I'd say toss a coin again. If you have a choice between a C# team and a team who went to VB.NET from VB6, I'd take the C# team, every time. Christian Graus - Microsoft MVP - C++

                          K Offline
                          K Offline
                          Kenneth Kasajian
                          wrote on last edited by
                          #55

                          I never really bought the argument that because both languages compile into IL, then it doesn't matter how the code is generating. That's like saying that both Cobol and C and compilers compile down to assembly language, so it doesn't matter. If that were the case, JScript.NET code, which compiles down to IL, would execute at the same speed as C# code, but we all know JScript.NET generated code is slower by a magnititude.

                          C 1 Reply Last reply
                          0
                          • P Phil J Pearson

                            C# is a language; VB is a pidgin! :-D

                            K Offline
                            K Offline
                            Kenneth Kasajian
                            wrote on last edited by
                            #56

                            The elitist argument for C# over VB.NET is unsustainable. A new generation will realize it doesn't matter, but then again, by then VB.NET might be dead. :)

                            1 Reply Last reply
                            0
                            • K Kenneth Kasajian

                              I never really bought the argument that because both languages compile into IL, then it doesn't matter how the code is generating. That's like saying that both Cobol and C and compilers compile down to assembly language, so it doesn't matter. If that were the case, JScript.NET code, which compiles down to IL, would execute at the same speed as C# code, but we all know JScript.NET generated code is slower by a magnititude.

                              C Offline
                              C Offline
                              Christian Graus
                              wrote on last edited by
                              #57

                              Sure, I'm not saying it doesn't matter, I'm saying it doesn't matter in the case of those two languages, the two flagship languages of the framework. That is, they are not different in ways that cause huge differences in performance. Christian Graus - Microsoft MVP - C++

                              1 Reply Last reply
                              0
                              • S She chewy

                                :confused:If VB6 is so good, why microsoft still throw in the money to invest on C#? Chewy

                                R Offline
                                R Offline
                                robvon
                                wrote on last edited by
                                #58

                                C# was born to fight off Java, there was never a technical reason to invent a new language. It does give the curly brace lovers something to hold onto though and something for us to argue about ad nauseum in forums. Such fun.

                                1 Reply Last reply
                                0
                                • C Christian Graus

                                  Fair enough, I apologise for the assumption, but it's claimed often enough, and beyond that, I didn't see any reason to point out that the IL isn't exactly identical. All I meant was, the compile to the same intermediate language, not that the IL would look exactly the same. Although, I would contend they will run basically the same, for the same code. Christian Graus - Microsoft MVP - C++

                                  C Offline
                                  C Offline
                                  cheetuan
                                  wrote on last edited by
                                  #59

                                  I am not sure about .NET 2.0, but in .Net 1.x, I actually read an article which illustrate C# compiler actually generate more effencient IL than VB.Net. C# out perform VB.Net in speed and memory usage. The article use a reflection sample code came with .NET framework and dissamble the IL generated by from C# and VB.NET compiler for comparision.

                                  C 1 Reply Last reply
                                  0
                                  • N NeverHeardOfMe

                                    A difference between the C "family" and the Visual Basic "family" used to be that the former was a better choice if application performace was your goal, and the latter if productivity (ie producing a working programme quickly) was more important. With the introduction of .NET this difference though perhaps still there to some extent is less the case - and one has to wonder if that is a good thing...

                                    Marc Clifton wrote:

                                    Those who know the answer use C#. Those who have to ask use VB.

                                    Code-snobs choose C because they think it makes them look smarter. Smart people choose VB because it's easier. :) cheers P

                                    C Offline
                                    C Offline
                                    cheetuan
                                    wrote on last edited by
                                    #60

                                    :confused:Microsoft is not being very smart because they use C# to developed .NET framework. However smart people like you have to use a product developed by a not very smart people.

                                    1 Reply Last reply
                                    0
                                    • C cheetuan

                                      I am not sure about .NET 2.0, but in .Net 1.x, I actually read an article which illustrate C# compiler actually generate more effencient IL than VB.Net. C# out perform VB.Net in speed and memory usage. The article use a reflection sample code came with .NET framework and dissamble the IL generated by from C# and VB.NET compiler for comparision.

                                      C Offline
                                      C Offline
                                      Christian Graus
                                      wrote on last edited by
                                      #61

                                      I've seen the same articles. It's true that the IL for VB is slightler larger ( I think it's WORD aligned, actually ), but to say that makes it faster in a meaningful, consistent way is actually a fantasy. Christian Graus - Microsoft MVP - C++

                                      1 Reply Last reply
                                      0
                                      • D DineshSharma

                                        can anybody confirm me theat whats the basic difference between c# and VB.Net. why should I use the C# for my business application development and why vb.net Dear all ...Thanks a lot for your suggestion and a lot of responces.......Thanx:laugh: Dinesh Sharma -- modified at 8:01 Tuesday 16th May, 2006

                                        A Offline
                                        A Offline
                                        Andrew Eisenberg
                                        wrote on last edited by
                                        #62

                                        Well, this thread looks like the usual "relgious" wars between one language and the other. As many others have said the choice depends on personal preference. But, I didn't see a poster state what is the main reason for some of us use one language over another. It is that our employers/clients made us use it. Even so, I don't mind my company's language of choice, C#, as I come from a Unix/C/Java background and C# was trivial to pick up. An interesting historical point is that BASIC in all its forms was pretty much dead outside of academia until Microsoft Released Visual Basic 1.0. Now, VB.NET is a far cry from VB 1.0 and I don't have the time to list all the reasons why. And while I personally don't care for the syntax of VB in any of its forms, I have to be fair and say that VB.NET is a credible alternative to C# and most of the differences that many have mentioned are not the core of the .NET framework. Outside of IT, most people wouldn't care if everything was still writen in COBOL as long as their paycheck is on time and their bank and credit card statements are accurate. So, as long as you can get away with using it, use whatever works better for you. Andrew C. Eisenberg Nashville, TN, USA (Yes Virginia, there are rock and roll stations in Nashville! :laugh:)

                                        N 1 Reply Last reply
                                        0
                                        • D deanme

                                          Gonzalo Brusella wrote:

                                          Basic, in general (and all his flavors: QB, Turbo, GW, etc.) is not a good and "serious" language.

                                          One of my undergraduate professors said the same thing about BASIC in 1985. 20+ years later Visual Basic is still one of the most used languages out there. I've heard the MS rumors about wanting to kill VB. Considering how many VB programmers there are, it is unlikely MS will be able to get rid of it any time soon.

                                          G Offline
                                          G Offline
                                          Gonzalo Brusella
                                          wrote on last edited by
                                          #63

                                          I've used to work on MS Latam Developers Support. All the "sponsored" projects on MS Alliance Partners are on C#... Why? The answer is simple: The development word is tending to use C-like coding (C++/C#/JavaScript/Java/Many others), I love the brackets and to be forced to declare the variables on the conde.. You may say "Hey VB with the Option Stict could do it". But it's only an option to the developer. I like those languages that "enforce" the good coding practices. That's all.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups