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. If I see any more VB...

If I see any more VB...

Scheduled Pinned Locked Moved The Lounge
csharpc++htmlcomregex
36 Posts 13 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.
  • S Sijin

    there's a Type called type That is there in C# too :) For field = 0 To ds.Table.Columns.Count - 1 You find this less readable than for(field=0;field<=ds.Table.Columns.Count-1;field++) With report .Title = "Report from Person Objects" .SubTitleLeft = Now Imagine you had to set 20 fields of an object, now isn't the "with" syntax going to be really neat then. I don't the syntatic things make VB a bad language, it's just he lack of structure and a stress on GUI programming which wrecks any proper OO design concepts that makes it a bad choice as a fully blown language, IMHO VB should only be used for front-ends and prototyping.


    I always think that the idea of a compiler that compiles another compiler or itself is rather incestuous in a binary way. - Colin Davies My .Net Blog

    D Offline
    D Offline
    Daniel Turini
    wrote on last edited by
    #22

    Sijin wrote: With report .Title = "Report from Person Objects" .SubTitleLeft = Now Imagine you had to set 20 fields of an object, now isn't the "with" syntax going to be really neat then. Have you ever heard about a thingie called "method", aka "member function"? Wherever you use a With, it's a strong indicator of a bad design, since if you do lots of field assignments, it should be a method of the object. ORACLE One Real A$#h%le Called Lary Ellison

    1 Reply Last reply
    0
    • C Chris Meech

      Technically, you are not introducing a bug with copy/paste. You are replicating it. ;P Chris Meech "what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002. "And when you need to hire a programmer to do mostly VB programming, it's not good enough to hire a VB programmer, because they will get completely stuck in tar every time the VB abstraction leaks." Joel on Software Nov 11, 2002.

      R Offline
      R Offline
      Ray Cassick
      wrote on last edited by
      #23

      Exactly, and those are the worse kind :)


      Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.


      1 Reply Last reply
      0
      • Z Zachery

        Finally! I just finished translating over 1500 lines of VB code to C#. (It's for uber printing of any type of control, text, or form.) I had only worked a little with VB, just enough to know that I didn't like it, but after extensive translation of it over a day and a half, I not only know that I don't like it, I see that it fails as being a good lang in so many ways. Lack of structure and some of the functions and methods have cryptic names (there's a Type called type:mad:. That took me awhile to find an eqivalent). It's lack of semicolons (it seems like you can place one after some lines of code but not after others, and there's not pattern) and brackets the can be open with no closing or closing with no open. What pissed me off the most was their For and With statments! VB:

        For field = 0 To ds.Table.Columns.Count - 1

        Where's the friggin thrid ;?? And no (). It just reminds me of using the alphabet with 20 missing letters. And the With statments, just use the variable name each time:mad:! VB:

        With report
        .Title = "Report from Person Objects"
        .SubTitleLeft = Now

        I'm just glad I'm done with it (at least I hope so). Now it's off to Ohio for a 4 day WoodStock like concert called The Gathering. I think my boss wanted to make sure I earned my time off. I hope CP will be ok without me and my Domo-Kun of DOOM!.:-D

        ..........Zack.......... Developer Extraordinaire && Full Time Geek

        "Never underestimate the power of stupid people in large groups." - George Carlin "I will stand on my side of the fence, reguardless of the circumstances or the consequence." - Monoxide "Hugbees!" GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

        D Offline
        D Offline
        Daniel Turini
        wrote on last edited by
        #24

        Zachery Domo-Kun of DOOM! wrote: Finally! I just finished translating over 1500 lines of VB code to C#. (It's for uber printing of any type of control, text, or form.) Well, it may be now late to tell you about my latest article, GBVB - Converting VB.NET Code to C#[^]. It's not a perfect solution, but it saved me lots of copy/pasting/typing. ORACLE One Real A$#h%le Called Lary Ellison

        1 Reply Last reply
        0
        • J Jamie Nordmeyer

          I think it's hysterical how so many people are so biased toward one technology over another. It's quite literally a religion as to what language you "choose" to use. Like any comparable technology, C# and VB.NET both have their strengths and weaknesses. It's just a matter of learning the syntax of the language. You said yourself that you only knew a little VB. That was your problem. You didn't understand it. While I agree that VB6 and its predecessors were lacking, VB.NET IS a good language if you know how to use it. Want your 3rd semicolon as you asked about? For Field As Integer = 0 To ds.Table.Columns.Count - 1 **Step 2** The Step keyword is your 3rd semicolon. And the With statement? Other languages could use something like this. It's useful when you have to set like 30 properties. I noticed in another post that you said this means you don't have to think. So what? How much thought does it really take in the first place, even WITHOUT the With keyword? It's just extra typing. Things that ARE missing from VB.NET that I'd really love to see; overloadable operators, templates (they say that C# will support them for sure, but not necessarily VB), and removal of the AddHandler/RemoveHandler keywords. I'd rather just say Button1.Click += new EventHandler... as C# does. Point being, learn about something before you openly criticize it. I have no idea what The Gathering is, except that it's a concert, so I can't fairly critique it, can I? Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

          D Offline
          D Offline
          Daniel Turini
          wrote on last edited by
          #25

          Jamie Nordmeyer wrote: And the With statement? Other languages could use something like this. It's useful when you have to set like 30 properties. Have you ever heard about a thingie called "method", aka "member function"? Wherever you use a With, it's a strong indicator of a bad design, since if you do lots of field assignments, it should be a method of the object. ORACLE One Real A$#h%le Called Lary Ellison

          J 1 Reply Last reply
          0
          • D Daniel Turini

            Jamie Nordmeyer wrote: And the With statement? Other languages could use something like this. It's useful when you have to set like 30 properties. Have you ever heard about a thingie called "method", aka "member function"? Wherever you use a With, it's a strong indicator of a bad design, since if you do lots of field assignments, it should be a method of the object. ORACLE One Real A$#h%le Called Lary Ellison

            J Offline
            J Offline
            Jamie Nordmeyer
            wrote on last edited by
            #26

            Um, last time I checked, properties ARE methods, just with a different syntax. They get compiled to get_Property and set_Property METHOD calls. And since when is using With a strong indicator of bad design? If you're going to call time saving syntax bad design, than the same can be said of saying "X=someArray(y);", instead of "X=someArray.item(y);", or using ++ to increment a variable. The With keyword is a time saving tool, nothing more, nothing less. Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

            D 1 Reply Last reply
            0
            • J Jamie Nordmeyer

              Um, last time I checked, properties ARE methods, just with a different syntax. They get compiled to get_Property and set_Property METHOD calls. And since when is using With a strong indicator of bad design? If you're going to call time saving syntax bad design, than the same can be said of saying "X=someArray(y);", instead of "X=someArray.item(y);", or using ++ to increment a variable. The With keyword is a time saving tool, nothing more, nothing less. Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

              D Offline
              D Offline
              Daniel Turini
              wrote on last edited by
              #27

              Jamie Nordmeyer wrote: Um, last time I checked, properties ARE methods, just with a different syntax. They get compiled to get_Property and set_Property METHOD calls. And since when is using With a strong indicator of bad design? If you're going to call time saving syntax bad design, than the same can be said of saying "X=someArray(y);", instead of "X=someArray.item(y);", or using ++ to increment a variable. The With keyword is a time saving tool, nothing more, nothing less. I think you misunderstood me. See this code:

              obj.x = newx;
              obj.y = newy;
              obj.z = newz;

              A "with" statement would help here? Maybe, but often a "with" statement hides a poor object interface, wouldn't it be better if it was coded this way:

              obj.Move(newx, newy, newz);

              I again reinforce that most uses of a with statement are simply consequence of ill-designed interfaces. ORACLE One Real A$#h%le Called Lary Ellison

              J 1 Reply Last reply
              0
              • D Daniel Turini

                Jamie Nordmeyer wrote: Um, last time I checked, properties ARE methods, just with a different syntax. They get compiled to get_Property and set_Property METHOD calls. And since when is using With a strong indicator of bad design? If you're going to call time saving syntax bad design, than the same can be said of saying "X=someArray(y);", instead of "X=someArray.item(y);", or using ++ to increment a variable. The With keyword is a time saving tool, nothing more, nothing less. I think you misunderstood me. See this code:

                obj.x = newx;
                obj.y = newy;
                obj.z = newz;

                A "with" statement would help here? Maybe, but often a "with" statement hides a poor object interface, wouldn't it be better if it was coded this way:

                obj.Move(newx, newy, newz);

                I again reinforce that most uses of a with statement are simply consequence of ill-designed interfaces. ORACLE One Real A$#h%le Called Lary Ellison

                J Offline
                J Offline
                Jamie Nordmeyer
                wrote on last edited by
                #28

                OK, my bad. :) I partially agree with you here. When you've only got 3 or 4 things to set, then yes, a method is probably better than with. But if you've got more than, say, 8 items to set, the method becomes too long. You might get away with it if you had several methods that set the diferrent parameters, but if you had 30 items to set, the methods might still be really long. That's where the With keyword becomes useful. Frankly, this is the only real time I personally use With, but I'd rather use it than try to call a method with 30 parameters. X| Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

                D 1 Reply Last reply
                0
                • J Jamie Nordmeyer

                  OK, my bad. :) I partially agree with you here. When you've only got 3 or 4 things to set, then yes, a method is probably better than with. But if you've got more than, say, 8 items to set, the method becomes too long. You might get away with it if you had several methods that set the diferrent parameters, but if you had 30 items to set, the methods might still be really long. That's where the With keyword becomes useful. Frankly, this is the only real time I personally use With, but I'd rather use it than try to call a method with 30 parameters. X| Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

                  D Offline
                  D Offline
                  Daniel Turini
                  wrote on last edited by
                  #29

                  Jamie Nordmeyer wrote: OK, my bad. I partially agree with you here. When you've only got 3 or 4 things to set, then yes, a method is probably better than with. But if you've got more than, say, 8 items to set, the method becomes too long. You might get away with it if you had several methods that set the diferrent parameters, but if you had 30 items to set, the methods might still be really long. That's where the With keyword becomes useful. Frankly, this is the only real time I personally use With, but I'd rather use it than try to call a method with 30 parameters. And if you have 30 parameters, probably your design is missing a whole class, too. :) ORACLE One Real A$#h%le Called Lary Ellison

                  D 1 Reply Last reply
                  0
                  • D Daniel Turini

                    Jamie Nordmeyer wrote: OK, my bad. I partially agree with you here. When you've only got 3 or 4 things to set, then yes, a method is probably better than with. But if you've got more than, say, 8 items to set, the method becomes too long. You might get away with it if you had several methods that set the diferrent parameters, but if you had 30 items to set, the methods might still be really long. That's where the With keyword becomes useful. Frankly, this is the only real time I personally use With, but I'd rather use it than try to call a method with 30 parameters. And if you have 30 parameters, probably your design is missing a whole class, too. :) ORACLE One Real A$#h%le Called Lary Ellison

                    D Offline
                    D Offline
                    David Stone
                    wrote on last edited by
                    #30

                    Daniel Turini wrote: And if you have 30 parameters, probably your design is missing a whole class, too Great minds think alike... :-D


                    Flight to Redmond - £200 Bulldozer Rental - £100 Destroying the MS campus single handedly for not doing an Academic upgrade, PRICELESS! -Jonny Newman

                    1 Reply Last reply
                    0
                    • Z Zachery

                      Sijin wrote: With report .Title = "Report from Person Objects" .SubTitleLeft = Now You find this less readable than for(field=0;field<=ds.Table.Columns.Count-1;field++) Yes, I like knowing exaclty what my code is doing, I don't want to have to assume anything about my code. Assuming makes for bad code.

                      ..........Zack.......... Developer Extraordinaire && Full Time Geek

                      "Never underestimate the power of stupid people in large groups." - George Carlin "I will stand on my side of the fence, reguardless of the circumstances or the consequence." - Monoxide "Hugbees!" GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

                      D Offline
                      D Offline
                      Daniel Larsen
                      wrote on last edited by
                      #31

                      Zachery Domo-Kun of DOOM! wrote: Yes, I like knowing exaclty what my code is doing, I don't want to have to assume anything about my code. Assuming makes for bad code. I would image that not knowing "exactly" what VB is doing is simply an issue of not spending enough time around it. Some would call that type of thing (spending time around VB) torture, but that's another issue. At the lower levels, VB and OO langagues will execute a For loop the same way. The bottom line is that I don't think VB is necessarily a bad language simply because of it's syntax. D Daniel Larsen, Professional Casanova Blood, Sweat, Toil and Tears

                      1 Reply Last reply
                      0
                      • Z Zachery

                        Finally! I just finished translating over 1500 lines of VB code to C#. (It's for uber printing of any type of control, text, or form.) I had only worked a little with VB, just enough to know that I didn't like it, but after extensive translation of it over a day and a half, I not only know that I don't like it, I see that it fails as being a good lang in so many ways. Lack of structure and some of the functions and methods have cryptic names (there's a Type called type:mad:. That took me awhile to find an eqivalent). It's lack of semicolons (it seems like you can place one after some lines of code but not after others, and there's not pattern) and brackets the can be open with no closing or closing with no open. What pissed me off the most was their For and With statments! VB:

                        For field = 0 To ds.Table.Columns.Count - 1

                        Where's the friggin thrid ;?? And no (). It just reminds me of using the alphabet with 20 missing letters. And the With statments, just use the variable name each time:mad:! VB:

                        With report
                        .Title = "Report from Person Objects"
                        .SubTitleLeft = Now

                        I'm just glad I'm done with it (at least I hope so). Now it's off to Ohio for a 4 day WoodStock like concert called The Gathering. I think my boss wanted to make sure I earned my time off. I hope CP will be ok without me and my Domo-Kun of DOOM!.:-D

                        ..........Zack.......... Developer Extraordinaire && Full Time Geek

                        "Never underestimate the power of stupid people in large groups." - George Carlin "I will stand on my side of the fence, reguardless of the circumstances or the consequence." - Monoxide "Hugbees!" GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

                        J Offline
                        J Offline
                        Jason McBurney
                        wrote on last edited by
                        #32

                        I think your really complaining about crappy vb coders. Which I will consent to you. Most vb coders are IMO poor coders. C is language of the academic community, therefore a higher percentage of C coders are educated in why good syntax and good variable names are useful. Thus better code bases exist in C. However this whole C# vs. Vb.net is really amusing. Paul posted a really good comparsion some time ago -- I wish I could find it. Primarly the argument boils down to something like this. C#ers can read VB VBers can read C# Moreover, a C#er can breed with a VBer meaning that they are symantically compatable.

                        1 Reply Last reply
                        0
                        • M Mike Dimmick

                          JoeJoeMa wrote: it also performs faster. No, it doesn't, and never has. It also never will. Both a With block and individual assignments compile to a direct field set stfld instruction, or a method call call or callvirt instruction, as appropriate, if it's a property. The IL compiler generates a MOV [_reg_], _value_ for field accesses, as long as the object can't be remotable (see Chris Brumme's blog entry yesterday[^]). It's slightly quicker to type, but not really a lot. With was valuable when you didn't have constructors in VB, but now you do, it's less common to set more than one field or property of an object or structure at the same time. If you really care, in C# you can of course declare an alias for your object, simply by declaring another variable.

                          T Offline
                          T Offline
                          Turtle Hand
                          wrote on last edited by
                          #33

                          when i was learning vb, i read that using with improved performance. i can't find the reference now. your description of why it doesn't improve performance appears related to vb.net. i was referring to vb6. Josef Wainz Software Developer

                          1 Reply Last reply
                          0
                          • C Chris Meech

                            JoeJoeMa wrote: it also performs faster. faster than what?? :confused: :confused: An initialisor function? 'inline' Set methods? JoeJoeMa wrote: but the features you've complained about are advantages OIC. You don't have to think about what you are doing. Chris Meech "what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002. "And when you need to hire a programmer to do mostly VB programming, it's not good enough to hire a VB programmer, because they will get completely stuck in tar every time the VB abstraction leaks." Joel on Software Nov 11, 2002.

                            T Offline
                            T Offline
                            Turtle Hand
                            wrote on last edited by
                            #34

                            when i was learning vb i read that using the with statement improved performance. i can't find the reference now. if memory serves, it has something to do with finding the object, then walking it's members. by using with, the object is found once and reused to find members. some parts of coding really aren't worth thinking about. Josef Wainz Software Developer

                            1 Reply Last reply
                            0
                            • C Chris Losinger

                              JoeJoeMa wrote: the point of typing the variable name over and over again? that's why Bill invented ctrl-c and ctrl-v -c CheeseWeasle

                              T Offline
                              T Offline
                              Turtle Hand
                              wrote on last edited by
                              #35

                              does more keystrokes mean a better language? Josef Wainz Software Developer

                              C 1 Reply Last reply
                              0
                              • T Turtle Hand

                                does more keystrokes mean a better language? Josef Wainz Software Developer

                                C Offline
                                C Offline
                                Chris Losinger
                                wrote on last edited by
                                #36

                                JoeJoeMa wrote: does more keystrokes mean a better language? mmm. yes. ? CheeseWeasle

                                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