C#.net or VB.NET

Discussion in 'Programming' started by deshabhishek007, Aug 21, 2007.

  1. #1
    My senior friends at dp,
    this is my first post at dp,
    can you tell which programing language should i prefer??
     
    deshabhishek007, Aug 21, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    See which one you prefer? Langauges used with .NET are compiled into MSIL (ms interpreted language), so code written in C# or VB end up as more or less the same machine code. The differences are some syntax differences and some features but not much. Some people say that C# developers are paid better and that they snub VB developers but they are usually exaggerated claims. For the record, I chose and use C# (coming from a C/C++ background).
     
    krt, Aug 21, 2007 IP
  3. Felu

    Felu Peon

    Messages:
    1,680
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I prefer C# to VB if you ask me. C# is easier to learn and use that VB. There really isn't much difference except the syntax but i find C# to be easier than VB.
     
    Felu, Aug 21, 2007 IP
  4. mixke

    mixke Prominent Member

    Messages:
    5,917
    Likes Received:
    590
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Out of C# or VB , i would say go for C#.net if you have idea of C or C++ . Also , i believe C# is kinda easier than VB.net ;) :)
     
    mixke, Aug 21, 2007 IP
  5. deshabhishek007

    deshabhishek007 Banned

    Messages:
    1,133
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks friends,
    i will go for C#
    thanks again
     
    deshabhishek007, Aug 21, 2007 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    C# is more widely used commercially and so if jobs are a consideration then go for this.

    Personally would say VB Net is easier to learn as it is a basic language so reads much more like english than C# which obviously comes from the C stock with all its {}s and != etc.

    99% of the difference is syntax though and once you have learned one using the other is exceptionally easy - probably even more so if you use C# as VB.Net isnt case sensitive and so if you are in bad habits with VB moving to C# which is case senstive can be a pain
     
    AstarothSolutions, Aug 30, 2007 IP
  7. sdevil

    sdevil Guest

    Messages:
    661
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    C# is my choice. I come from C++ background and i find C# to be much more easier for me to pick up. Tried Vb.NET as well but did not like it
     
    sdevil, Aug 30, 2007 IP
  8. zac439

    zac439 Notable Member

    Messages:
    3,074
    Likes Received:
    214
    Best Answers:
    0
    Trophy Points:
    260
    #8
    Vb.net is a higher level language, therefore, it is actually the easiest language to start out with. It can be slower than C#, especially with larger programs.

    C# tends to have less code as a result, and is generaly faster. (this isn't always the case, however)

    http://www.ftponline.com/vsm/2003_06/magazine/features/salarysurvey/page3.aspx
    This link proves that C# programmers are paid more. Around $20,000 more on average. The exact code will go for a higher price. Why? Performance. Other factors of course matter too, but the industry standard got its reputation for a reason.

    Like previously stated, the languages are very similar.The 2005 versions of both languages have introduced unique aspects to the mix, however. Nothing that would probably sway your decision.

    I would suggest you learn C#, on the sole basis that you could turn it into a higher paying job if needed. Interestingly enough, there are converters that can convert between the two languages. So you could probably learn VB and port it to C# with minimal errors. (Although, some errors may result, and I personally wouldn't recommend it)

    Good luck :D
     
    zac439, Aug 30, 2007 IP
  9. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Given both are compiled before running into the same mid level language (if we are talking about ASP.Net given we are on a web development forum) there is no noticeable difference in run time after compiling.

    It does however logically follow that as more companies use C# than VB that there is more competition between companies to get the best people and as such they will pay more. As to the $20k more money earned.... the link doesnt quote a source for their information so I would take it with a large pinch of salt.

    This however is also a fairly short term view to take as when you look at ultimate career progression and so management level your actual programming languages become next to useless.
     
    AstarothSolutions, Aug 31, 2007 IP
  10. zac439

    zac439 Notable Member

    Messages:
    3,074
    Likes Received:
    214
    Best Answers:
    0
    Trophy Points:
    260
    #10
    http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=203
    Here is a link to support the fact that there is in fact a performance difference.

    As for the money difference, I've seen multiple results from Google stating the same thing.(I haven't researched it further)

    I know you've probably got way more experience than me in programming, but I do believe these two points to be true.
     
    zac439, Aug 31, 2007 IP
  11. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I have no experience at all, I am a project manager not a programmer myself other than as a hobby :)

    As I said, I agree a salary difference exists though would be surprised it is that big a gap but looking at starting salary may be short sighted

    Microsofts own comparison between the two languages is: http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx which confirms that there is no inherent speed differences
     
    AstarothSolutions, Aug 31, 2007 IP
  12. garazy

    garazy Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I honestly think that if you were learning from scratch C# is the way to go. As a professional software developer myself I have used C# since the creation of .NET.

    One think I was always wary of is job advertisements which start 'VB.NET DEVELOPER REQUIRED URGENTLY' as its normally a tell tale sign of some dev. upgrading to .NET from VB6 and not really caring about the language in the first place!
     
    garazy, Aug 31, 2007 IP
  13. printer

    printer Well-Known Member

    Messages:
    422
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #13
    I prefer c# and .Net

    VB is some different from them, but c# is some more common and new (strong)
     
    printer, Aug 31, 2007 IP
  14. deshabhishek007

    deshabhishek007 Banned

    Messages:
    1,133
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #15
    thanks friend,
    i have started learning C#,
    i do know about VB (need to practice a lot)
    thanks for your advice
     
    deshabhishek007, Sep 4, 2007 IP
  15. Diver10000

    Diver10000 Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I advise C#, it seems to have more advanced and flexible syntax, but I think VB.NET can do just as good.
     
    Diver10000, Sep 6, 2007 IP
  16. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #17
    I've been using VB.net for a while now but C# is more advanced. I'll eventually switch I think.
     
    qazu, Sep 6, 2007 IP
  17. deshabhishek007

    deshabhishek007 Banned

    Messages:
    1,133
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Thanks for the advice friends
     
    deshabhishek007, Sep 6, 2007 IP
  18. JenniP

    JenniP Peon

    Messages:
    250
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Generically its a myth that C# is faster than VB.NET, both compile to pretty much the same IL in 99% of cases. There are some calls that VB.NET will handle differently to C#, these are not the reason for the continuation of this myth. However in general use C# will be faster and here's the main reason why.

    Most of it is down to a little thing in VB.NET called Option Strict, this controls how type conversion is performed. By default Option Strict is turned off, this means that the compiler will do type checking and casting for you at run time, this has an overhead which is the main basis for the performance difference.

    Option Strict was set to off by default as Classic VB programmers are used to assigning variables to other variables and not really worrying about type conversion as it was all done for you, so Microsoft kept this disabled to ensure backward compatibility.

    If you turn Option Strict On, the runtime will cease to do any type checking and casting for you and it will perform the way C# does, however the developer has to do the type conversions in code in much the C# developer does.

    Trouble is it really has to be done at the very start of a project, you can of course turn it on at any time, but then have to large number of errors turning it on will generate.

    There are of course benefits to turning it off, it allows late binding to be performed, as it wont try and check a type at compile time something Option Strict on wont let you do.

    So best practice is to leave Option Strict turned On by default. If you have methods that need to late bind and your using .NET 2 you can wrap those up in a partial class using Option Strict Off on only the bits you need.

    Back to the posters original question though C# or VB.NET. To be honest it doesn't really matter there are thing both languages can do which the other cant, but on the whole they are very minor and certainly not general use. Its great to know both you never know when your going to get an example that's written in the one you don't know.

    Jen
     
    JenniP, Sep 7, 2007 IP
  19. amf-flt

    amf-flt Active Member

    Messages:
    100
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #20
    I'm also in the "it doesn't matter, use what's most comfortable and fastest for you". In fact, I use vb.net for winforms projects and c# for asp.net projects, just because that's what I'm most comfortable doing. Some people are faster in one or the other and you should do what gets the job done quickest (especially if you're busy).
     
    amf-flt, Sep 7, 2007 IP