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.
  • Z Zachery

    Merrion wrote: the syntax is 'well formed' WellthenitseemsthatIammistakenPunctuationisnotnessecarryatallAslongasthesyntaxiscorrectHoweverwouldntthatbelikesayingthatspacesperiodsapostraphesandcommasarentnessecarryaslongasthegrammariscorrect

    ..........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
    Duncan Edwards Jones
    wrote on last edited by
    #10

    Mmm - I meant "well formed syntax" in the context of Noam Chomsky's work on syntax and lexicon. '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

    1 Reply Last reply
    0
    • T Turtle Hand

      the with statement is quite cool, wish c# had it. what's the point of typing the variable name over and over again? it's wrapped in a with block you no what the members belong to. it also performs faster. typically loops increment by 1, so what's the point of typing i++. i believe if you do want to increment by something other than 1 you can use the word step followed by the number. if i had a choice between vb and c#, i would choose c# because it doesn't require as much typing, i like braces and semicolons. but the features you've complained about are advantages. Josef Wainz Software Developer

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

      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

      R T 2 Replies 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.

        Z Offline
        Z Offline
        Zachery
        wrote on last edited by
        #12

        Chris Meech wrote: You don't have to think about what you are doing. Yes, someone sees what I'm talking about.:-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+

        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

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

          Do you how many bugs can be introduced using copy/paste?


          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.


          Z C C 3 Replies Last reply
          0
          • R Ray Cassick

            Do you how many bugs can be introduced using copy/paste?


            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.


            Z Offline
            Z Offline
            Zachery
            wrote on last edited by
            #14

            Just as many as coding by hand. You never copy/paste code that has errors, always debug before, CTRL SHIFT B

            ..........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+

            1 Reply Last reply
            0
            • 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

              Z Offline
              Z Offline
              Zachery
              wrote on last edited by
              #15

              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 1 Reply Last reply
              0
              • T Turtle Hand

                the with statement is quite cool, wish c# had it. what's the point of typing the variable name over and over again? it's wrapped in a with block you no what the members belong to. it also performs faster. typically loops increment by 1, so what's the point of typing i++. i believe if you do want to increment by something other than 1 you can use the word step followed by the number. if i had a choice between vb and c#, i would choose c# because it doesn't require as much typing, i like braces and semicolons. but the features you've complained about are advantages. Josef Wainz Software Developer

                M Offline
                M Offline
                Mike Dimmick
                wrote on last edited by
                #16

                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 1 Reply Last reply
                0
                • R Ray Cassick

                  Do you how many bugs can be introduced using copy/paste?


                  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.


                  C Offline
                  C Offline
                  Chris Meech
                  wrote on last edited by
                  #17

                  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 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
                    Jamie Nordmeyer
                    wrote on last edited by
                    #18

                    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

                    Z D 2 Replies 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

                      Z Offline
                      Z Offline
                      Zachery
                      wrote on last edited by
                      #19

                      Jamie Nordmeyer wrote: Point being, learn about something before you openly criticize it Spending a day and a half, I have learnt a lot about it. Before, when I didn't know a lot about it, I didn't critisize it. If you were to go to the Gatering for a day, I would say that you can now duly critisize it.

                      ..........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 1 Reply Last reply
                      0
                      • R Ray Cassick

                        Do you how many bugs can be introduced using copy/paste?


                        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.


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

                        Ray Cassick wrote: Do you how many bugs can be introduced using copy/paste? 4 -c CheeseWeasle

                        1 Reply Last reply
                        0
                        • Z Zachery

                          Jamie Nordmeyer wrote: Point being, learn about something before you openly criticize it Spending a day and a half, I have learnt a lot about it. Before, when I didn't know a lot about it, I didn't critisize it. If you were to go to the Gatering for a day, I would say that you can now duly critisize it.

                          ..........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
                          Jamie Nordmeyer
                          wrote on last edited by
                          #21

                          Sorry bud. A day and a half is NOT enough to know "enough" about ANY language. :) Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA

                          1 Reply Last reply
                          0
                          • 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
                                          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