Microsoft's C++ bigotry - Page 23


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 23 of 43 FirstFirst ... 13212223242533 ... LastLast
Results 331 to 345 of 633

Thread: Microsoft's C++ bigotry

  1. #331
    Kent Guest

    Re: Microsoft's C++ bigotry


    You're reaching Larry, the whole gosub discussion is pointless anyway. The
    entire argument is that because M$ felt the need to clense the VB language
    of impurities that hinder OOP development. They have turned their backs
    on a very large body of developers.

    All your google search prooves is that developers already know what gosub
    does. For VB.Net to be a success there has to be a migration path. I know
    a lot of you claim it's already a success, but the numbers don't back you
    up. Gartner and other sources still show usage of VB falling.

    "Larry Serflaten" <serflaten@usinternet.com> wrote:
    >"Jonathan West" <jwest@mvps.org> wrote
    >> >
    >> > > There are also examples where it's better, so what's your point exactly?
    >> >
    >> > You are welcome to provide one...

    >>
    >> I already did. Dan described it in more detail. How many times do you

    need
    >> it repeated before you decide to read it?

    >
    >
    >No you did not provide an example, you explained where Gosub might
    >be advantagous in 3 situations, and later took one back. As I said then,
    >you can use a module to limit scope, so it turns out the only good reason
    >left is because that what was used before and there is no point to rewrite
    >it.
    >
    >Dan explained a situation where there were several values to pass, and then
    >went on to say:
    >
    ><quote>
    >With GoSub,
    >all you really have to do is wrap the call and GoSub to execute it.
    >Gone are the opportunities to screw up the parameter list for 15 or 20
    >instances of it. Also gone is the need to modify 15 or 20 instances
    >of the call when you change the parameter list.
    ></quote>
    >
    >(Neither of you provided example code)
    >
    >Such tightly coupled code can be placed in a module where only the
    >one call is public, and the working variables are either passed in (to
    >be passed on) or initialized by the routine. The ones that are passed
    >in from the calling code, can be passed on to any helper routines.
    >The module level variables that are initialized by the function, should
    >not be passed as parameters. There would be no change in the parameter
    >list unless the parameters change for the public function. In that case,
    >however rare it may be, Dan has a point. But more than likely, such
    >changes can be made via the Find/Replace dialog.
    >
    >It is possible to code it up that way, but it was not done that way at
    >the start, so now you guys want to leave it as is. That is about the
    >only valid reason you have for using Gosub, and IMHO it is not a
    >very strong one....
    >
    >Iceboxes used to keep food cold by using a block of ice, do you
    >see any such iceboxes today? Like the old west, eventually old
    >code will be replaced by new. It is just a matter of how much kicking
    >and screaming we have to hear about during the process....
    >
    >I've heard enough already. I don't plan to reply to another message on
    >this topic. I am not the one making the decisions, and it is apparent there
    >are two camps in the debate. You need to make your case to MS, because
    >like classic VB, it does not bother me if Gosub is included in VB.Net,
    >or not.
    >
    >
    >LFS
    >
    >
    >
    >
    >
    >


  2. #332
    Patrick Troughton Guest

    Re: Microsoft's C++ bigotry


    Cite?

    /Pat
    --------------------------
    It's the platform, stupid.
    --------------------------

    "Kent" <kp@kp.com> wrote:
    >
    > Gartner and other sources still show usage of VB falling.
    >



  3. #333
    Mike Mitchell Guest

    Re: Microsoft's C++ bigotry

    On Fri, 24 Jan 2003 10:05:15 -0600, Paul Clement
    <UseAdddressAtEndofMessage@swspectrum.com> wrote:

    >OK, I'm confused. How do you execute a GoSub statement if it's after an Exit Sub or Function. Or do
    >you mean that you have a bunch of code in between the GoSub call and the label above the code that
    >is to be executed when it is called? So in that case the flow of execution in the Sub or Function
    >branches down to execute that code and then returns back up to the line after the GoSub call to
    >execute the code in between the GoSub call and the GoSub code at the bottom of the Sub or Function.


    No wonder you're confused! After that para I'm pretty sure I haven't a
    clue what the heck it means. By the way, don't ever use GoSub! Since
    you obviously do not know where, how, or why it can be useful, I'd
    keep well away from it in future, if I were you.

    MM

  4. #334
    Mike Mitchell Guest

    Re: Microsoft's C++ bigotry

    On Fri, 24 Jan 2003 15:21:56 -0500, "Larry Triezenberg"
    <ltriezenberg@pathsys.com> wrote:

    >..... That
    >raises the bar much higher than just taking a couple of weeks to upgrade and
    >being able to move on into taking advantage of some of the new features.


    And that is the big difference between *all* previous VB upgrades and
    the upgrade from VB to VB.Net. In *all* previous upgrades you didn't
    need to rewrite the app. Sure, you may have had to make minor mods,
    but in general the "old" version loaded straight into the upgrade, and
    you were away! Up and running.

    You see, Paul, the thing is, bringing out a new programming system
    like VB was in 1991 should be like a marriage, especially given that
    one of the parties was Microsoft, the biggest software company in the
    world that knew then that it wanted and aspired to ruling the world,
    software-wise at least. When such a company with hegemonic tendencies
    brings out a new product, it should make its vows to the world in
    promising to keep that product around forever, if need be. Not a
    ten-year fling and then, hey, let's go for the younger model! And
    leave the old VB with 3 million screaming kids in tow and not much of
    a contract left (let's just hang on for euthanasia in 2008 is not much
    of a contract, is it?).

    It may end up like lots of real marriages that only really stay
    together because of the kids. But I happen to think that the kids in
    any marriage are kinda important and that's why, in the real world, we
    have marriage guidance counsellors, child support agencies, indeed, a
    whole plethora of support to try and keep that compact between church
    and state - or between Microsoft and The People - functioning for as
    long as human(e)ly possible. By unceremoniously killing off real VB
    for its replacement product, the kids are now wandering the streets,
    looking for places to hang out. Getting into all kinds of scrapes with
    dodgy strangers. Is this what you'd want for your kids, eh?

    Let's hope, for VB.Netizens' sake, that VB.Net doesn't get the
    unceremonious coup de grāce at some point in the future. It's unfair
    of a company not to have done its sums beforehand and then simply take
    it out on the faithful supporters whenever it likes. VB.Net should be
    here to stay. There has to be some sense of responsibility here, and
    not just to shareholders. I mean, don't we all want to go to heaven?

    MM

  5. #335
    Mike Mitchell Guest

    Re: Microsoft's C++ bigotry

    On Sat, 25 Jan 2003 21:26:13 +1100, Jason Sobell iGadget
    <igadget_@hotmail.com> wrote:

    >Just as a matter of interest, and after reading that the GoSub function is
    >such a favourite of VB developers, and wondering if I was missing out on a
    >popular programming construct, I did a Google search on the term
    >"Sample code" VB gosub
    >I got back 37 matches (after Google removed duplicates from the 58 found)


    Funny, I typed GoSub BASIC into Google and got back 14,700 hits! Of
    those, some talk about NEC PC-8201A BASIC, Tandy Model 100 BASIC,
    Advanced PICK BASIC, BASIC-52, BasicX BASIC, Commodore C64 BASIC, HP
    Business BASIC, BBC BASIC, QBASIC, BASIC used with a 6502 device, etc
    etc.

    In short, GoSub is ubiquitous. Just about every BASIC has GoSub.
    Classic VB also has GoSub, because VB is a BASIC. If the BASIC core in
    VB.Net is continually deprecated and disappears by and by, what will
    remain of any BASIC in it whatsoever?

    MM

  6. #336
    Mike Mitchell Guest

    Re: Microsoft's C++ bigotry

    On Sat, 25 Jan 2003 10:10:22 +1100, Jason Sobell iGadget
    <igadget_@hotmail.com> wrote:

    >Not quite sure what you are saying here, but a Call/Ret in assembler is the
    >equivalent of a GoSub


    GoSub/Return, actually.

    > except that you have access via the stack to the
    >address of the calling routine.
    >But... programming practise is to push a series of parameters (addresses or
    >values) onto the stack before you make that call, so the called routine can
    >access variables passed by the caller.


    That's the case if you're calling a procedure, but with GoSub, you're
    not really. You're jumping to a different part of the same code block,
    as if you were using a GoTo. All variables known within the code block
    are known to each part of it, including the part reached by GoTo or
    GoSub.

    >This makes the structure exactly the same as a Sub or Function, and is how
    >a Sub or Function is implemented in most languages.


    I'm not sure that it does make the structure exactly, or even
    approximately, the same as a Sub or a Function.

    >Doing a Call in assembler to a routine and allowing it to modify global
    >variables is perfectly possible, but a very bad idea because you quickly
    >lose track of the structure of your program and have the equivalent of
    >spaghetti.


    But there's little chance of spaghetti JUST by using a GoSub! If a
    GoSub produces spaghetti, then I'd venture to suggest that *other*
    parts of the same code block also would tend towards 'producing'
    spaghetti, since this type of pasta usually emanates from the
    programmer's brain, not from the specific use of GoSub. In any case,
    no one is suggesting that all Subs and Functions be replaced with
    GoSubs! Just that there are some situations, especially when a number
    of parameters are needed, to prefer the use of GoSub over a Sub.

    >I know this as fact because I wrote games (commercially) in assembler for 6
    >years.


    But *all* assembler is *far* more prone to producing spaghetti by its
    very voluminous nature! That's why high-level languages like BASIC
    were invented - to vastly improve productivity.

    >GoSub has no equivalent of the "Use these variables" pointer (the Stack
    >Pointer in assembler) so you must use variables that are global to the
    >calling code.


    So must all the other parts of the same code block! In that sense, all
    variables in a code block must be "global" to that block (except that
    now .Net wants to complicate things with even 'tighter' local scope
    defined within If/Then code blocks. I might argue that that is some
    feeble attempt to kludge nested subs, when the better idea might be to
    call a separate sub.).

    >Arguing individual aspects of this is pointless. Well all know the syntax
    >for GoSub, and some people want to keep it because they use it frequently.
    >I don't and would strongly discourage people because it gives a small
    >saving in time (and arguably performance) for a big loss in readability *in
    >all but the very simplest implementation*.


    And I think you'll find that programmers use GoSub while being fully
    aware of the Sub or Function alternatives. Often it *does* in fact
    improve readability, but mostly the clues are: Lots of variables that
    would require passing to an external routine; and lots of times the
    same piece of code needs to be executed within a code block.

    >Yes, people can find individual instances where it might have an advantage,
    >but they are few and far between.


    The beauty of BASIC is that even when requirements are few and far
    between, there are these tenets of the language that don't ever go
    away. Like that one strange bit of bent wire in a toolbox, it's there
    for that rare occasion when the carpenter needs it.

    >So we accept that it's gone and "move on"


    It's alive and kicking! It hasn't gone! Not from proper BASICs,
    anyway.

    MM

  7. #337
    Patrick Troughton Guest

    Re: Microsoft's C++ bigotry


    >snip pointless rant about GoSub


    Tell us, Dan....do you still pine for DEF FN functions, too?

    /Pat
    --------------------------
    It's the platform, stupid.
    --------------------------

  8. #338
    Jason Sobell iGadget Guest

    Re: Microsoft's C++ bigotry

    On Sat, 25 Jan 2003 21:11:08 +0000, Mike Mitchell wrote:

    > On Sat, 25 Jan 2003 21:26:13 +1100, Jason Sobell iGadget
    > <igadget_@hotmail.com> wrote:
    >
    >>Just as a matter of interest, and after reading that the GoSub function is
    >>such a favourite of VB developers, and wondering if I was missing out on a
    >>popular programming construct, I did a Google search on the term
    >>"Sample code" VB gosub
    >>I got back 37 matches (after Google removed duplicates from the 58 found)

    >
    > Funny, I typed GoSub BASIC into Google and got back 14,700 hits! Of
    > those, some talk about NEC PC-8201A BASIC, Tandy Model 100 BASIC,
    > Advanced PICK BASIC, BASIC-52, BasicX BASIC, Commodore C64 BASIC, HP
    > Business BASIC, BBC BASIC, QBASIC, BASIC used with a 6502 device, etc
    > etc.


    Yes, and GOTO Basic returns 334000, Function basic returns 3730000 etc.
    I was looking for examples being use *in code*, rather than the millions of
    references to document these functions, hence the inclusion of the term
    "sample code" in the criteria.

    Cheers,
    Jason

  9. #339
    Jason Sobell iGadget Guest

    Re: Microsoft's C++ bigotry

    On Sat, 25 Jan 2003 21:38:37 +0000, Mike Mitchell wrote:

    > On Sat, 25 Jan 2003 10:10:22 +1100, Jason Sobell iGadget
    > <igadget_@hotmail.com> wrote:
    >
    >>Not quite sure what you are saying here, but a Call/Ret in assembler is the
    >>equivalent of a GoSub

    >
    > GoSub/Return, actually.


    Pedant

    >> except that you have access via the stack to the
    >>address of the calling routine.
    >>But... programming practise is to push a series of parameters (addresses or
    >>values) onto the stack before you make that call, so the called routine can
    >>access variables passed by the caller.

    >
    > That's the case if you're calling a procedure, but with GoSub, you're
    > not really. You're jumping to a different part of the same code block,
    > as if you were using a GoTo. All variables known within the code block
    > are known to each part of it, including the part reached by GoTo or
    > GoSub.


    We are talking *assembler* here. There is no 'code block', there is simply
    'the program'.

    >>This makes the structure exactly the same as a Sub or Function, and is how
    >>a Sub or Function is implemented in most languages.

    >
    > I'm not sure that it does make the structure exactly, or even
    > approximately, the same as a Sub or a Function.


    Doh.

    >>Doing a Call in assembler to a routine and allowing it to modify global
    >>variables is perfectly possible, but a very bad idea because you quickly
    >>lose track of the structure of your program and have the equivalent of
    >>spaghetti.

    >
    > But there's little chance of spaghetti JUST by using a GoSub! If a
    > GoSub produces spaghetti, then I'd venture to suggest that *other*
    > parts of the same code block also would tend towards 'producing'
    > spaghetti, since this type of pasta usually emanates from the
    > programmer's brain, not from the specific use of GoSub. In any case,
    > no one is suggesting that all Subs and Functions be replaced with
    > GoSubs! Just that there are some situations, especially when a number
    > of parameters are needed, to prefer the use of GoSub over a Sub.


    We know that and have discussed it in relation to VB already.

    >>I know this as fact because I wrote games (commercially) in assembler for 6
    >>years.

    >
    > But *all* assembler is *far* more prone to producing spaghetti by its
    > very voluminous nature! That's why high-level languages like BASIC
    > were invented - to vastly improve productivity.


    And? Assembler developers are forced to develop in a manner that reduces or
    avoids this spaghetti. Emulating 'functions' and 'subs' in the assembler
    solves a major part of this problem.

    [Snip all the rehashing of earlier postings]

    Cheers,
    Jason

  10. #340
    Jason Sobell iGadget Guest

    Re: Microsoft's C++ bigotry

    On Sat, 25 Jan 2003 19:23:58 +0000, Mike Mitchell wrote:

    > On Fri, 24 Jan 2003 10:05:15 -0600, Paul Clement
    > <UseAdddressAtEndofMessage@swspectrum.com> wrote:
    >
    >>OK, I'm confused. How do you execute a GoSub statement if it's after an Exit Sub or Function. Or do
    >>you mean that you have a bunch of code in between the GoSub call and the label above the code that
    >>is to be executed when it is called? So in that case the flow of execution in the Sub or Function
    >>branches down to execute that code and then returns back up to the line after the GoSub call to
    >>execute the code in between the GoSub call and the GoSub code at the bottom of the Sub or Function.

    >
    > No wonder you're confused! After that para I'm pretty sure I haven't a
    > clue what the heck it means. By the way, don't ever use GoSub! Since
    > you obviously do not know where, how, or why it can be useful, I'd
    > keep well away from it in future, if I were you.


    Doh! Read the other replies before posting, Mike
    Alternatively, read the posting itself more carefully next time.

    Cheers,
    Jason

  11. #341
    Gary Nelson Guest

    Re: Microsoft's C++ bigotry

    Larry,

    > <quote>
    > Tip Creating separate procedures that you can call may provide a more

    structured alternative to using GoSub...Return
    > </quote>


    It is a shame that they didn't say: 'Please desist from using GoSub as it
    will be removed from future versions of Visual Basic'

    Note the qualifying word 'may' in your quote.

    Gary



  12. #342
    Gary Nelson Guest

    Re: Microsoft's C++ bigotry

    Paul,

    > OK, I'm confused. How do you execute a GoSub statement if it's after an

    Exit Sub or Function.

    Obviously the Gosub Statement must be before the exit Sub or Function
    (unless it is nested within a Gosub). But that is not what you were talking
    about. I quote:

    > ¤ > Which is why it isn't a container since entry can be accomplished via

    a
    > ¤ branch call or via the
    > ¤ > sequential execution of code. That is, unless you either skip over the
    > ¤ GoSub code programmatically
    > ¤ > or Exit the Function or Sub prior to its execution.


    Notice you mention the 'Gosub code' not the Gosub Statement.

    > OK, I'm confused. How do you execute a GoSub statement if it's after an

    Exit Sub or Function. Or do
    > you mean that you have a bunch of code in between the GoSub call and the

    label above the code that
    > is to be executed when it is called? So in that case the flow of execution

    in the Sub or Function
    > branches down to execute that code and then returns back up to the line

    after the GoSub call to
    > execute the code in between the GoSub call and the GoSub code at the

    bottom of the Sub or Function.

    See Dan's example.

    Gary



  13. #343
    Gary Nelson Guest

    Re: Microsoft's C++ bigotry

    Jason,

    > >>OK, I'm confused. How do you execute a GoSub statement if it's after an

    Exit Sub or Function.
    > >
    > > You're kidding, eh? *Please* say you're kidding. This could explain
    > > a lot.

    >
    > [Snip]
    >
    > Actually, Paul was right.
    > You put your GoSub *routine* after the Exit, not your GoSub statement


    See my answer to Paul.

    >
    > Read his previous posting properly.
    > He is arguing that GoSub is not a container because it's inline, and he is
    > correct. How about this:
    >
    > Sub Main()
    > Dim a As Integer
    >
    > a = 0
    > GoSub DoDaSub
    > a = 1
    >
    > DoDaSub:
    > Debug.Print "Hi, a=" + CStr(a)
    > If a > 0 Then Exit Sub
    > Return
    > End Sub


    Jason, your code does not make any sense. By the way, it is not good
    programming practice to do an Exit Sub from within a Gosub. If you don't
    understand what Gosub is or does I suggest you stop giving your opinions.

    >
    > Yuk! I hope nobody would ever write code like this in their application.


    I doubt very much anyone ever has.

    > If we code it in the manner that BASIC originally intended (before we were
    > given those lovely text labels instead of line numbers)
    >
    > 1 a = 0
    > 2 GoSub 5
    > 3 a = 1
    > 4
    > 5 Debug.Print "Hi, a=" + CStr(a)
    > 6 If a > 0 Then Goto 8
    > 7 Return
    > 8
    >


    I don't believe it was ever intended to be used the way you present. Not
    even with line numbers.

    > or how about
    >
    > a = 0
    > GoSub DoDaSub
    > a = 1
    > DoDaSub:
    > Debug.Print "Hi, a=" + CStr(a)
    > If a = 0 Then Return
    >
    >
    > Is this getting any more readable yet?
    > I think we can safely say that GoSub is *NOT* a container of any sort.


    I think we can safely say that you don't know what you are talking about.

    Gary



  14. #344
    Gary Nelson Guest

    Re: Microsoft's C++ bigotry

    Patrick,

    > >snip pointless rant about GoSub

    >
    > Tell us, Dan....do you still pine for DEF FN functions, too?


    Good point. DEF FN was superseded by a superior solution. If Gosub were
    superseded by a superior solution (Inline Macros, or something of the like),
    there would be no problem. Such is not the case.

    Gary



  15. #345
    Gary Nelson Guest

    Re: Microsoft's C++ bigotry

    Jason,

    > > No wonder you're confused! After that para I'm pretty sure I haven't a
    > > clue what the heck it means. By the way, don't ever use GoSub! Since
    > > you obviously do not know where, how, or why it can be useful, I'd
    > > keep well away from it in future, if I were you.

    >
    > Doh! Read the other replies before posting, Mike
    > Alternatively, read the posting itself more carefully next time.


    Mike is absolutely right. It's quite obviously that you have no idea what
    Gosub is nor how it is used. I would suggest that you discuss things you
    understand and stay away from subjects when you have no idea what your
    talking about.

    Gary





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center