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. VB/C# question

VB/C# question

Scheduled Pinned Locked Moved The Lounge
csharpquestionlearningperformancehelp
13 Posts 9 Posters 0 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.
  • L lintybits

    OK, I admit it, all my .net development experience has been in vb. I'm moving in a couple weeks, and have been offered a new job at a small company working on their ecommerce sites, which are all written in C#. I've told the lead developer there that my work experience has always been vb (got a little C from way back), he doesn't seem concerned. I'm up for learning C#, and probably should anyway, but I'm a bit worried about getting up to speed. My question - other than the syntax differences, are there any major differences between vb & C# that I should focus on first? don't want to turn this into an argument, just want to get some advice on where to begin. Any book recomendations would help. thanks

    D Offline
    D Offline
    Dan Neely
    wrote on last edited by
    #4

    This is a useful syntax reference. I'm mainly a C# person, and consult it regularly when having to do VB maintainance. http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html[^]

    -- Rules of thumb should not be taken for the whole hand.

    1 Reply Last reply
    0
    • L lintybits

      OK, I admit it, all my .net development experience has been in vb. I'm moving in a couple weeks, and have been offered a new job at a small company working on their ecommerce sites, which are all written in C#. I've told the lead developer there that my work experience has always been vb (got a little C from way back), he doesn't seem concerned. I'm up for learning C#, and probably should anyway, but I'm a bit worried about getting up to speed. My question - other than the syntax differences, are there any major differences between vb & C# that I should focus on first? don't want to turn this into an argument, just want to get some advice on where to begin. Any book recomendations would help. thanks

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #5

      I had 4 years programming experience with VB.Net and all of the sudden switched to C#. I was up to speed in two weeks. It's easy don't worry about it.


      how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

      1 Reply Last reply
      0
      • K Kevin McFarlane

        Given that you're already familiar with .NET a good book to get you up to speed on C# is Jesse Liberty's Programming C# (now in its 4th ed) because it focuses more on the language and less on ADO.NET, Win Forms, etc., although it does cover those topics too. BTW, I've just gone the other way recently - from C# to VB. Though I had done a little VB .NET before and a lot of VB before. Something that will also be handy as you go along are those VB-C# converters. The one at http://www.developerfusion.co.uk[^] is good.

        Kevin

        D Offline
        D Offline
        Daniel Grunwald
        wrote on last edited by
        #6

        The converter at developerfusion [^]is a ancient version of the SharpDevelop C#<->VB converter. http://developer.sharpdevelop.net/codeconvert.net/[^] (will go offline sometime today, we're getting a new server) runs a more recent version that supports .NET 2.0 and doesn't drop comments in the conversion. You can also install SharpDevelop and convert files (or whole projects) offline. Note that it is a syntax converter only - it won't correct the semantics (except for a few special cases), especially because it is unable to know what type an expression has, so it does not know whether to convert 'var("name")' to 'var("name")' or 'var["name"]'.

        K 1 Reply Last reply
        0
        • D Daniel Grunwald

          The converter at developerfusion [^]is a ancient version of the SharpDevelop C#<->VB converter. http://developer.sharpdevelop.net/codeconvert.net/[^] (will go offline sometime today, we're getting a new server) runs a more recent version that supports .NET 2.0 and doesn't drop comments in the conversion. You can also install SharpDevelop and convert files (or whole projects) offline. Note that it is a syntax converter only - it won't correct the semantics (except for a few special cases), especially because it is unable to know what type an expression has, so it does not know whether to convert 'var("name")' to 'var("name")' or 'var["name"]'.

          K Offline
          K Offline
          Kevin McFarlane
          wrote on last edited by
          #7

          I'm still doing .NET 1.1 and found it good enough for my purposes.:) Even if you have to tweak the results a bit it's still preferable to starting from scratch.

          Kevin

          D 1 Reply Last reply
          0
          • K Kevin McFarlane

            I'm still doing .NET 1.1 and found it good enough for my purposes.:) Even if you have to tweak the results a bit it's still preferable to starting from scratch.

            Kevin

            D Offline
            D Offline
            Daniel Grunwald
            wrote on last edited by
            #8

            Well, the new version doesn't drop comments and auto-renames fields when converting from C# to VB and a field name collides with a property name because both only differ in case. But a high-level C# <-> VB converter can never work without manual tweaking. If you want to optimally keep the old behavior, you have to decompile into the new language using Reflector. Which (to come back on topic) is a good tool to learn the differences between C# and VB because you can see what's going on under the hood when you use VB.

            D 1 Reply Last reply
            0
            • D Daniel Grunwald

              Well, the new version doesn't drop comments and auto-renames fields when converting from C# to VB and a field name collides with a property name because both only differ in case. But a high-level C# <-> VB converter can never work without manual tweaking. If you want to optimally keep the old behavior, you have to decompile into the new language using Reflector. Which (to come back on topic) is a good tool to learn the differences between C# and VB because you can see what's going on under the hood when you use VB.

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #9

              Daniel Grunwald wrote:

              But a high-level C# <-> VB converter can never work without manual tweaking. If you want to optimally keep the old behavior, you have to decompile into the new language using Reflector. Which (to come back on topic) is a good tool to learn the differences between C# and VB because you can see what's going on under the hood when you use VB.

              So why doesn't someone write a converter that does that, and then uses the original source to reimport the comments?

              -- Rules of thumb should not be taken for the whole hand.

              D 1 Reply Last reply
              0
              • D Dan Neely

                Daniel Grunwald wrote:

                But a high-level C# <-> VB converter can never work without manual tweaking. If you want to optimally keep the old behavior, you have to decompile into the new language using Reflector. Which (to come back on topic) is a good tool to learn the differences between C# and VB because you can see what's going on under the hood when you use VB.

                So why doesn't someone write a converter that does that, and then uses the original source to reimport the comments?

                -- Rules of thumb should not be taken for the whole hand.

                D Offline
                D Offline
                Daniel Grunwald
                wrote on last edited by
                #10

                Probably because the decompiler from Reflector cannot be reused but is obfuscated; and writing such a decompiler is not an easy task. And because it's hard to find the correct position to re-insert the comments - the decompiler would have to associate the generated code lines with IL statements which then can be associated with the original source lines using the debug symbols. And did you ever look at the C# code generated from "VB" IL? Tons of calls into Microsoft.VisualBasic.dll, even for the most simple things like comparing two strings. Not to mention many foreach-loops get expanded into a "enumerator = ...; try { while(...) {...} } finally { enumerator.Dispose(); }" mess. In the other direction, it is able to "convert" C# anonymous methods to VB, but the resulting code isn't maintainable in any way.

                1 Reply Last reply
                0
                • L lintybits

                  OK, I admit it, all my .net development experience has been in vb. I'm moving in a couple weeks, and have been offered a new job at a small company working on their ecommerce sites, which are all written in C#. I've told the lead developer there that my work experience has always been vb (got a little C from way back), he doesn't seem concerned. I'm up for learning C#, and probably should anyway, but I'm a bit worried about getting up to speed. My question - other than the syntax differences, are there any major differences between vb & C# that I should focus on first? don't want to turn this into an argument, just want to get some advice on where to begin. Any book recomendations would help. thanks

                  D Offline
                  D Offline
                  DBuckner
                  wrote on last edited by
                  #11

                  This was the best 10 dollars I spent... http://www.amazon.com/C-VB-NET-Conversion-Pocket-Reference/dp/0596003196[^] HTH's, Dave

                  1 Reply Last reply
                  0
                  • L lintybits

                    OK, I admit it, all my .net development experience has been in vb. I'm moving in a couple weeks, and have been offered a new job at a small company working on their ecommerce sites, which are all written in C#. I've told the lead developer there that my work experience has always been vb (got a little C from way back), he doesn't seem concerned. I'm up for learning C#, and probably should anyway, but I'm a bit worried about getting up to speed. My question - other than the syntax differences, are there any major differences between vb & C# that I should focus on first? don't want to turn this into an argument, just want to get some advice on where to begin. Any book recomendations would help. thanks

                    A Offline
                    A Offline
                    Arthur Manena
                    wrote on last edited by
                    #12

                    I started programming 5 years ago in C++. After a year, i moved on to C#. I had no VB or VB.Net experience. Two weeks ago a girl I really like asked me to help her with her VB.Net application. I didn't want to disappoint so I said ok, knowing that I have no prior experience in VB. The day came, I got hold of a VB book, I paged through the book for about 30 minutes. 3 hours later, her application is running, no errors, 100% fullproof. Guess who wrote all the code, I did... Moral of the story: All this crap is the same, only the syntax is different. I now good in VB as well.

                    1 Reply Last reply
                    0
                    • L lintybits

                      OK, I admit it, all my .net development experience has been in vb. I'm moving in a couple weeks, and have been offered a new job at a small company working on their ecommerce sites, which are all written in C#. I've told the lead developer there that my work experience has always been vb (got a little C from way back), he doesn't seem concerned. I'm up for learning C#, and probably should anyway, but I'm a bit worried about getting up to speed. My question - other than the syntax differences, are there any major differences between vb & C# that I should focus on first? don't want to turn this into an argument, just want to get some advice on where to begin. Any book recomendations would help. thanks

                      E Offline
                      E Offline
                      ednrgc
                      wrote on last edited by
                      #13

                      I am always concerned about their favored language when hiring programmers. I have no doubt at all that this has a huge bearing on how a programmer performs. There is a distinct difference between programmers that come from a C++ background and a Visual Basic background. Dare I say that VB programmers are "hackier" programmers, where they are more apt to use long winded hacks than C#/C++ programmers. With that said, let the flames fly. It's my opinion, and I'm sticking to it.

                      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