Visual Basic or Visual C#

Discussion in 'Programmer's Corner' started by anhnha, Sep 16, 2014.

  1. anhnha

    Thread Starter Active Member

    Apr 19, 2012
    774
    48
    I am going to write some software for image processing, using RS232 port communications. Which language is better, Visual Basic or Visual C#?
    Thanks.
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    C# is better in my opinion, I dislike interpreted languages when attempting processor intensive actions (e.g. image processing).(Edit: See below)

    Plus, the many forms of BASIC are extremely limited in the scope of modern programming languages...
     
    Last edited: Sep 17, 2014
    anhnha likes this.
  3. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    Are you using mcu communicate with computer?
    Are you using the 128x64 or 320x240 LCD to display the image with mcu?
     
    anhnha likes this.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    In their current "dot net" versions there is just a hair's breath of difference between the two as they share the same sets of underlying runtime routines.

    I have always preferred VB for the speed and ease that forms (windows) may be constructed and used, though it is possible VC has caught up here.

    Also, I don't think Basic has been an interpretive language since it got that V for visual.
     
    anhnha likes this.
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Visual Basic 6.0 was interpreted, but could be compiled.

    Looking further, it does seem that there is not much of a difference between VB .NET and Visual C#, syntax aside. Both seem to do the interpreted to a point and compiled thing...
     
  6. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    true but VB has more polished and smarter interface even if both are parts of same Visual Studio version.
     
    anhnha likes this.
  7. MrSmoofy

    Member

    Jul 28, 2014
    112
    5
    VB.NET and C# both compile down to MSIL so it doesn't matter which one you use really. It's more of what experience you have. For me coming from Basic, Cobol, Quick Basic, Delphi, Visual Basic it was easier for me to go to C# then to VB.NET never understood why I think it was more I couldn't use the VB syntax in C# so it forced me to learn better ways of doing thigns rather then sticking to old bad habbits using VB.

    You will probably want C# though for image processing but that's just my preference.
     
    anhnha likes this.
  8. vpoko

    Member

    Jan 5, 2012
    258
    47
    This is very incorrect. Both C# and VB.NET compile to an intermediate language similar to Java bytecode, and are then just-in-time compiled to native code when executed. Performance is identical for both (with the exception that only C# allows unsafe code, which may have a performance advantage, see my answer below).
     
    Last edited: Sep 16, 2014
  9. vpoko

    Member

    Jan 5, 2012
    258
    47
    The majority of differences between VB.NET and C# are syntactic. For example, VB.NET uses begin/end statements, while C# uses curly braces. The libraries, of course, are identical, and most features exist in both languages. That said, there are a few features in C# that are not available in VB.NET, most of all, unsafe pointers.

    I would recommend C# primarily because it has much greater market share, meaning more people are programming in it, and consequently it's easier to get help, find examples, etc. Also, if you learn C#, it will be easier to parlay that into employment than VB.NET experience. However, since the similarities greatly outweigh the differences, once you learn one, it will be extremely trivial to learn the other.
     
    anhnha likes this.
  10. vpoko

    Member

    Jan 5, 2012
    258
    47
    I'm not sure what you mean by that. The Visual Studio designers (e.g., the one for Windows Forms) are identical for both languages.
     
  11. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Yes, please read my response to Ernie.
     
  12. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    I've programmed commercially in both for years (decades in the case of VB) and the big difference is that C# encourages better programming practices and incorporates a lot of learning from the last few decades of language development. VB is still stuck with what feels like old and clunky syntax. I find it hard to see why anyone would start any new project in VB rather than C#, other than VB being the only language they know; but even then I would encourage the switch.
     
    anhnha likes this.
  13. anhnha

    Thread Starter Active Member

    Apr 19, 2012
    774
    48
    Thank all for the replies!
    I think I will choose C# because I know C and a little C++. BTW, many people seem to prefer C#.
    Images are captured by camera and then it may be processed and transmitted to computer through RS232 to further process.
    The camera will capture images of components and then these images will be analysed to see if there is an error or not.
    I don't think that I need LCD with MCU here.
    (actually, I am not sure)
     
  14. vpoko

    Member

    Jan 5, 2012
    258
    47
    My apologies for replying without having read the whole thread, your clarification is spot-on.
     
  15. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Not to hijack, but we started out talking about Visual Basic and ended up talking about VB.net. What's the difference?
     
  16. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    Absolutely no difference, as the "VB" in "VB.net" is an abbreviation for Visual Basic.

    VB.net just happens to be the latest offering of VB from Microsoft.
     
    Brownout likes this.
  17. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  18. vpoko

    Member

    Jan 5, 2012
    258
    47
    The last version of VB was VB6, many years ago. Microsoft then discontinued the product in favor of VB.NET, which is built on top of the .NET Framework. Like other products that got the .NET treatment (say, ADO vs. ADO.NET), the .NET version doesn't much resemble the one it's replacing; in this case, that's a good thing, since VB.NET is a powerful, full-featured, statically typed language. Code developed in any .NET language compiles to the same intermediate language, which is then run inside a virtual machine. As such, code written in any .NET language can make use of routines written in any other .NET language. The managed runtime (VM) also provides services like bounds checking, garbage collection, type safety, and exception handling. Some syntax and keywords have been carried over from VB to VB.NET, but they are much more different than they are similar (and way more different than VB.NET and C# are from each other).
     
    Last edited: Sep 18, 2014
    Brownout likes this.
Loading...