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# "Coevolution"

VB/C# "Coevolution"

Scheduled Pinned Locked Moved The Lounge
csharpc++visual-studiocomcollaboration
54 Posts 32 Posters 1 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.
  • E Ennis Ray Lynch Jr

    You should really use VB syntax for that so the VB people can understand.

    Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

    C Offline
    C Offline
    Christopher Duncan
    wrote on last edited by
    #6

    I figured if the languages were equivalent I could mix my metaphors. :)

    Christopher Duncan
    www.PracticalUSA.com
    Author of The Career Programmer and Unite the Tribes
    Copywriting Services

    1 Reply Last reply
    0
    • C Christian Graus

      C# = VB - (VB.UglySyntax | VB.CounterIntuitiveUseOfTheSameBracesEveryWhere | VB.OverlyVerboseAndHardToReadCode );

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #7

      Surely you mean C# == VB - (VB.UglySyntax | VB.CounterIntuitiveUseOfTheSameBracesEveryWhere | VB.OverlyVerboseAndHardToReadCode );

      '--8<------------------------ Ex Datis: Duncan Jones Free eBook: Printing - a .NET Developer's Guide (Part 1)

      F 1 Reply Last reply
      0
      • N Nemanja Trifunovic

        A nice summary of VS team's C# and VB strategy can be found here[^]. They recognize that the only difference between the two languages is a little bit of syntax, and that will be kept separate. Everything else (tools, runtime, etc) will be shared. Or, in one line of code: C# = VB + "{};"

        utf8-cpp

        W Offline
        W Offline
        William Winner
        wrote on last edited by
        #8

        Maybe I haven't set up VS to make C# programming quicker, but I find the IDE in VB so much easier to use. For instance, the fact that you don't have to know which methods are available for a control, you just pick the one you want from the drop down's at the top of the code window. Or the fact that the VB IDE seems to correct a lot, which can make it a lot quicker...like if I type "if i = 0" and hit enter, it fills in the "Then" and "End If". And some of the statements seem more streamlined or with more functionality...for instance

        Select Case intI
        case <5
        do something
        case 6-10
        do something else
        case >10
        do another thing
        End Select

        or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5. Personally, I find the VB IDE soooo much easier and quicker to use.

        P A A R A 6 Replies Last reply
        0
        • C Christian Graus

          C# = VB - (VB.UglySyntax | VB.CounterIntuitiveUseOfTheSameBracesEveryWhere | VB.OverlyVerboseAndHardToReadCode );

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          D Offline
          D Offline
          DABBee
          wrote on last edited by
          #9

          VB code is easy to read - what drugs are you on. Can I have some ?

          Candy: Here's the plan: we changes our names, move to a distant island, and disguise ourselves as a family of traveling donkey polishers.

          P R 2 Replies Last reply
          0
          • N Nemanja Trifunovic

            A nice summary of VS team's C# and VB strategy can be found here[^]. They recognize that the only difference between the two languages is a little bit of syntax, and that will be kept separate. Everything else (tools, runtime, etc) will be shared. Or, in one line of code: C# = VB + "{};"

            utf8-cpp

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #10

            I just don't like language features that are included or left out specifically to make life easy for Visual Studio. X|

            1 Reply Last reply
            0
            • W William Winner

              Maybe I haven't set up VS to make C# programming quicker, but I find the IDE in VB so much easier to use. For instance, the fact that you don't have to know which methods are available for a control, you just pick the one you want from the drop down's at the top of the code window. Or the fact that the VB IDE seems to correct a lot, which can make it a lot quicker...like if I type "if i = 0" and hit enter, it fills in the "Then" and "End If". And some of the statements seem more streamlined or with more functionality...for instance

              Select Case intI
              case <5
              do something
              case 6-10
              do something else
              case >10
              do another thing
              End Select

              or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5. Personally, I find the VB IDE soooo much easier and quicker to use.

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #11

              But what about writing it in a text editor? Don't judge a language by a single IDE.

              W I M 3 Replies Last reply
              0
              • P PIEBALDconsult

                But what about writing it in a text editor? Don't judge a language by a single IDE.

                W Offline
                W Offline
                William Winner
                wrote on last edited by
                #12

                Well, this was started talking about something that one of the VS team lead's had written. But, if I were writing in a text editor, I would still choose VB I think...though I don't know why I would be writing in a text editor... In the case of a text editor, the case insensitivity of VB is a benefit...I don't have to worry about getting all of the cases right. "intI" is the same as "inti" in VB. Granted, "inti" is harder to read, but that's why I don't program in a text editor...even one like gVim. The fact that VB .Net now basically has the same capabilities of C# to me would let me decide based on what I was programming in and how simple the IDE made it. The VS VB IDE seems to me to be better than the VS C# IDE.

                1 Reply Last reply
                0
                • P PIEBALDconsult

                  But what about writing it in a text editor? Don't judge a language by a single IDE.

                  I Offline
                  I Offline
                  Ian Shlasko
                  wrote on last edited by
                  #13

                  VB.NET was never designed to be used outside of Visual Studio... Microsoft doesn't expect VB programmers to do anything the hard way :)

                  Proud to have finally moved to the A-Ark. Which one are you in?
                  Author of Guardians of Xen (Sci-Fi/Fantasy novel)

                  1 Reply Last reply
                  0
                  • D DABBee

                    VB code is easy to read - what drugs are you on. Can I have some ?

                    Candy: Here's the plan: we changes our names, move to a distant island, and disguise ourselves as a family of traveling donkey polishers.

                    P Offline
                    P Offline
                    puromtec1
                    wrote on last edited by
                    #14

                    You are assuming that the ability to find each word of a programming language in an english dictionary defines how easy the language is to read. Within the context of programmers reading code (not an average Joe), C# is more succinct, and is therefore easier to read and write.

                    I D D 3 Replies Last reply
                    0
                    • P puromtec1

                      You are assuming that the ability to find each word of a programming language in an english dictionary defines how easy the language is to read. Within the context of programmers reading code (not an average Joe), C# is more succinct, and is therefore easier to read and write.

                      I Offline
                      I Offline
                      Ian Shlasko
                      wrote on last edited by
                      #15

                      puromtec1 wrote:

                      C# is more succinct, and is therefore easier to read and write.

                      Not in all cases... And more succinct isn't necessarily easier to read and write... See two examples in William's post here[^]. I could probably think of a few more situations in which VB is easier to read, but it's just about time to go home, and I'm close to passing out (#%*@ing insomnia)... Personally, I started out in Basic and was pretty decent at VB before I even tried C#, but now I work almost exclusively with the latter. I do prefer the C# syntax in most cases, but that doesn't mean it's universally better.

                      Proud to have finally moved to the A-Ark. Which one are you in?
                      Author of Guardians of Xen (Sci-Fi/Fantasy novel)

                      P S 2 Replies Last reply
                      0
                      • W William Winner

                        Maybe I haven't set up VS to make C# programming quicker, but I find the IDE in VB so much easier to use. For instance, the fact that you don't have to know which methods are available for a control, you just pick the one you want from the drop down's at the top of the code window. Or the fact that the VB IDE seems to correct a lot, which can make it a lot quicker...like if I type "if i = 0" and hit enter, it fills in the "Then" and "End If". And some of the statements seem more streamlined or with more functionality...for instance

                        Select Case intI
                        case <5
                        do something
                        case 6-10
                        do something else
                        case >10
                        do another thing
                        End Select

                        or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5. Personally, I find the VB IDE soooo much easier and quicker to use.

                        A Offline
                        A Offline
                        Anthony Mushrow
                        wrote on last edited by
                        #16

                        William Winner wrote:

                        or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5.

                        But what if you wanted to do something crazy like for(float f=0; f < someNumber; f*=f)

                        My current favourite word is: Smooth!

                        -SK Genius

                        W 1 Reply Last reply
                        0
                        • C Christian Graus

                          C# = VB - (VB.UglySyntax | VB.CounterIntuitiveUseOfTheSameBracesEveryWhere | VB.OverlyVerboseAndHardToReadCode );

                          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                          G Offline
                          G Offline
                          Gary R Wheeler
                          wrote on last edited by
                          #17

                          C# = VB - COBOL.SyntacticVerbosity + C.Braces

                          Software Zen: delete this;
                          Fold With Us![^]

                          1 Reply Last reply
                          0
                          • I Ian Shlasko

                            puromtec1 wrote:

                            C# is more succinct, and is therefore easier to read and write.

                            Not in all cases... And more succinct isn't necessarily easier to read and write... See two examples in William's post here[^]. I could probably think of a few more situations in which VB is easier to read, but it's just about time to go home, and I'm close to passing out (#%*@ing insomnia)... Personally, I started out in Basic and was pretty decent at VB before I even tried C#, but now I work almost exclusively with the latter. I do prefer the C# syntax in most cases, but that doesn't mean it's universally better.

                            Proud to have finally moved to the A-Ark. Which one are you in?
                            Author of Guardians of Xen (Sci-Fi/Fantasy novel)

                            P Offline
                            P Offline
                            puromtec1
                            wrote on last edited by
                            #18

                            Ian Shlasko wrote:

                            I'm close to passing out

                            I hear you on that one... It is true that his for example demonstrates a for statement is less characters in VB. However, it highlights another readability issue which is that the VB statement requires pause to remember "when does 'i' stop, at 5 or before 5?' Also, you have to realize that characters like these '{}()[]' are visual aids that help our eyes separate and identify information. This is in fact a plus for readability while it does increase the number of characters on the page in some instances.

                            Ian Shlasko wrote:

                            I started out in Basic

                            Basic on the TI calculator is where I started and did vb before C#, too.

                            Ian Shlasko wrote:

                            but that doesn't mean it's universally better.

                            I don't think it is worthwhile to postulate if anything is universally better to everything else regardless of topic. However, it is an important question to answer because it may affect the bottom line of our customers.

                            A 1 Reply Last reply
                            0
                            • P puromtec1

                              Ian Shlasko wrote:

                              I'm close to passing out

                              I hear you on that one... It is true that his for example demonstrates a for statement is less characters in VB. However, it highlights another readability issue which is that the VB statement requires pause to remember "when does 'i' stop, at 5 or before 5?' Also, you have to realize that characters like these '{}()[]' are visual aids that help our eyes separate and identify information. This is in fact a plus for readability while it does increase the number of characters on the page in some instances.

                              Ian Shlasko wrote:

                              I started out in Basic

                              Basic on the TI calculator is where I started and did vb before C#, too.

                              Ian Shlasko wrote:

                              but that doesn't mean it's universally better.

                              I don't think it is worthwhile to postulate if anything is universally better to everything else regardless of topic. However, it is an important question to answer because it may affect the bottom line of our customers.

                              A Offline
                              A Offline
                              AspDotNetDev
                              wrote on last edited by
                              #19

                              puromtec1 wrote:

                              Basic on the TI calculator is where I started

                              Oh yeah, I did a little line bouncing screensaver on my TI-83+ 6 to 10 years ago... I should add that to my resume. ;P

                              [Forum Guidelines]

                              1 Reply Last reply
                              0
                              • A Anthony Mushrow

                                William Winner wrote:

                                or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5.

                                But what if you wanted to do something crazy like for(float f=0; f < someNumber; f*=f)

                                My current favourite word is: Smooth!

                                -SK Genius

                                W Offline
                                W Offline
                                William Winner
                                wrote on last edited by
                                #20

                                SK Genius wrote:

                                for(float f=0; f < someNumber; f*=f)

                                Well, first of all, that is an infinite loop as 0 * 0 is always going to be 0, but I get your point, and I agree that in many cases, including that one, c# is quicker...though you can still always just do a while or do while loop. You're never limited to just the for loop.

                                A 1 Reply Last reply
                                0
                                • W William Winner

                                  Maybe I haven't set up VS to make C# programming quicker, but I find the IDE in VB so much easier to use. For instance, the fact that you don't have to know which methods are available for a control, you just pick the one you want from the drop down's at the top of the code window. Or the fact that the VB IDE seems to correct a lot, which can make it a lot quicker...like if I type "if i = 0" and hit enter, it fills in the "Then" and "End If". And some of the statements seem more streamlined or with more functionality...for instance

                                  Select Case intI
                                  case <5
                                  do something
                                  case 6-10
                                  do something else
                                  case >10
                                  do another thing
                                  End Select

                                  or instead of for (int i = 1; i <= 5; i++) how about for i = 1 to 5. Personally, I find the VB IDE soooo much easier and quicker to use.

                                  A Offline
                                  A Offline
                                  AspDotNetDev
                                  wrote on last edited by
                                  #21

                                  Rather than "End Select", "End Sub", "End While", and so on, C# has "}". More concise. You are ending a code block, so you really only need one thing to do that, and why not make it one character, so you don't need anything to be filled in when you press ENTER. In C# Windows Forms development, you just right click a control (in the designer) and select "Properties". You then click the little lightning icon if you want to see all the events on the control you can subscribe to. Same as the "which methods are available for a control" you mention in VB. Or you can use intellisense by typing the control name and typing "."... a list will pop up with all the methods, properties, and events on that control. There are even little icons to identify what type of thing (event, method, property, etc) each thing is. No real difference here between VB/C# in the IDE. C# has the "switch" statement, which is much like the "select case" statement in VB. One thing I do like in VB is the ability to do ranges and such (e.g., "case < 5"), which you cannot do in C#. The only way to do that in C# is to do a chained "IF" statement, but that's not too ugly given how concise the syntax is in C#. For example:

                                  if (intI < 5)
                                  {
                                  // Do something.
                                  }
                                  else if (intI >=6 && intI <=10)
                                  {
                                  // Do something else.
                                  }
                                  else if (intI > 10)
                                  {
                                  // Do another thing.
                                  }

                                  I'm sure the builders of C# could add an extra construct to parse a "for(i = 1 to 5)" or something of that sort, but I don't see any reason to clutter up the language with specific cases. The included "for" statement is more flexible than the VB version. There is also "foreach" which I think is in both languages. I like that C# doesn't add unnecessary syntactic sugar unnecessarily to burden me with learning extra stuff. Some people like that kind of thing though, so I suppose VB works fine for them. I'd say the main difference between VB and C# is that C# seems more geared to those who want to understand the underlying concept (e.g., a code block is the same no matter which context it is in) while VB is more geared toward concrete thinkers who want to see things in more explicit terms (e.g., there is a "SELECT" code block and a "WHILE" code block and a "FOR" code block and so on).

                                  [Forum Guidelines]

                                  W E 2 Replies Last reply
                                  0
                                  • A AspDotNetDev

                                    Rather than "End Select", "End Sub", "End While", and so on, C# has "}". More concise. You are ending a code block, so you really only need one thing to do that, and why not make it one character, so you don't need anything to be filled in when you press ENTER. In C# Windows Forms development, you just right click a control (in the designer) and select "Properties". You then click the little lightning icon if you want to see all the events on the control you can subscribe to. Same as the "which methods are available for a control" you mention in VB. Or you can use intellisense by typing the control name and typing "."... a list will pop up with all the methods, properties, and events on that control. There are even little icons to identify what type of thing (event, method, property, etc) each thing is. No real difference here between VB/C# in the IDE. C# has the "switch" statement, which is much like the "select case" statement in VB. One thing I do like in VB is the ability to do ranges and such (e.g., "case < 5"), which you cannot do in C#. The only way to do that in C# is to do a chained "IF" statement, but that's not too ugly given how concise the syntax is in C#. For example:

                                    if (intI < 5)
                                    {
                                    // Do something.
                                    }
                                    else if (intI >=6 && intI <=10)
                                    {
                                    // Do something else.
                                    }
                                    else if (intI > 10)
                                    {
                                    // Do another thing.
                                    }

                                    I'm sure the builders of C# could add an extra construct to parse a "for(i = 1 to 5)" or something of that sort, but I don't see any reason to clutter up the language with specific cases. The included "for" statement is more flexible than the VB version. There is also "foreach" which I think is in both languages. I like that C# doesn't add unnecessary syntactic sugar unnecessarily to burden me with learning extra stuff. Some people like that kind of thing though, so I suppose VB works fine for them. I'd say the main difference between VB and C# is that C# seems more geared to those who want to understand the underlying concept (e.g., a code block is the same no matter which context it is in) while VB is more geared toward concrete thinkers who want to see things in more explicit terms (e.g., there is a "SELECT" code block and a "WHILE" code block and a "FOR" code block and so on).

                                    [Forum Guidelines]

                                    W Offline
                                    W Offline
                                    William Winner
                                    wrote on last edited by
                                    #22

                                    I don't use C# a whole lot, and I hadn't found that little lightning bolt yet. Yeah, that would have helped a lot. I do like that the brackets identify a code block, but the VS IDE automatically handles the tabbing for both languages (though, every once in a while, they don't), and without that, both languages can be hard to determine which '}' goes with which '{'.

                                    K 1 Reply Last reply
                                    0
                                    • W William Winner

                                      SK Genius wrote:

                                      for(float f=0; f < someNumber; f*=f)

                                      Well, first of all, that is an infinite loop as 0 * 0 is always going to be 0, but I get your point, and I agree that in many cases, including that one, c# is quicker...though you can still always just do a while or do while loop. You're never limited to just the for loop.

                                      A Offline
                                      A Offline
                                      Anthony Mushrow
                                      wrote on last edited by
                                      #23

                                      True. To be honest if I need to do anything other than increment or decrement then I'll use a while loop.

                                      My current favourite word is: Smooth!

                                      -SK Genius

                                      1 Reply Last reply
                                      0
                                      • I Ian Shlasko

                                        puromtec1 wrote:

                                        C# is more succinct, and is therefore easier to read and write.

                                        Not in all cases... And more succinct isn't necessarily easier to read and write... See two examples in William's post here[^]. I could probably think of a few more situations in which VB is easier to read, but it's just about time to go home, and I'm close to passing out (#%*@ing insomnia)... Personally, I started out in Basic and was pretty decent at VB before I even tried C#, but now I work almost exclusively with the latter. I do prefer the C# syntax in most cases, but that doesn't mean it's universally better.

                                        Proud to have finally moved to the A-Ark. Which one are you in?
                                        Author of Guardians of Xen (Sci-Fi/Fantasy novel)

                                        S Offline
                                        S Offline
                                        Shog9 0
                                        wrote on last edited by
                                        #24

                                        Ian Shlasko wrote:

                                        Personally, I started out in Basic

                                        Me too. That's reason #1 why I hate VB...

                                        1 Reply Last reply
                                        0
                                        • P puromtec1

                                          You are assuming that the ability to find each word of a programming language in an english dictionary defines how easy the language is to read. Within the context of programmers reading code (not an average Joe), C# is more succinct, and is therefore easier to read and write.

                                          D Offline
                                          D Offline
                                          Duncan Edwards Jones
                                          wrote on last edited by
                                          #25

                                          Nonsense - txt spk is > sccnt ! ez As a general rule the total mental processing in any communication is constant therefore the more effort made by the writer the less is required by the reader and vice versa. The design goal of "easy to write" should only be prioritised if more people are going to write the code than are going to read it.

                                          '--8<------------------------ Ex Datis: Duncan Jones Free eBook: Printing - a .NET Developer's Guide (Part 1)

                                          S 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