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. Looking for a good C# to VB.NET converter

Looking for a good C# to VB.NET converter

Scheduled Pinned Locked Moved The Lounge
csharpquestion
69 Posts 18 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.
  • I Ivor S Sargoytchev

    Because customers want VB.NET samples more than they want C#.

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

    I've found that dumb managers often want VB.NET because they percieve that it's easier, and therefore easier to find other programmers who can use it. This will change, and in fact, we're having no trouble converting clients to C#, simply by showing them our work and telling them we refuse to work in VB.NET, unless they pay double. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

    I N V 3 Replies Last reply
    0
    • C Christian Graus

      OK, I get it. Look, I'm sorry, but VB.NET is not programming, it's a mental enema. Having said that, I stand by my prior comment - you will not find a converter that will do all the work for you, only one that will give you a broad base to work off. Given how similar the syntax is, if you can't work out how to make the sample compile, you should probably give up programming and become a goat herder. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      I Offline
      I Offline
      Ivor S Sargoytchev
      wrote on last edited by
      #9

      It is not a sample - it is 550 samples (and growing) in three separate products.

      C P 2 Replies Last reply
      0
      • C Christian Graus

        I've found that dumb managers often want VB.NET because they percieve that it's easier, and therefore easier to find other programmers who can use it. This will change, and in fact, we're having no trouble converting clients to C#, simply by showing them our work and telling them we refuse to work in VB.NET, unless they pay double. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        I Offline
        I Offline
        Ivor S Sargoytchev
        wrote on last edited by
        #10

        I will suggest this idea to management on the next "How to Significantly Drop our Revenue" meeting.

        C 1 Reply Last reply
        0
        • I Ivor S Sargoytchev

          It is not a sample - it is 550 samples (and growing) in three separate products.

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

          The number of samples is kind of irrelevant - I looked into VB.NET -> C# converters, for the reasons I have given, and I could not find anything that magically converted all the code. I actually spent some time emailing the vendor ( who was very helpful - it's called C-Sharpener, if they have a C# -> VB.NEt tool, I'd certainly recommend it ) about some ways that I thought they could have easily improved their process, but I can see how any converter would err on the side of caution and force you to hand fix anything that it's not going to be sure about. Even then, like I said, VB.NET is weakly typed and C# is strongly typed. I ended up with some divide by 0 errors due to an operation giving a float in VB.NET and 0 in C#, because the int needed to be cast to a float first. These sort of issues are inevitable. If you've written these samples in C# and you need to provide them in VB.NET, then you truly have my sympathy. Is there no way you can turn them into a library for VB monkeys to call ? Then they can have real code in their project, without having to be programmers :-) However, if you're providing a reusable library, you really needed to either cross develop in VB.NET ( painful, I know ), or do it in a dll, for precisely this reason. Still a lot of VB monkeys out there, and they are often working in big corporations that have money to spend ( plus they are more likely to be too dumb to write their own components, VB6 always got by on C++/COM components to do real work, VB.NET will probably continue the tradition ). Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

          A 1 Reply Last reply
          0
          • I Ivor S Sargoytchev

            I will suggest this idea to management on the next "How to Significantly Drop our Revenue" meeting.

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

            LOL - like I said, if you're selling components, then you should make them exposable to VB.NET, because that's where the idiots are. If you're writing stuff from scratch, or even adding to existing code, we've had close to 100% success, and frankly, any work that involves VB.NET, I can live without. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

            1 Reply Last reply
            0
            • C Christian Graus

              The number of samples is kind of irrelevant - I looked into VB.NET -> C# converters, for the reasons I have given, and I could not find anything that magically converted all the code. I actually spent some time emailing the vendor ( who was very helpful - it's called C-Sharpener, if they have a C# -> VB.NEt tool, I'd certainly recommend it ) about some ways that I thought they could have easily improved their process, but I can see how any converter would err on the side of caution and force you to hand fix anything that it's not going to be sure about. Even then, like I said, VB.NET is weakly typed and C# is strongly typed. I ended up with some divide by 0 errors due to an operation giving a float in VB.NET and 0 in C#, because the int needed to be cast to a float first. These sort of issues are inevitable. If you've written these samples in C# and you need to provide them in VB.NET, then you truly have my sympathy. Is there no way you can turn them into a library for VB monkeys to call ? Then they can have real code in their project, without having to be programmers :-) However, if you're providing a reusable library, you really needed to either cross develop in VB.NET ( painful, I know ), or do it in a dll, for precisely this reason. Still a lot of VB monkeys out there, and they are often working in big corporations that have money to spend ( plus they are more likely to be too dumb to write their own components, VB6 always got by on C++/COM components to do real work, VB.NET will probably continue the tradition ). Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

              A Offline
              A Offline
              Andy Brummer
              wrote on last edited by
              #13

              I think Igor is running into the crowd that just cuts and pastes example code into production products. Also, they probably want to avoid all the questions like you use += on an event. How do I do that in VB? :^)


              I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

              C G 2 Replies Last reply
              0
              • A Andy Brummer

                I think Igor is running into the crowd that just cuts and pastes example code into production products. Also, they probably want to avoid all the questions like you use += on an event. How do I do that in VB? :^)


                I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

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

                andy brummer wrote: I think Igor is running into the crowd that just cuts and pastes example code into production products. Yeah, I had that feeling, but now I'm sort of thinking that he's part of a team that's written a component in C# and want to convert it to VB. He said it's three products, 550 samples *and growing*. If it's growing, surely that means it's their code, and they've made the mistake of not cross developing in VB.NET, assuming they cannot ship it in dlls. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                A 1 Reply Last reply
                0
                • C Christian Graus

                  andy brummer wrote: I think Igor is running into the crowd that just cuts and pastes example code into production products. Yeah, I had that feeling, but now I'm sort of thinking that he's part of a team that's written a component in C# and want to convert it to VB. He said it's three products, 550 samples *and growing*. If it's growing, surely that means it's their code, and they've made the mistake of not cross developing in VB.NET, assuming they cannot ship it in dlls. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                  A Offline
                  A Offline
                  Andy Brummer
                  wrote on last edited by
                  #15

                  Well, I still think the VB community is going to slowly shrink/stay at current levels while C# is going to keep growing. Hopefully in a few years VB will be in the same place that COBOL is now.


                  I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                  C G 2 Replies Last reply
                  0
                  • A Andy Brummer

                    Well, I still think the VB community is going to slowly shrink/stay at current levels while C# is going to keep growing. Hopefully in a few years VB will be in the same place that COBOL is now.


                    I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

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

                    Yeah, I agree 100%. VB.NET is a dead duck, thank goodness. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      Get your C# project really drunk, hit it over the head with a mallet, and that should almost make it stupid enough to pass as VB.NET. As has been said, they both compile to IL, however the C# compiler creates faster code. Add to this that VB.NET is an utter joke, and you're really much better off keeping your C# untainted, and calling it from VB.NET via dlls if you really must lower yourself to using VB.NET. ( Guess who is stuck in VB.NET code again as we speak ? ) No converter will do the job 100%. We routinely convert VB.NET to C#, because we charge double to work on VB.NET projects ( and it's still not worth it ). The converters I have seen still import the VB dll and call VB functions from C#, so once I rip those out and fix that code, I expect a good half days work in getting a project to compile, and another day or so fixing bugs created by straight conversion when VB.NET seems to have some whacky ideas about what constitues good maths. I'm sure that C# -> VB.NET will be easier, as it's a step down. It will still be a partially manual process. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                      A Offline
                      A Offline
                      Anders Molin
                      wrote on last edited by
                      #17

                      Christian Graus wrote: they both compile to IL, however the C# compiler creates faster code Are you sure? I know C++ generates more optimized IL, but I have never heard that C# should make more efficient IL than VB.NET. - Anders Bill's Bar
                      My Photos

                      WDevs - The worlds first DSP, free blog space, email and more. Now also with forums :)

                      C G T 3 Replies Last reply
                      0
                      • A Anders Molin

                        Christian Graus wrote: they both compile to IL, however the C# compiler creates faster code Are you sure? I know C++ generates more optimized IL, but I have never heard that C# should make more efficient IL than VB.NET. - Anders Bill's Bar
                        My Photos

                        WDevs - The worlds first DSP, free blog space, email and more. Now also with forums :)

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

                        The guy who told me this was a VB.NET programmer ( the one who threatened to beat me up for saying that VB.NET sucks ), it was in his list of things he wishes would change about VB.NET. Given that he was on the VB.NET side, and pretty vocal, I doubt he'd suggest it if it were not true. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                        1 Reply Last reply
                        0
                        • I Ivor S Sargoytchev

                          It is not a sample - it is 550 samples (and growing) in three separate products.

                          P Offline
                          P Offline
                          peterchen
                          wrote on last edited by
                          #19

                          IMNSHO - a sample spit out by an automatic converter, without "manual tweaking" somehow defeats it's purpose. I've done a bit of walking through Fortran-translated-to-C code


                          I never really know a killer from a savior
                          boost your code || Fold With Us! || sighist | doxygen

                          1 Reply Last reply
                          0
                          • C Christian Graus

                            OK, I get it. Look, I'm sorry, but VB.NET is not programming, it's a mental enema. Having said that, I stand by my prior comment - you will not find a converter that will do all the work for you, only one that will give you a broad base to work off. Given how similar the syntax is, if you can't work out how to make the sample compile, you should probably give up programming and become a goat herder. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                            C Offline
                            C Offline
                            Chris Maunder
                            wrote on last edited by
                            #20

                            If you judge your programming language by it's syntax then you're easily pleased. I'd rather judge a language on what it can achieve, how it works with other languages, what libraries are available for use and what sort of support is in place for that language. But that's just me. cheers, Chris Maunder

                            C 1 Reply Last reply
                            0
                            • I Ivor S Sargoytchev

                              Can anybody recommend a good C# to VB.NET converter that can convert entire C# projects? I tried several and none of them produce code that can compile. I need to automate converting several thousand lines of code on a regular basis. Manual tweaking is not an option.

                              G Offline
                              G Offline
                              Giancarlo Aguilera
                              wrote on last edited by
                              #21

                              Regarding your question about c# to vb.net converters, well that's tough. I understand your situation, and although converting c# to vb.net is a walk in the park, performing that walk 550 times is quite a tedious task. If you're wondering why there are so many vb.net to c# converters yet not the reverse, the answer I believe is quite simple. Many legacy COM applications were built in VB for pure RAD reasons, which otherwise would have been built in MFC. When vb.net was released people were able to upgrade great big portions of their vb 6 apps with the upgrade wizard and then manually changing the 20% that was not successfully converted. Once the project was all vb.net, a vb.net to c# converter could be used to finally bring the application closer, at least in syntax, to a c++ style environment, although to say that c++ and c# are the same is plain ignorance, for there is no language that even reaches the knees of c++. Back to the point, many vendors saw this opportunity and thus the availability of so many converters. Second, pay no attention to all the vb trash talk that goes around here, especially that produced by Christian. Most, if not all, of his arguments are completely flawed, and are just the result of his ignorance about the language. Don't get me wrong, I love and encourage language wars, for I believe they are healthy; however, insulting people just for using a particular language is just not my style. Also, and just to reemphasize, except for syntax, c# and vb.net are more similar to each other than c# is similar to c++. I have absolutely no hands on experiece with c++ but I come from an academic background, and after having had to take so many classes in c++, there's no doubt it is the king of kings. Also, expect to see lots of horrendous c# code in the not too distant future. I don't know if you've worked with 2.0 yet, but there's no doubt that c# is loosing its identity in response to so many vb programmers switching over. The intellisense, edit and continue, etc..., all feature that go against the hard core c style of programming yet are finding a place in c#. Why is this? Christian, you there?????? You wanna battle?????

                              C 1 Reply Last reply
                              0
                              • A Anders Molin

                                Christian Graus wrote: they both compile to IL, however the C# compiler creates faster code Are you sure? I know C++ generates more optimized IL, but I have never heard that C# should make more efficient IL than VB.NET. - Anders Bill's Bar
                                My Photos

                                WDevs - The worlds first DSP, free blog space, email and more. Now also with forums :)

                                G Offline
                                G Offline
                                Giancarlo Aguilera
                                wrote on last edited by
                                #22

                                this is only the case because of the instrinsics of the vb language for example, dim i as integer if foo then i = 1 else i = 2 end if how many il assigments take place to i??????? find out dim s as string if s = string.empty then foo() End if will the il compare s only to the empty string constant "" or will it compare it also to a null reference???? find out

                                1 Reply Last reply
                                0
                                • A Andy Brummer

                                  I think Igor is running into the crowd that just cuts and pastes example code into production products. Also, they probably want to avoid all the questions like you use += on an event. How do I do that in VB? :^)


                                  I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                                  G Offline
                                  G Offline
                                  Giancarlo Aguilera
                                  wrote on last edited by
                                  #23

                                  addhandler

                                  C A 2 Replies Last reply
                                  0
                                  • C Chris Maunder

                                    If you judge your programming language by it's syntax then you're easily pleased. I'd rather judge a language on what it can achieve, how it works with other languages, what libraries are available for use and what sort of support is in place for that language. But that's just me. cheers, Chris Maunder

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

                                    Hi Chris. For some reason, you've jumped on my prior comment that VB.NET syntax sucks ( and you did so even at the time ). It does, but that's the least of it. I'm more concerned about things like empty strings being equal to Nothing, and functions magically generating their own return values. There is not one thing you've listed where VB.NET is in any way better than C#, and there are a myriad of ways in which it is worse. The main problem with VB.NET though is that too many idiots are using it. I've never claimed that no VB.NET user can program properly, but through working on other peoples projects, I can testify that most C# projects I see are reasonably well put together, and none come close to as bad as the mid rangeof the VB.NET projects I've worked on. The worst of them are just plain excreble. The trouble is that it's hard to convince a client that the code base they have, which sort of works, albeit with plenty of bugs, is useless in the long term, and they'd do better to have the whole thing done properly from a design standpoint before they worry about bug fixes and extensions. Last time we discussed VB.NET, a former VB6 user said that VB.NET started well, and was killed by VB6 users crying for backward compatibility with features that deserved to die. He also said that all real programmers had moved to C#. That's the opinion of a VB user who is also a programmer. The core issue really is that VB.NET users are surely close to all VB6 migrants, so the new features do not get used, the old syntax is used instead. I've worked on VB.NET ASP.NET projects where the code did not use viewstate, always posted back and put everything on the URL, etc. It was an old asp site with VB.NET replacing vbscript. VB.NET sucks because VB6 sucked. Yes, it generates IL, although I'm told not as efficiently as the C# compiler, but if all we wanted from a language was to generate raw code, why move away from C++ ? Or C ? Or assembler ? A language is as good as both the facilities it offers, and the rules it uses to both enforce good practice, and leave a good programmer with freedom to break the rules when needed. C++ did that better than C# does, IMO. VB.NET doesn't do it at all, it's loaded with gotchas and poor design decisions. Functions invent their own return values ? Who decided that was a good idea ? Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                                    C 1 Reply Last reply
                                    0
                                    • G Giancarlo Aguilera

                                      addhandler

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

                                      He wasn't asking, he was showing an example of the sort of question he doubts these people want to have to answer. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                                      G 1 Reply Last reply
                                      0
                                      • C Christian Graus

                                        He wasn't asking, he was showing an example of the sort of question he doubts these people want to have to answer. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                                        G Offline
                                        G Offline
                                        Giancarlo Aguilera
                                        wrote on last edited by
                                        #26

                                        oh well, i'll answer anyways

                                        C 1 Reply Last reply
                                        0
                                        • G Giancarlo Aguilera

                                          Regarding your question about c# to vb.net converters, well that's tough. I understand your situation, and although converting c# to vb.net is a walk in the park, performing that walk 550 times is quite a tedious task. If you're wondering why there are so many vb.net to c# converters yet not the reverse, the answer I believe is quite simple. Many legacy COM applications were built in VB for pure RAD reasons, which otherwise would have been built in MFC. When vb.net was released people were able to upgrade great big portions of their vb 6 apps with the upgrade wizard and then manually changing the 20% that was not successfully converted. Once the project was all vb.net, a vb.net to c# converter could be used to finally bring the application closer, at least in syntax, to a c++ style environment, although to say that c++ and c# are the same is plain ignorance, for there is no language that even reaches the knees of c++. Back to the point, many vendors saw this opportunity and thus the availability of so many converters. Second, pay no attention to all the vb trash talk that goes around here, especially that produced by Christian. Most, if not all, of his arguments are completely flawed, and are just the result of his ignorance about the language. Don't get me wrong, I love and encourage language wars, for I believe they are healthy; however, insulting people just for using a particular language is just not my style. Also, and just to reemphasize, except for syntax, c# and vb.net are more similar to each other than c# is similar to c++. I have absolutely no hands on experiece with c++ but I come from an academic background, and after having had to take so many classes in c++, there's no doubt it is the king of kings. Also, expect to see lots of horrendous c# code in the not too distant future. I don't know if you've worked with 2.0 yet, but there's no doubt that c# is loosing its identity in response to so many vb programmers switching over. The intellisense, edit and continue, etc..., all feature that go against the hard core c style of programming yet are finding a place in c#. Why is this? Christian, you there?????? You wanna battle?????

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

                                          Giancarlo Aguilera wrote: Most, if not all, of his arguments are completely flawed, and are just the result of his ignorance about the language. ROTFL. Actually, I thought you generated my standard list of comments about VB.NET. Wasn't it you who pointed out that an empty string == Nothing in VB.NET, etc. ? I found out that functions invent their own return value on my own..... Giancarlo Aguilera wrote: however, insulting people just for using a particular language is just not my style. As I recall, last time I said that VB sucks, you took it incredibly personally. I've never said that all VB.NET programmers are idiots ( although the majority of VB.NET code I've seen was plainly written by idiots ). Giancarlo Aguilera wrote: Also, and just to reemphasize, except for syntax, c# and vb.net are more similar to each other than c# is similar to c++. Yes, this is true. Giancarlo Aguilera wrote: I have absolutely no hands on experiece with c++ but I come from an academic background, and after having had to take so many classes in c++, there's no doubt it is the king of kings. You took C++ classes, but you've never coded in it ? How does THAT work ? Giancarlo Aguilera wrote: Also, expect to see lots of horrendous c# code in the not too distant future. This could well be the case, because C#, like VB6 and VB.NET, definately is easy enough for a newbie programmer to feel they know what they are doing, just because their code does not crash. But for now the truly terrible code seems to be more in the VB.NEt end of the field. Giancarlo Aguilera wrote: I don't know if you've worked with 2.0 yet, but there's no doubt that c# is loosing its identity in response to so many vb programmers switching over. The intellisense, edit and continue, etc..., all feature that go against the hard core c style of programming yet are finding a place in c#. Why is this? This is plain stupid. edit and continue existed in VC6, and intellisence has always been there. C# is growing to be more like C++ with the addition of things like templates. I don't really like anonymous methods, but iterators rock, and templates should have been there from the beginning. You're talking about IDE features. There is nothing wrong with the IDE providing means to make it easier to focus on the code. otherwise, we'd all be using notepad.

                                          G 2 Replies 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