Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #41668 > unrolled thread

Is goto Still Considered Harmful?

Started byLynn McGuire <lmc@winsim.com>
First post2014-03-12 11:02 -0500
Last post2014-03-29 05:56 -0700
Articles 20 on this page of 149 — 45 participants

Back to article view | Back to comp.lang.c


Contents

  Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-12 11:02 -0500
    Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-12 12:17 -0400
    Re: Is goto Still Considered Harmful? nospam@see.signature (Richard Maine) - 2014-03-12 09:20 -0700
      Re: Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-18 16:30 -0500
        Re: Is goto Still Considered Harmful? Geoff <geoff@invalid.invalid> - 2014-03-18 17:36 -0700
          Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-19 07:34 -0400
            Re: Is goto Still Considered Harmful? "BartC" <bc@freeuk.com> - 2014-03-19 12:08 +0000
              Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-19 10:07 -0400
                Re: Is goto Still Considered Harmful? Richard <rgrdev_@gmail.com> - 2014-03-19 17:05 +0100
              Re: Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-19 12:27 -0500
        Re: Is goto Still Considered Harmful? "Terence" <tbwright@bigpond.net.au> - 2014-03-19 20:35 +1100
          Re: Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-19 12:26 -0500
    Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-12 16:47 +0000
      Re: Is goto Still Considered Harmful? Jos Bergervoet <jos.bergervoet@xs4all.nl> - 2014-03-12 19:07 +0100
        Re: Is goto Still Considered Harmful? Andrew Cooper <root@127.0.0.1> - 2014-03-12 23:36 +0000
          Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-13 00:23 +0000
            Re: Is goto Still Considered Harmful? Andrew Cooper <root@127.0.0.1> - 2014-03-13 01:18 +0000
              Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-13 02:08 +0000
                Re: Is goto Still Considered Harmful? Andrew Cooper <root@127.0.0.1> - 2014-03-13 02:21 +0000
                Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-13 11:17 +0100
          Re: Is goto Still Considered Harmful? Melzzzzz <mel@zzzzz.invalid> - 2014-03-13 01:53 +0100
        Re: Is goto Still Considered Harmful? Les Cargill <lcargill99@comcast.com> - 2014-03-13 01:46 -0500
      Re: Is goto Still Considered Harmful? Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-03-13 10:56 +0100
      Re: Is goto Still Considered Harmful? "Nasser M. Abbasi" <nma@12000.org> - 2014-03-16 08:18 -0500
        Re: Is goto Still Considered Harmful? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-16 15:18 +0000
          Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-20 11:36 -0700
    Re: Is goto Still Considered Harmful? "BartC" <bc@freeuk.com> - 2014-03-12 18:50 +0000
      Re: Is goto Still Considered Harmful? <william@wilbur.25thandClement.com> - 2014-03-12 12:49 -0700
      Re: Is goto Still Considered Harmful? "Qolin" <noone@nowhere.com> - 2014-03-12 21:54 +0000
        Re: Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-12 16:57 -0500
        Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-12 15:36 -0700
          Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-12 19:02 -0400
            Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-12 16:58 -0700
              Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-12 20:09 -0400
          Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-12 16:44 -0700
        Re: Is goto Still Considered Harmful? Robert Wessel <robertwessel2@yahoo.com> - 2014-03-12 23:40 -0500
          Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-13 11:25 +0100
          Re: Is goto Still Considered Harmful? Thomas Jahns <jahns@idontlikespam.dkrz.de> - 2014-03-14 11:24 +0100
            Re: Is goto Still Considered Harmful? Robert Wessel <robertwessel2@yahoo.com> - 2014-03-14 23:32 -0500
            Re: Is goto Still Considered Harmful? Dr Nick <nospam-4@temporary-address.org.uk> - 2014-03-15 13:43 +0000
              Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-15 16:28 +0100
                Re: Is goto Still Considered Harmful? Dr Nick <nospam-4@temporary-address.org.uk> - 2014-03-15 16:01 +0000
                  Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-17 08:51 +0100
      Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-13 11:22 +0100
    Re: Is goto Still Considered Harmful? ralph <nt_consulting@yahoo.com> - 2014-03-12 15:34 -0500
    Re: Is goto Still Considered Harmful? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2014-03-12 17:48 -0700
    Re: Is goto Still Considered Harmful? jt@toerring.de (Jens Thoms Toerring) - 2014-03-13 01:06 +0000
      Re: Is goto Still Considered Harmful? wilson <winslole@udayton.edu> - 2014-03-13 03:59 -0400
        Re: Is goto Still Considered Harmful? wilson <winslole@udayton.edu> - 2014-03-13 05:02 -0400
          Re: Is goto Still Considered Harmful? Richard Damon <Richard@Damon-Family.org> - 2014-03-13 08:42 -0400
            Re: Is goto Still Considered Harmful? gazelle@shell.xmission.com (Kenny McCormack) - 2014-03-13 14:45 +0000
      Re: Is goto Still Considered Harmful? Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2014-03-13 07:42 -0600
        Re: Is goto Still Considered Harmful? Richard <rgrdev_@gmail.com> - 2014-03-13 14:56 +0100
    Re: Is goto Still Considered Harmful? Wolfgang Kilian <kilian@invalid.com> - 2014-03-13 09:10 +0100
    Re: Is goto Still Considered Harmful? mark.bluemel@gmail.com - 2014-03-13 08:02 -0700
    Re: Is goto Still Considered Harmful? Thomas Koenig <tkoenig@netcologne.de> - 2014-03-13 21:09 +0000
      Re: Is goto Still Considered Harmful? "Qolin" <noone@nowhere.com> - 2014-03-13 21:24 +0000
        Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-13 22:36 +0000
          Re: Is goto Still Considered Harmful? Robert Wessel <robertwessel2@yahoo.com> - 2014-03-13 23:02 -0500
            Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-14 04:07 +0000
              Re: Is goto Still Considered Harmful? Robert Wessel <robertwessel2@yahoo.com> - 2014-03-13 23:56 -0500
            Re: Is goto Still Considered Harmful? helbig@astro.multiCLOTHESvax.de (Phillip Helbig---undress to reply) - 2014-03-14 09:17 +0000
      Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-13 22:42 +0000
        Re: Is goto Still Considered Harmful? "James Van Buskirk" <not_valid@comcast.net> - 2014-03-13 17:13 -0600
          Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-13 16:46 -0700
            Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-14 01:17 +0000
              Re: Is goto Still Considered Harmful? Robert Wessel <robertwessel2@yahoo.com> - 2014-03-13 23:04 -0500
                Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-14 10:41 +0100
                  Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-14 09:55 +0000
                    Re: Is goto Still Considered Harmful? David Brown <david.brown@hesbynett.no> - 2014-03-14 13:16 +0100
                    Re: Is goto Still Considered Harmful? Seebs <usenet-nospam@seebs.net> - 2014-03-18 21:08 +0000
                      Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-18 17:41 -0400
          Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-14 00:45 +0000
            Re: Is goto Still Considered Harmful? "James Van Buskirk" <not_valid@comcast.net> - 2014-03-13 21:40 -0600
              Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-14 01:02 -0400
                Re: Is goto Still Considered Harmful? "James Van Buskirk" <not_valid@comcast.net> - 2014-03-14 10:36 -0600
                  Re: Is goto Still Considered Harmful? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-14 17:30 +0000
                  Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-14 13:51 -0400
                    Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-14 13:12 -0700
                  Re: Is goto Still Considered Harmful? Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-29 06:46 -0700
              Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-14 05:29 +0000
                Re: Is goto Still Considered Harmful? "James Van Buskirk" <not_valid@comcast.net> - 2014-03-14 10:47 -0600
                  Re: Is goto Still Considered Harmful? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-14 17:43 +0000
                  Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-14 13:52 -0400
              Re: Is goto Still Considered Harmful? Stephen Sprunk <stephen@sprunk.org> - 2014-03-16 17:15 -0500
                Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-16 16:04 -0700
      Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-14 05:11 +0000
        Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-14 06:00 +0000
    Re: Is goto Still Considered Harmful? "Terence" <tbwright@bigpond.net.au> - 2014-03-14 08:32 +1100
      Re: Is goto Still Considered Harmful? Richard Damon <Richard@Damon-Family.org> - 2014-03-14 23:10 -0400
    Re: Is goto Still Considered Harmful? Rosario193 <Rosario@invalid.invalid> - 2014-03-14 02:18 +0100
      Re: Is goto Still Considered Harmful? Lynn McGuire <lmc@winsim.com> - 2014-03-18 16:14 -0500
    Re: Is goto Still Considered Harmful? John Bode <jfbode1029@gmail.com> - 2014-03-24 07:52 -0700
      Re: Is goto Still Considered Harmful? Ken Brody <kenbrody@spamcop.net> - 2014-03-24 11:20 -0400
        Re: Is goto Still Considered Harmful? "BartC" <bc@freeuk.com> - 2014-03-24 17:08 +0000
        Re: Is goto Still Considered Harmful? Ken Brody <kenbrody@spamcop.net> - 2014-03-25 14:06 -0400
          Re: Is goto Still Considered Harmful? Lowell Gilbert <lgusenet@be-well.ilk.org> - 2014-03-26 13:31 -0400
      Re: Is goto Still Considered Harmful? gazelle@shell.xmission.com (Kenny McCormack) - 2014-03-24 16:31 +0000
      Re: Is goto Still Considered Harmful? "BartC" <bc@freeuk.com> - 2014-03-24 16:46 +0000
        Re: Is goto Still Considered Harmful? John Bode <jfbode1029@gmail.com> - 2014-03-24 16:10 -0700
          Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-24 17:19 -0700
            Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-25 02:56 -0700
            Re: Is goto Still Considered Harmful? Keith Thompson <kst-u@mib.org> - 2014-03-25 07:34 -0700
              Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-25 10:57 -0400
                Re: Is goto Still Considered Harmful? gazelle@shell.xmission.com (Kenny McCormack) - 2014-03-25 16:09 +0000
                Re: Is goto Still Considered Harmful? Kaz Kylheku <kaz@kylheku.com> - 2014-03-25 16:14 +0000
                  Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-03-26 08:06 +1300
                  Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-25 12:49 -0700
                  Re: Is goto Still Considered Harmful? Stephen Sprunk <stephen@sprunk.org> - 2014-03-31 14:05 -0500
                    Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-31 15:20 -0400
                      Re: Is goto Still Considered Harmful? Stephen Sprunk <stephen@sprunk.org> - 2014-04-04 14:56 -0500
                        Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-04-04 17:11 -0400
                          Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-04-05 12:03 +1300
                          Re: Is goto Still Considered Harmful? ralph <nt_consulting@yahoo.com> - 2014-04-05 00:17 -0500
                            Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-04-05 20:14 +1300
                          Re: Is goto Still Considered Harmful? Stephen Sprunk <stephen@sprunk.org> - 2014-04-09 14:30 -0500
                            Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-04-09 16:37 -0400
                              Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-09 14:01 -0700
                        Re: Is goto Still Considered Harmful? Richard <rgrdev_@gmail.com> - 2014-04-05 15:21 +0100
                    Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-04-01 11:04 +1300
                      Re: Is goto Still Considered Harmful? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2014-04-01 02:45 +0300
                        Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-04-01 13:03 +1300
                          Re: Is goto Still Considered Harmful? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2014-05-22 12:01 +0300
                            Re: Is goto Still Considered Harmful? Ian Collins <ian-news@hotmail.com> - 2014-05-22 21:22 +1200
                        Re: Is goto Still Considered Harmful? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2014-05-22 11:53 +0300
                Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-31 12:10 -0400
                  Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-31 10:39 -0700
                    Re: Is goto Still Considered Harmful? Stephen Sprunk <stephen@sprunk.org> - 2014-03-31 13:42 -0500
                      Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-31 15:16 -0700
                        Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-01 00:24 -0700
                          Re: Is goto Still Considered Harmful? Richard Damon <Richard@Damon-Family.org> - 2014-04-01 08:26 -0400
                            Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-01 06:50 -0700
                              Re: Are setters Stil Considered Harmful? (was: Is goto Still Considered Harmful?) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-02 10:49 -0700
              Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-25 19:30 +0000
                Re: Is goto Still Considered Harmful? Ken Brody <kenbrody@spamcop.net> - 2014-03-27 09:33 -0400
              Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-25 19:37 +0000
          Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-25 00:30 -0400
          Re: Is goto Still Considered Harmful? John Bode <jfbode1029@gmail.com> - 2014-03-27 11:47 -0700
            Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-27 20:39 -0400
              Re: Is goto Still Considered Harmful? gazelle@shell.xmission.com (Kenny McCormack) - 2014-03-28 01:40 +0000
            Re: Is goto Still Considered Harmful? Richard <rgrdev_@gmail.com> - 2014-03-28 10:09 +0100
              Re: Is goto Still Considered Harmful? gazelle@shell.xmission.com (Kenny McCormack) - 2014-03-28 09:48 +0000
              Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-28 03:24 -0700
                Re: Is goto Still Considered Harmful? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-03-28 18:52 +0000
                Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-30 02:45 -0700
      Re: Is goto Still Considered Harmful? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-03-24 12:53 -0700
      Re: Is goto Still Considered Harmful? John Bode <jfbode1029@gmail.com> - 2014-03-24 15:02 -0700
        Re: Is goto Still Considered Harmful? James Kuyper <jameskuyper@verizon.net> - 2014-03-24 19:11 -0400
    Re: Is goto Still Considered Harmful? Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-29 05:56 -0700

Page 1 of 8  [1] 2 3 4 5 6 7 8  Next page →


#41668 — Is goto Still Considered Harmful?

FromLynn McGuire <lmc@winsim.com>
Date2014-03-12 11:02 -0500
SubjectIs goto Still Considered Harmful?
Message-ID<lfq0fp$4dp$1@dont-email.me>
Is goto Still Considered Harmful?
 
http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-harmful/240166595

Lynn

[toc] | [next] | [standalone]


#41670

FromJames Kuyper <jameskuyper@verizon.net>
Date2014-03-12 12:17 -0400
Message-ID<lfq1b2$b2u$2@dont-email.me>
In reply to#41668
On 03/12/2014 12:02 PM, Lynn McGuire wrote:
> Is goto Still Considered Harmful?
>  
> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-harmful/240166595

By some people, yes. By others, no. You were expecting this to change?
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#41671

Fromnospam@see.signature (Richard Maine)
Date2014-03-12 09:20 -0700
Message-ID<1lie1rb.1p06hnd8hxbwaN%nospam@see.signature>
In reply to#41668
Lynn McGuire <lmc@winsim.com> wrote:

> Is goto Still Considered Harmful?
>  
> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-
> harmful/240166595

I didn't see anything in that article that hasn't been said a zillion
times before. I'll note that, although the code shown was C, the goto
statements were used in very much the same way as most of the few gotos
that I use in my Fortran code - for an error exit.

-- 
Richard Maine
email: last name at domain . net
domain: summer-triangle

[toc] | [prev] | [next] | [standalone]


#41989

FromLynn McGuire <lmc@winsim.com>
Date2014-03-18 16:30 -0500
Message-ID<lgadtp$9s0$1@dont-email.me>
In reply to#41671
On 3/12/2014 11:20 AM, Richard Maine wrote:
> Lynn McGuire <lmc@winsim.com> wrote:
>
>> Is goto Still Considered Harmful?
>>
>> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-
>> harmful/240166595
>
> I didn't see anything in that article that hasn't been said a zillion
> times before. I'll note that, although the code shown was C, the goto
> statements were used in very much the same way as most of the few gotos
> that I use in my Fortran code - for an error exit.

We still have hundreds of thousands of lines of
F66 code in our app.  I wish most of the gotos
would just go away.  I rip a few out whenever I
get a chance but the risk of creating new bugs
is very high.

Lynn

[toc] | [prev] | [next] | [standalone]


#41999

FromGeoff <geoff@invalid.invalid>
Date2014-03-18 17:36 -0700
Message-ID<2kohi99ifn8opluhqi8rovcp59n050hu00@4ax.com>
In reply to#41989
On Tue, 18 Mar 2014 16:30:11 -0500, Lynn McGuire <lmc@winsim.com>
wrote:

>On 3/12/2014 11:20 AM, Richard Maine wrote:
>> Lynn McGuire <lmc@winsim.com> wrote:
>>
>>> Is goto Still Considered Harmful?
>>>
>>> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-
>>> harmful/240166595
>>
>> I didn't see anything in that article that hasn't been said a zillion
>> times before. I'll note that, although the code shown was C, the goto
>> statements were used in very much the same way as most of the few gotos
>> that I use in my Fortran code - for an error exit.
>
>We still have hundreds of thousands of lines of
>F66 code in our app.  I wish most of the gotos
>would just go away.  I rip a few out whenever I
>get a chance but the risk of creating new bugs
>is very high.
>
>Lynn
>

If it ain't broke, don't fix it, unless you can afford to replace it.

	;)

The original concept and intent of avoiding goto was to make
comprehension and maintenance easier.  If the code works and never
needs maintenance or if any maintenance of the code isn't made
difficult by its spaghetti shape, then there is no reason to refactor
unless there is confidence that regression testing will reveal any
errors that might arise as a result. 

[toc] | [prev] | [next] | [standalone]


#42005

FromJames Kuyper <jameskuyper@verizon.net>
Date2014-03-19 07:34 -0400
Message-ID<lgbvcl$tca$1@dont-email.me>
In reply to#41999
On 03/18/2014 08:36 PM, Geoff wrote:
> On Tue, 18 Mar 2014 16:30:11 -0500, Lynn McGuire <lmc@winsim.com>
> wrote:
...
>> We still have hundreds of thousands of lines of
>> F66 code in our app.  I wish most of the gotos
>> would just go away.  I rip a few out whenever I
>> get a chance but the risk of creating new bugs
>> is very high.
>>
>> Lynn
>>
> 
> If it ain't broke, don't fix it, unless you can afford to replace it.
> 
> 	;)
> 
> The original concept and intent of avoiding goto was to make
> comprehension and maintenance easier.  If the code works and never
> needs maintenance or if any maintenance of the code isn't made
> difficult by its spaghetti shape, then there is no reason to refactor
> unless there is confidence that regression testing will reveal any
> errors that might arise as a result.

I would guess that "whenever I get a chance" refers to when maintenance
is needed for other reasons; that's the same rule I use when determining
whether to make stylistic improvements to working code. And it's pretty
plausible that any code that old is indeed difficult to maintain because
of its spaghetti shape.
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#42006

From"BartC" <bc@freeuk.com>
Date2014-03-19 12:08 +0000
Message-ID<vNfWu.64226$Uh7.61147@fx28.am4>
In reply to#42005
"James Kuyper" <jameskuyper@verizon.net> wrote in message 
news:lgbvcl$tca$1@dont-email.me...
> On 03/18/2014 08:36 PM, Geoff wrote:

>> The original concept and intent of avoiding goto was to make
>> comprehension and maintenance easier.  If the code works and never
>> needs maintenance or if any maintenance of the code isn't made
>> difficult by its spaghetti shape, then there is no reason to refactor
>> unless there is confidence that regression testing will reveal any
>> errors that might arise as a result.
>
> I would guess that "whenever I get a chance" refers to when maintenance
> is needed for other reasons; that's the same rule I use when determining
> whether to make stylistic improvements to working code. And it's pretty
> plausible that any code that old is indeed difficult to maintain because
> of its spaghetti shape.

If it really was spaghetti code, then yes.

But if the gotos were used sensibly to construct missing control statements, 
then it might be possible to derive those by some analysis.

-- 
Bartc 

[toc] | [prev] | [next] | [standalone]


#42009

FromJames Kuyper <jameskuyper@verizon.net>
Date2014-03-19 10:07 -0400
Message-ID<5329A488.9070105@verizon.net>
In reply to#42006
On 03/19/2014 08:08 AM, BartC wrote:
> "James Kuyper" <jameskuyper@verizon.net> wrote in message 
> news:lgbvcl$tca$1@dont-email.me...
...
>> I would guess that "whenever I get a chance" refers to when maintenance
>> is needed for other reasons; that's the same rule I use when determining
>> whether to make stylistic improvements to working code. And it's pretty
>> plausible that any code that old is indeed difficult to maintain because
>> of its spaghetti shape.
> 
> If it really was spaghetti code, then yes.
> 
> But if the gotos were used sensibly to construct missing control statements, 

Such code can still be hard to maintain - there's a legitimate reason
why those control statements were added to later versions of Fortran.

[toc] | [prev] | [next] | [standalone]


#42012

FromRichard <rgrdev_@gmail.com>
Date2014-03-19 17:05 +0100
Message-ID<8738ienphl.fsf@gmail.com>
In reply to#42009
James Kuyper <jameskuyper@verizon.net> writes:

> On 03/19/2014 08:08 AM, BartC wrote:
>> "James Kuyper" <jameskuyper@verizon.net> wrote in message 
>> news:lgbvcl$tca$1@dont-email.me...
> ...
>>> I would guess that "whenever I get a chance" refers to when maintenance
>>> is needed for other reasons; that's the same rule I use when determining
>>> whether to make stylistic improvements to working code. And it's pretty
>>> plausible that any code that old is indeed difficult to maintain because
>>> of its spaghetti shape.
>> 
>> If it really was spaghetti code, then yes.
>> 
>> But if the gotos were used sensibly to construct missing control
>> statements, 

Idiots will tell you that's not possible. As someone with years
assembler not only is it done, it must be done or, yes, its hard to maintain.

>
> Such code can still be hard to maintain - there's a legitimate reason
> why those control statements were added to later versions of Fortran.

Its just as hard if not harder to keep in your head the multiple ways a
function can fall through to a single return statement. It's nonsense to
insist on one return statement.

if(c) then {
      prepare_stuff(;
      return INITIAL_SETUP_COMPLETE;
}else if(d){
      return ALREADY_DONE
}

return BLAH;

Simple but sometimes we need to keep it simply. A lot of time
maintaining live code bases we need to step through code and explicit
returns like that make it a LOT simpler to follow.

Too much theory over practice with no reference to real development and
maintenance tools makes a pretty shitty and useless team member.

-- 
"Avoid hyperbole at all costs, its the most destructive argument on
the planet" - Mark McIntyre in comp.lang.c

[toc] | [prev] | [next] | [standalone]


#42014

FromLynn McGuire <lmc@winsim.com>
Date2014-03-19 12:27 -0500
Message-ID<lgck3f$104$2@dont-email.me>
In reply to#42006
On 3/19/2014 7:08 AM, BartC wrote:
> "James Kuyper" <jameskuyper@verizon.net> wrote in message news:lgbvcl$tca$1@dont-email.me...
>> On 03/18/2014 08:36 PM, Geoff wrote:
>
>>> The original concept and intent of avoiding goto was to make
>>> comprehension and maintenance easier.  If the code works and never
>>> needs maintenance or if any maintenance of the code isn't made
>>> difficult by its spaghetti shape, then there is no reason to refactor
>>> unless there is confidence that regression testing will reveal any
>>> errors that might arise as a result.
>>
>> I would guess that "whenever I get a chance" refers to when maintenance
>> is needed for other reasons; that's the same rule I use when determining
>> whether to make stylistic improvements to working code. And it's pretty
>> plausible that any code that old is indeed difficult to maintain because
>> of its spaghetti shape.
>
> If it really was spaghetti code, then yes.
>
> But if the gotos were used sensibly to construct missing control statements, then it might be possible to derive those by some analysis.

I was working on a 6,000 line subroutine the other
day with a goto from line 5000 to line 2000.  Talk
about a context change for a looping mechanism.

Lynn

[toc] | [prev] | [next] | [standalone]


#42004

From"Terence" <tbwright@bigpond.net.au>
Date2014-03-19 20:35 +1100
Message-ID<lgbobl$d6v$1@dont-email.me>
In reply to#41989
>We still have hundreds of thousands of lines of
>F66 code in our app.  I wish most of the gotos
>would just go away.  I rip a few out whenever I
>get a chance but the risk of creating new bugs
>is very high.
>
>Lynn

I repeat, just use a simple tool.
One option is to use Alan Miller's code to go straight to F90.
There are others.
But you are in the unique position of being able to retest at any step into
which you break the project up.

[toc] | [prev] | [next] | [standalone]


#42013

FromLynn McGuire <lmc@winsim.com>
Date2014-03-19 12:26 -0500
Message-ID<lgck0f$104$1@dont-email.me>
In reply to#42004
On 3/19/2014 4:35 AM, Terence wrote:
>> We still have hundreds of thousands of lines of
>> F66 code in our app.  I wish most of the gotos
>> would just go away.  I rip a few out whenever I
>> get a chance but the risk of creating new bugs
>> is very high.
>>
>> Lynn
>
> I repeat, just use a simple tool.
> One option is to use Alan Miller's code to go straight to F90.
> There are others.
> But you are in the unique position of being able to retest at any step into
> which you break the project up.

We are very slowly moving our kernel calculation
code to C++.  Very, very slowly.

Lynn

[toc] | [prev] | [next] | [standalone]


#41672

FromKaz Kylheku <kaz@kylheku.com>
Date2014-03-12 16:47 +0000
Message-ID<20140312092435.214@kylheku.com>
In reply to#41668
On 2014-03-12, Lynn McGuire <lmc@winsim.com> wrote:
> Is goto Still Considered Harmful?
>  
> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-harmful/240166595

It never was. 

Remember, Dijkstra wasn't an actual developer.  He never worked on any software
project of consequence.  (Oh, pardon me, the THE system.)

He also invented semaphores, which are the worst synchronization primitive
ever: and, ironicaly, can be considered to be "the goto of synchronization".

Just like, if we have gotos (in particular backward gotos), it is hard to
answer the question "by what sequence of computations did the instruction pointer
arrive at this location?" with semaphores it is hard to answer the question "by
what sequence of operations did this semaphore come to have this particular
counter value?" It is hard to prove the correctness of algorithms based
on semaphores.

Other than semaphores, Dijstra was known for his rant about goto, and a few
obvious algorithms, like graph traversals that any decent hacker can work out
as a matter of coding and debugging at the terminal.

GOTO is very useful in programming languages that support meta-programming.
Even if you don't write software which has visible uses of goto, your
meta-programming constructs can take advantage of it in their code generation.

All structured control flow constructs compile to test-and-branch type stuff.

A large block with a nest of gotos going every which way is the most efficient
way to compile state machines, or at least certain ones.

Here is the thing: both goto and destructive manipulation of data are symptoms
of imperative programming. They are flip-sides of the same thing.

If anything is harmful, it is destructive programming.

This is what semaphores and goto have in common: manipulation of state.

Even if you don't have in your imperative program, or any selection statement,
there is an implicit goto: the goto which makes the currently executed location
move to the next statement!

In a purely functional language, there is no such thing. The only reason you
ever have a construction like { S1; S2; return S3; } is that S1 and S2 have side
effects. Since are not capturing the value produced by S1 and S2 (if any!) the
only reason to evaluate them is that they modify something, do I/O, or both.

The action which makes S1 flow to S2 is a kind of built-in goto, and that's
part of the essence of what makes it imperative programming. 

In imperative programming there is a tradeoff between goto and state variables.
By using goto, you can eliminate state variables, and conversely when you
eliminate goto, you may have to introduce state variables.

But state variables are just goto in disguise. For instance if in a state
machine you have

  for (;;) {
    switch (state) {
    /* numerous cases */
    }
  }

and those cases make an assignment to the state variable, that assignment is
really a goto.  When the switch bails out and the loop makes another round, the
value of state will arbitrarily guide the switch statement to a completely
different case from the previous iteration.  This is just a circular way of
doing a "goto" from one case to the other, directly.

The state variable is a de-facto instruction pointer.

At the machine level, the instruction pointer is just a variable. In some
cases, just another general-purpose register that can be used like any other.
E.g. R31 or whatever, with the pseudonym PC in assembly-language, 
and "JMP X" being an assembly language pseudo-op for "MOVE R31, X".

Clobbering a value in place is the "harmful" thing (but not really); goto is
just a scapegoat blamed by imbeciles.

If you think destructive manipulation of state is harmful, that pretty much
rules out C and anything like it, all together. You need a totally different
kind of language. It is not a pragmatic viewpoint, in any case.

If you embrace imperative programming, you're embracing goto.

[toc] | [prev] | [next] | [standalone]


#41674

FromJos Bergervoet <jos.bergervoet@xs4all.nl>
Date2014-03-12 19:07 +0100
Message-ID<5320a27f$0$2944$e4fe514c@news2.news.xs4all.nl>
In reply to#41672
On 3/12/2014 5:47 PM, Kaz Kylheku wrote:
> On 2014-03-12, Lynn McGuire<lmc@winsim.com>  wrote:
>> Is goto Still Considered Harmful?
>>
>> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-harmful/240166595
>
> It never was.

In your dreams, perhaps.

   ...
> A large block with a nest of gotos going every which way is the most efficient
> way to compile state machines, or at least certain ones.

So gotos are efficient in machine code, but the
discussion wasn't about efficient machine code.

  ...
> If you embrace imperative programming, you're embracing goto.

No, you can still avoid them completely (although
there's no need to goto such an extreme effort..)
And of course keeping things functional will always
pay off!

-- 
Jos

[toc] | [prev] | [next] | [standalone]


#41701

FromAndrew Cooper <root@127.0.0.1>
Date2014-03-12 23:36 +0000
Message-ID<Jb6Uu.113861$ih1.5038@fx09.am4>
In reply to#41674
On 12/03/2014 18:07, Jos Bergervoet wrote:
> On 3/12/2014 5:47 PM, Kaz Kylheku wrote:
>> On 2014-03-12, Lynn McGuire<lmc@winsim.com>  wrote:
>>> Is goto Still Considered Harmful?
>>>
>>> http://www.drdobbs.com/architecture-and-design/is-goto-still-considered-harmful/240166595
>>>
>>
>> It never was.
> 
> In your dreams, perhaps.

Only in your narrow view of the world then...

> 
>   ...
>> A large block with a nest of gotos going every which way is the most
>> efficient
>> way to compile state machines, or at least certain ones.
> 
> So gotos are efficient in machine code, but the
> discussion wasn't about efficient machine code.


gotos are about all you have in most machine languages.  And it is
always more efficient not to use them; branch predictors aren't perfect.

> 
>  ...
>> If you embrace imperative programming, you're embracing goto.
> 
> No, you can still avoid them completely (although
> there's no need to goto such an extreme effort..)
> And of course keeping things functional will always
> pay off!
> 

You could avoid them completely, at the expense of code clarity.

As far as I am concerned, you can pry goto from my cold dead hands.  As
an operating system developer, there are *many* cases where goto is the
correct, and only sensible way, of structuring functions in such a way
as to be clear to read, and easy to reason regarding correctness.

~Andrew

[toc] | [prev] | [next] | [standalone]


#41706

FromKaz Kylheku <kaz@kylheku.com>
Date2014-03-13 00:23 +0000
Message-ID<20140312172142.849@kylheku.com>
In reply to#41701
On 2014-03-12, Andrew Cooper <root@127.0.0.1> wrote:
> On 12/03/2014 18:07, Jos Bergervoet wrote:
>> So gotos are efficient in machine code, but the
>> discussion wasn't about efficient machine code.
>
>
> gotos are about all you have in most machine languages.  And it is
> always more efficient not to use them; branch predictors aren't perfect.

Not always. There exist these things called unconditional branches,
which are 100% taken. Wink!

[toc] | [prev] | [next] | [standalone]


#41711

FromAndrew Cooper <root@127.0.0.1>
Date2014-03-13 01:18 +0000
Message-ID<lH7Uu.65317$NB6.64749@fx35.am4>
In reply to#41706
On 13/03/2014 00:23, Kaz Kylheku wrote:
> On 2014-03-12, Andrew Cooper <root@127.0.0.1> wrote:
>> On 12/03/2014 18:07, Jos Bergervoet wrote:
>>> So gotos are efficient in machine code, but the
>>> discussion wasn't about efficient machine code.
>>
>>
>> gotos are about all you have in most machine languages.  And it is
>> always more efficient not to use them; branch predictors aren't perfect.
> 
> Not always. There exist these things called unconditional branches,
> which are 100% taken. Wink!
> 

That's all well and good, and of very little help.

The purpose of a branch predictor is not to identify whether a specific
branch is taken or not.  The purpose of a branch predictor is to feed
the most likely new instruction pointer back into the instruction fetch,
which also involves making a guess as to whether the branch is going to.

But this is dangerously off topic...

~Andrew

[toc] | [prev] | [next] | [standalone]


#41714

FromKaz Kylheku <kaz@kylheku.com>
Date2014-03-13 02:08 +0000
Message-ID<20140312190657.863@kylheku.com>
In reply to#41711
On 2014-03-13, Andrew Cooper <root@127.0.0.1> wrote:
> On 13/03/2014 00:23, Kaz Kylheku wrote:
>> On 2014-03-12, Andrew Cooper <root@127.0.0.1> wrote:
>>> On 12/03/2014 18:07, Jos Bergervoet wrote:
>>>> So gotos are efficient in machine code, but the
>>>> discussion wasn't about efficient machine code.
>>>
>>>
>>> gotos are about all you have in most machine languages.  And it is
>>> always more efficient not to use them; branch predictors aren't perfect.
>> 
>> Not always. There exist these things called unconditional branches,
>> which are 100% taken. Wink!
>> 
>
> That's all well and good, and of very little help.
>
> The purpose of a branch predictor is not to identify whether a specific
> branch is taken or not.  The purpose of a branch predictor is to feed
> the most likely new instruction pointer back into the instruction fetch,
> which also involves making a guess as to whether the branch is going to.

And the 100% likely instruction following an unconditional branch is ...

[toc] | [prev] | [next] | [standalone]


#41715

FromAndrew Cooper <root@127.0.0.1>
Date2014-03-13 02:21 +0000
Message-ID<nC8Uu.76524$0r2.23380@fx01.am4>
In reply to#41714
On 13/03/2014 02:08, Kaz Kylheku wrote:
> On 2014-03-13, Andrew Cooper <root@127.0.0.1> wrote:
>> On 13/03/2014 00:23, Kaz Kylheku wrote:
>>> On 2014-03-12, Andrew Cooper <root@127.0.0.1> wrote:
>>>> On 12/03/2014 18:07, Jos Bergervoet wrote:
>>>>> So gotos are efficient in machine code, but the
>>>>> discussion wasn't about efficient machine code.
>>>>
>>>>
>>>> gotos are about all you have in most machine languages.  And it is
>>>> always more efficient not to use them; branch predictors aren't perfect.
>>>
>>> Not always. There exist these things called unconditional branches,
>>> which are 100% taken. Wink!
>>>
>>
>> That's all well and good, and of very little help.
>>
>> The purpose of a branch predictor is not to identify whether a specific
>> branch is taken or not.  The purpose of a branch predictor is to feed
>> the most likely new instruction pointer back into the instruction fetch,
>> which also involves making a guess as to whether the branch is going to.
> 
> And the 100% likely instruction following an unconditional branch is ...
> 

How do you expect the knowledge that a branch is certainly taken to help
you know where the branch goes to?

[toc] | [prev] | [next] | [standalone]


#41730

FromDavid Brown <david.brown@hesbynett.no>
Date2014-03-13 11:17 +0100
Message-ID<lfs0k9$95p$1@dont-email.me>
In reply to#41714
On 13/03/14 03:08, Kaz Kylheku wrote:
> On 2014-03-13, Andrew Cooper <root@127.0.0.1> wrote:
>> On 13/03/2014 00:23, Kaz Kylheku wrote:
>>> On 2014-03-12, Andrew Cooper <root@127.0.0.1> wrote:
>>>> On 12/03/2014 18:07, Jos Bergervoet wrote:
>>>>> So gotos are efficient in machine code, but the
>>>>> discussion wasn't about efficient machine code.
>>>>
>>>>
>>>> gotos are about all you have in most machine languages.  And it is
>>>> always more efficient not to use them; branch predictors aren't perfect.
>>>
>>> Not always. There exist these things called unconditional branches,
>>> which are 100% taken. Wink!
>>>
>>
>> That's all well and good, and of very little help.
>>
>> The purpose of a branch predictor is not to identify whether a specific
>> branch is taken or not.  The purpose of a branch predictor is to feed
>> the most likely new instruction pointer back into the instruction fetch,
>> which also involves making a guess as to whether the branch is going to.
> 
> And the 100% likely instruction following an unconditional branch is ...
> 

You are missing the point.  Modern cpus pre-fetch instructions before
they are executed - the branch predictor is part of that, as it
determines which instructions to pre-fetch.  By default, the system will
pre-fetch instructions at increasing address - an unconditional branch
breaks that flow and means the pre-fetcher must change course.  So while
an unconditional branch will never be mis-predicted, it still needs to
be predicted and handled by the branch predictor, the branch target
buffer, and the pre-fetch buffer.

(Exact names of these parts, and how they are split up, will of course
vary between processor implementations - but I hope you get the idea.)

[toc] | [prev] | [next] | [standalone]


Page 1 of 8  [1] 2 3 4 5 6 7 8  Next page →

Back to top | Article view | comp.lang.c


csiph-web