Results 1 to 13 of 13

Thread: Whats the difference between C# and VB?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    146

    Whats the difference between C# and VB?

    Whats the difference between C# and VB?

    Is one better than the other or something?
    [email protected]

    Currently Using:
    Microsoft Visual Basic 2008 Expess Edition
    Windows Vista Home Basic
    1280 x 1024

    Rank:
    Novice


  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Whats the difference between C# and VB?

    No real difference as they both use the same .NET framework. Its mainly syntax but a few variations like C# being able to handle pointers and VB being more of a RAD language separates teh two. The two are provided for programmers that are coming from C++ or Java to be more familiar with the syntax of C# and VB is more familiar with VB 6 and previous programmers.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: Whats the difference between C# and VB?

    C# vs VB is all a matter of style.

    If you look closely at the features of both languages, you'll see that VB offers about as many features that C# doesn't have that C# offers that VB doesn't have.

    C#:
    - allows unsafe code (although you'll seldom see this used)
    - allows assignments within expressions (e.g., if ((x = y.Value) == 2))
    - anonymous methods

    VB:
    - allows optional parameters (but overloading methods is available in both C# and VB)
    - allows you to define types within interfaces (although I've never wished I had this in C#)
    - has a very flexible 'Select' construct (much more flexible than 'switch')
    - has the 'When' filter for 'Catch' blocks (ok - I'm really stretching now...)
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

  4. #4
    New Member
    Join Date
    Dec 2007
    Posts
    11

    Re: Whats the difference between C# and VB?

    Quote Originally Posted by David Anton
    C# vs VB is all a matter of style.

    If you look closely at the features of both languages, you'll see that VB offers about as many features that C# doesn't have that C# offers that VB doesn't have.

    C#:
    - allows unsafe code (although you'll seldom see this used)
    - allows assignments within expressions (e.g., if ((x = y.Value) == 2))
    - anonymous methods

    VB:
    - allows optional parameters (but overloading methods is available in both C# and VB)
    - allows you to define types within interfaces (although I've never wished I had this in C#)
    - has a very flexible 'Select' construct (much more flexible than 'switch')
    - has the 'When' filter for 'Catch' blocks (ok - I'm really stretching now...)
    Question: is C# faster than Vb ?

  5. #5
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Whats the difference between C# and VB?

    So I've been told.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Whats the difference between C# and VB?

    I dont believe so as I thought something along those lines of questioning was asked to the Ms guys the other week and it seemed it was negligible at best.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Whats the difference between C# and VB?

    Because of VB's verbose nature, the MSIL code produced can be slightly longer in some cases. This can make equivalent C# code faster, but the difference is negligible. The speed boost that C# can provide is courtesy of unsafe code, which the majority of C# developers will never use. In computationally intensive sections of code, like heavy-duty string manipulation, unsafe code can provide a very significant speed boost.

    VB and C# are just two languages. Is English better than French?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Whats the difference between C# and VB?

    Oh course English is waaaay better then French

    Unless you are doing an intense process or have a large program, the differences will never be noticed and difficult to measure the differences.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Whats the difference between C# and VB?

    There's not really a difference per say.. Just think of it the way Microsoft was. There were three major types of programmers and Microsoft's number one goal was to become the top. What better way than to monopolize the development and programming industry? C# was made to snare the C and C++ programmers, VB .Net was made to grab the VB 6 and lower programmers, and J# was made to take the java programmers. Also, they were combining all of these languages to be held under one framework so they could go together so well. Honestly, it was quite a novel idea, in my opinion.

    As for people that argue that there is a large difference between languages such as VB .NET and C#, that is because along the line, they have grown to be used for different things. VB being for RAD development and C# for "faster" execution time and stuff of the sort, but really, the only difference that someone such as yourself would need to know is that of the syntax differences. They all use the same framework and all in all can be used to do the same thing.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    146

    Re: Whats the difference between C# and VB?

    Okay, probablymillions of reasons why this hasnt happened. One probably being too much file size.

    But why dont they combine the two?
    [email protected]

    Currently Using:
    Microsoft Visual Basic 2008 Expess Edition
    Windows Vista Home Basic
    1280 x 1024

    Rank:
    Novice


  11. #11
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Whats the difference between C# and VB?

    Because for one, it will piss a lot of people off because they'd have to learn a new language, two, they would lose a lot of money in having to do new documentation and getting rid of the old ones, and stuff like that. Imagine all the stuff on the web that has to do with C# and VB .NET. Imagine if they'd have to do all of that for another language. It's just not a good idea. Besides, people like to choose between VB .NET and C#. Some people have a different upbringing. If they grew up with C and C++, they want to use C# and not VB or a mix of the two and if someone grew up with VB then they wouldn't want to use C# but rather VB .NET. Besides, at this point in time, the languages do have their differences. They are coming to be used with completely different things.

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Whats the difference between C# and VB?

    There are strong partisan camps for both VB and C#. It seems like J# is fading out, but the other two probably never will, especially since there are significant numbers who just refuse to switch.
    My usual boring signature: Nothing

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Whats the difference between C# and VB?

    Given the stink kicked up when Microsoft "abandoned" all its VB6 developers and "forced" them to use VB.NET, I can't imagine the backlash if they now discontinued VB.NET.

    Why would they combine the two though? What benefit is there to us or them if they do? They are two different languages. We have the choice of using one or the other or both. Why would anyone complain about that? VB.NET and C# are two different languages. They support a common class library, which is a plus, but they are two different languages, which is a plus.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width