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


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

Taming The Switch-Statement

Started byLawrence D’Oliveiro <ldo@nz.invalid>
First post2026-10-03 08:43 +0000
Last post2026-10-13 23:19 +0100
Articles 20 on this page of 327 — 21 participants

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


Contents

  Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-03 08:43 +0000
    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-03 11:24 +0100
      Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-05 22:15 +0000
    Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-03 14:22 +0200
    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-03 18:02 +0200
      Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-04 00:24 +0800
      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-03 17:36 +0100
        Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-03 16:31 -0700
          Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-04 10:23 +0200
          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-04 12:18 +0100
          Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-04 16:20 +0200
            Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-05 21:34 +0000
              Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-06 16:04 -0700
        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-04 16:18 +0200
          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-04 16:09 +0100
            Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-04 16:59 +0000
              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-04 18:30 +0100
                Re: Taming The Switch-Statement Richard Harnden <richard.nospam@gmail.invalid> - 2026-10-04 19:49 +0100
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-04 20:35 +0100
                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-04 22:27 +0200
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-04 22:47 +0100
                  Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-04 21:59 +0000
        Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-04 23:38 +0000
          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-05 01:24 +0100
            Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-05 21:48 +0000
              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-06 00:11 +0100
                Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 09:49 +0200
                  Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 11:12 +0200
                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 12:41 +0200
                      Re: Taming The Switch-Statement Richard Harnden <richard.nospam@gmail.invalid> - 2026-10-06 12:33 +0100
                        Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-06 15:16 +0100
                          Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-06 14:37 +0000
                            Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-06 17:27 +0100
                              Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-06 23:14 +0000
                                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 01:25 +0100
                                  Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-07 04:19 +0000
                                    Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-07 06:28 +0000
                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 11:39 +0100
                                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 12:57 +0200
                                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 11:32 +0100
                                      Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-07 15:10 +0000
                                        Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 19:41 +0100
                                          Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-08 04:49 +0000
                                            Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-08 12:24 +0100
                                  Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 09:07 +0200
                                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 11:49 +0100
                                      Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 13:11 +0200
                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 16:17 +0200
                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-06 15:32 +0100
                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 17:25 +0200
                          Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-06 14:39 +0000
                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 19:48 +0200
                              Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-06 18:12 +0000
                                [OT] substances (was Re: Taming The Switch-Statement) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 21:50 +0200
                                Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-06 17:06 -0700
                      Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 19:25 +0200
                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 10:28 +0200
                          Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-07 15:16 +0200
                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 16:40 +0200
                            Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-08 07:24 -0700
                      Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-06 16:08 -0700
                        Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-06 23:45 +0000
                          Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-06 17:08 -0700
                          Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-07 10:35 +0200
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-06 12:33 +0100
                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 17:16 +0200
                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-06 16:41 -0700
                Re: Taming The Switch-Statement tTh <tth@none.invalid> - 2026-10-06 12:14 +0200
                  Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 12:43 +0200
                Re: Taming The Switch-Statement Jim Jackson <jj@franjam.org.uk> - 2026-10-06 11:47 +0000
                Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-06 16:05 -0700
                Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-07 00:42 +0000
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 13:52 +0100
                    Re: Taming The Switch-Statement "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-10-07 14:06 -0700
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-07 23:31 +0100
        Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-05 21:32 +0000
          Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-06 06:07 +0800
          Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-05 16:42 -0700
            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-05 18:05 -0700
              Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 09:04 +0200
                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-06 04:11 -0700
                  Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-06 21:40 +0200
                  Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-16 13:12 -0700
              Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-06 00:59 -0700
                Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-06 08:16 +0000
                  Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-06 04:21 -0700
              Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-16 04:46 -0700
            Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-06 14:43 +0000
              Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-06 17:36 +0200
        Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-06 20:36 -0700
    Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-04 00:20 +0800
    Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-04 09:05 -0700
      Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-04 23:44 +0000
        Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-05 01:46 +0100
          Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-04 20:48 -0700
            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-05 06:24 +0200
          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-05 11:09 +0100
          Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-06 05:22 +0800
            Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-06 05:26 +0800
    Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-10 00:25 +0000
      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 01:58 +0100
        Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-09 19:17 -0700
          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 11:53 +0100
            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 14:01 +0200
              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 14:11 +0100
                Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-10 21:34 +0800
                  Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-10 21:58 +0800
                Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-10 17:50 +0200
                  Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-11 05:52 +0000
                    Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-11 21:16 +0000
                      Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-11 23:38 +0000
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 11:58 +0100
                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-11 14:42 +0200
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 14:39 +0100
                        Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-11 15:35 -0700
                    Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-11 14:42 +0000
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 17:23 +0100
                        Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-11 17:48 +0000
                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 19:10 +0100
                            Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-12 07:01 +0000
                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 16:41 +0100
                Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 20:08 +0200
                  Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-10 22:02 +0300
                    Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-10 19:03 +0000
                      Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-10 22:29 +0300
                    Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 21:55 +0200
                      Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-10 23:03 +0300
                        Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 22:33 +0200
                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 21:53 +0100
                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 23:16 +0200
                            Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-11 15:29 +0000
                          Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-10 15:30 -0700
                            Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-10 22:58 +0000
                              Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-11 09:09 +0800
                                Re: Taming The Switch-Statement ram@zedat.fu-berlin.de (Stefan Ram) - 2026-10-11 10:14 +0000
                                  Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-11 21:12 +0000
                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 03:58 +0200
                          Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 15:32 -0700
                            Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-11 01:58 +0300
                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 01:43 +0100
                            Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-11 09:12 +0800
                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 04:07 +0200
                              Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 20:13 -0700
                                Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 10:36 +0200
                                Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-16 14:22 -0700
                                  Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-16 15:00 -0700
                                    Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-17 01:29 +0200
                                    Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-17 19:39 +0300
                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-17 18:23 +0100
                                        Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-17 17:36 +0000
                                        Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-17 21:03 +0300
                                    Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-17 10:30 -0700
                                      Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-17 10:54 -0700
                        Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-11 04:26 -0700
                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 13:35 +0100
                            Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-11 06:13 -0700
                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 14:51 +0100
                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-11 15:33 +0200
                              Re: Taming The Switch-Statement Andrey Tarasevich <noone@noone.net> - 2026-10-11 09:01 -0700
                                Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-11 19:17 +0200
                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 18:57 +0100
                                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-11 14:28 -0700
                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 23:02 +0100
                                        Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-11 16:29 -0700
                                      Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-12 04:03 -0700
                                      Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-12 22:02 +0300
                                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 21:09 +0200
                                          Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-12 22:31 +0300
                                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-12 22:32 +0200
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 22:05 +0100
                                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 23:14 +0200
                                            Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-13 07:23 +0000
                                              Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-13 12:12 +0200
                                                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 11:26 +0100
                                                  Re: Taming The Switch-Statement Richard Harnden <richard.nospam@gmail.invalid> - 2026-10-13 12:10 +0100
                                                    Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-13 06:55 -0700
                                                  Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-13 13:33 +0200
                                                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 13:41 +0100
                                                      Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-13 14:38 +0000
                                                        Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-13 18:04 +0200
                                                          Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-13 20:52 +0000
                                                            Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 22:24 +0100
                                                            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-14 00:03 +0200
                                                              Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 10:53 +0000
                                                                Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-14 17:54 +0200
                                                                  Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 19:48 +0000
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 11:16 +0100
                                              Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-13 21:54 +0000
                                                Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-16 15:24 +0000
                                                  Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-16 21:42 +0000
                                                    Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-16 21:46 +0000
                                                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-16 15:03 -0700
                                            Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-13 07:40 -0700
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 16:46 +0100
                                                Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-13 09:10 -0700
                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 18:15 +0100
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-13 18:27 -0700
                                                  Re: Taming The Switch-Statement gazelle@shell.xmission.com (Kenny McCormack) - 2026-10-14 01:50 +0000
                                                    Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 10:58 +0000
                                              Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-13 22:54 +0300
                                                Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-13 16:45 -0700
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-13 18:34 -0700
                                                Re: Taming The Switch-Statement Kaz Kylheku <046-301-5902@kylheku.com> - 2026-10-14 05:17 +0000
                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 13:46 +0100
                                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 07:05 +0200
                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 14:37 +0100
                                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 16:12 +0200
                                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 16:32 +0100
                                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 19:05 +0200
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 19:15 +0100
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 16:43 -0700
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 16:45 -0700
                                                  Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 23:46 +0000
                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 00:56 +0100
                                        Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 17:58 +0000
                                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 20:38 +0100
                                            Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 19:52 +0000
                                              Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-12 22:56 +0200
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 21:57 +0100
                                                Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 21:21 +0000
                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 22:46 +0100
                                                    Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-13 09:27 +0200
                                                      Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-13 12:18 +0200
                                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 11:33 +0100
                                                Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-13 00:25 +0300
                                            Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 22:20 +0000
                                            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 17:02 -0700
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 01:53 +0100
                                              Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-13 03:54 +0200
                                              Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-13 10:52 +0000
                                                Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-13 23:16 +0300
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-13 18:44 -0700
                                            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 17:33 -0700
                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 00:21 +0100
                                                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-13 20:40 -0700
                                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 03:59 +0000
                                                  Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-13 21:35 -0700
                                                    Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 11:27 +0000
                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 12:17 +0100
                                                    Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 12:38 +0000
                                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 16:49 +0100
                                                        Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 19:30 +0000
                                                          Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-14 23:28 +0300
                                                            Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-14 21:30 -0700
                                                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 21:56 +0100
                                                            Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 21:59 +0100
                                                            Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-15 01:26 +0000
                                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-15 12:01 +0100
                                                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-15 11:45 +0000
                                                                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-15 15:57 +0100
                                                                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-15 18:10 +0100
                                                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-16 02:42 +0100
                                                                    Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-15 20:42 +0000
                                                                      Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-15 23:57 +0300
                                                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-15 23:22 +0100
                                                                        Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-16 12:40 +0000
                                                                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-17 00:01 +0100
                                                                            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-16 16:53 -0700
                                                                              Re: Taming The Switch-Statement gazelle@shell.xmission.com (Kenny McCormack) - 2026-10-17 11:09 +0000
                                                                                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-17 13:11 +0100
                                                                                Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-17 15:15 +0200
                                                                              Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-17 08:34 -0700
                                                                            Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-17 03:19 +0000
                                                                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-17 12:34 +0100
                                                                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-17 17:58 +0000
                                                              Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-15 05:17 -0700
                                                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-15 14:37 +0000
                                                                  Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-15 20:50 +0200
                                                                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-15 19:59 +0100
                                                                  Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-15 20:49 +0000
                                                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-14 18:51 +0100
                                                        Re: Taming The Switch-Statement "Peyton" <peyton@solacium.com> - 2026-10-14 11:04 -0700
                                                        Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-14 19:47 +0000
                                                        Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-14 13:58 -0700
                                                          Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-15 12:08 +0200
                                                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-14 14:23 -0700
                                                Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-14 14:35 +0000
                                Re: Taming The Switch-Statement Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-10-16 03:36 -0700
                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 16:38 -0700
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 21:09 +0100
                    Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 23:14 +0200
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-10 23:01 +0100
                      Re: Taming The Switch-Statement antispam@fricas.org (Waldek Hebisch) - 2026-10-11 08:00 +0000
                        Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 10:27 +0200
                          Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 10:49 +0200
            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 16:30 -0700
              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 02:12 +0100
                Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 19:55 -0700
                  Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 11:00 +0200
                  Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 12:21 +0100
                    Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-11 14:04 -0700
                      Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 23:05 +0100
                        Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 07:22 +0200
                          Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 11:42 +0100
                            Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-12 16:15 +0200
                            Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 14:34 +0000
                              Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 16:47 +0100
                                Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-13 00:15 +0800
                                  Re: Taming The Switch-Statement ram@zedat.fu-berlin.de (Stefan Ram) - 2026-10-12 17:02 +0000
                                    Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-13 20:04 +0800
                                      Re: Taming The Switch-Statement ram@zedat.fu-berlin.de (Stefan Ram) - 2026-10-13 17:28 +0000
                                        Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-14 02:05 +0800
                                Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 17:17 +0000
                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 17:37 +0000
                            Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 17:34 +0000
                              Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 18:46 +0000
                                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-12 19:52 +0100
                                  Re: Taming The Switch-Statement scott@slp53.sl.home (Scott Lurndal) - 2026-10-12 19:42 +0000
                                  Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 16:29 -0700
                                    Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 00:53 +0100
                                      Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 18:14 -0700
                                Re: Taming The Switch-Statement cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 22:35 +0000
                            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-12 16:14 -0700
                Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-11 22:36 +0100
          Re: Taming The Switch-Statement gazelle@shell.xmission.com (Kenny McCormack) - 2026-10-10 13:14 +0000
          Re: Taming The Switch-Statement Michael S <already5chosen@yahoo.com> - 2026-10-10 19:50 +0300
            Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-10 20:13 +0200
              Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 15:54 -0700
                Re: Taming The Switch-Statement Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-10-11 03:41 +0200
                  Re: Taming The Switch-Statement Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-11 09:51 +0800
                  Re: Taming The Switch-Statement David Brown <david.brown@hesbynett.no> - 2026-10-11 11:41 +0200
            Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 16:44 -0700
          Re: Taming The Switch-Statement Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-10-10 16:56 -0700
      Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-11 21:26 +0000
        Re: Taming The Switch-Statement Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-10-11 22:12 +0000
      Re: Taming The Switch-Statement Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-13 22:00 +0000
        Re: Taming The Switch-Statement bart <bc@freeuk.com> - 2026-10-13 23:19 +0100

Page 8 of 17 — ← Prev page 1 … 6 7 [8] 9 10 … 17  Next page →


#402929

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-10-11 09:12 +0800
Message-ID<XnByS.11179$mPXe.6097@fx06.ams4>
In reply to#402919
On 10/11/2026 6:32 AM, Keith Thompson wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>> On 2026-10-10 22:03, Michael S wrote:
>>> The cases where I want to break out of the loop from the switch in
>>> the
>>> body of the loop are very common.
>>
>> Ah, so you'd have needed something like Kornshell's 'break 2' to leave
>> more than one level. - I suppose, you needed to used a 'goto' instead
>> (and avoid the 'break' completely for those cases).
> 
> Something like that, sure, but please not that.
> 
> Specifying the *number* of levels to break or continue is IMHO
> horrible.  "break N" makes me count things so the computer doesn't
> have to.
> 
> There are proposals, and precedents in other languages, for *named*
> loops, and I'd like to see that in a future C.
> 

What's wrong with labels?  We already have that.  You can name your
loops like this,

   foo: while ( bar ) {
     /* ... */
     for ( int i = 0 ; i < 10 ; i++ ) {
       /* ... */
       goto foo ;
     }
     /* ... */
   }

and do all kinds of control structures with just C89.  So, why would you
personally need named loops?  Can't you code C at all?


Best wishes, and happy named loops!
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

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


#402936

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-10-11 04:07 +0200
Message-ID<11aer17$286ml$2@dont-email.me>
In reply to#402919
On 2026-10-11 00:32, Keith Thompson wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>> On 2026-10-10 22:03, Michael S wrote:
>>> The cases where I want to break out of the loop from the switch in
>>> the
>>> body of the loop are very common.
>>
>> Ah, so you'd have needed something like Kornshell's 'break 2' to leave
>> more than one level. - I suppose, you needed to used a 'goto' instead
>> (and avoid the 'break' completely for those cases).
> 
> Something like that, sure, but please not that.
> 
> Specifying the *number* of levels to break or continue is IMHO
> horrible.  "break N" makes me count things so the computer doesn't
> have to.

I agree; that's what I also dislike about it.

The point is the question what choices you have. The 'goto' is IMO
the worst; because of semantic interdependencies that will regularly
lead to semantical restrictions about its applicability (or placement
of labels); various languages have various restrictions, it's just
a mess! The 'break' is a "cheap" solution, but also very restricted.
There's yet other variants with their own drawbacks; I won't even
start with it.

> 
> There are proposals, and precedents in other languages, for *named*
> loops, and I'd like to see that in a future C.

One of the better possibilities, maybe; but still not satisfying for
my (very subjective) taste.

(Some language let you organize such things in completely other ways
with no need for jumps of any sort.)

Janis

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


#402938

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-10-10 20:13 -0700
Message-ID<11aeusp$29hmu$2@kst.eternal-september.org>
In reply to#402936
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 2026-10-11 00:32, Keith Thompson wrote:
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>> On 2026-10-10 22:03, Michael S wrote:
>>>> The cases where I want to break out of the loop from the switch in
>>>> the
>>>> body of the loop are very common.
>>>
>>> Ah, so you'd have needed something like Kornshell's 'break 2' to leave
>>> more than one level. - I suppose, you needed to used a 'goto' instead
>>> (and avoid the 'break' completely for those cases).
>> Something like that, sure, but please not that.
>> Specifying the *number* of levels to break or continue is IMHO
>> horrible.  "break N" makes me count things so the computer doesn't
>> have to.
>
> I agree; that's what I also dislike about it.
>
> The point is the question what choices you have. The 'goto' is IMO
> the worst; because of semantic interdependencies that will regularly
> lead to semantical restrictions about its applicability (or placement
> of labels); various languages have various restrictions, it's just
> a mess! The 'break' is a "cheap" solution, but also very restricted.
> There's yet other variants with their own drawbacks; I won't even
> start with it.
>
>> There are proposals, and precedents in other languages, for *named*
>> loops, and I'd like to see that in a future C.
>
> One of the better possibilities, maybe; but still not satisfying for
> my (very subjective) taste.
>
> (Some language let you organize such things in completely other ways
> with no need for jumps of any sort.)

I find "break NAME;", where "NAME" is the name of an enclosing
construct, unambiguously better than "break N;", where N is the
number of levels to break out of.

The "break N" syntax is specified by POSIX.  It's supported by ksh,
bash, dash, zsh, and probably other Bourne-based shells.  (My guess
is that it originated in ksh.)  My best guess is that because the
Bourne-like shells don't have gotos, they don't have labels, so
named loops would have required inventing those too.  And admittedly
I suppose it's not too bad if it's no more than a couple of levels --
but it's still easy to, ahem, *break* if you reorganize the code.

There's a proposal for C2y to use goto labels as loop names, and a
competing one to define a new syntax like "for NAME (;;)" :

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

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


#402953

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-10-11 10:36 +0200
Message-ID<11afhr4$286ml$3@dont-email.me>
In reply to#402938
On 2026-10-11 05:13, Keith Thompson wrote:
> 
> I find "break NAME;", where "NAME" is the name of an enclosing
> construct, unambiguously better than "break N;", where N is the
> number of levels to break out of.

Yes, sure.

(Reminds me Pascal that supported for 'goto' just integer numbers
[in the range 1..9999, IIRC] for jumps. - This is different from
'break N' but still also a bad design, IMO. - Not sure about later
Pascal dialects, though. - Numbers for labels or levels, not nice.)

> 
> The "break N" syntax is specified by POSIX.  It's supported by ksh,
> bash, dash, zsh, and probably other Bourne-based shells.  (My guess
> is that it originated in ksh.)  My best guess is that because the
> Bourne-like shells don't have gotos, they don't have labels, so
> named loops would have required inventing those too.  And admittedly
> I suppose it's not too bad if it's no more than a couple of levels --
> but it's still easy to, ahem, *break* if you reorganize the code.

Yes. - But while I don't find it (the N) elegant as concept it's
in practice not that bad WRT "reorganization of code" since it's
(as opposed to the 'goto' in other languages) a local construct.

Janis

> [...]

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


#403221

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-10-16 14:22 -0700
Message-ID<86mrsdpcgp.fsf@linuxsc.com>
In reply to#402938
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> I find "break NAME;", where "NAME" is the name of an enclosing
> construct, unambiguously better than "break N;", where N is the
> number of levels to break out of. [...]

Definitely.

> There's a proposal for C2y to use goto labels as loop names, and a
> competing one to define a new syntax like "for NAME (;;)" :
>
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf

I'm not particularly a fan of multi-level break/continue.  But if
we're going to have one of these, the second ("for NAME (;;)") is
unquestionably better.

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


#403224

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-10-16 15:00 -0700
Message-ID<11au6pr$3mdne$1@kst.eternal-september.org>
In reply to#403221
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> I find "break NAME;", where "NAME" is the name of an enclosing
>> construct, unambiguously better than "break N;", where N is the
>> number of levels to break out of. [...]
>
> Definitely.
>
>> There's a proposal for C2y to use goto labels as loop names, and a
>> competing one to define a new syntax like "for NAME (;;)" :
>>
>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
>
> I'm not particularly a fan of multi-level break/continue.  But if
> we're going to have one of these, the second ("for NAME (;;)") is
> unquestionably better.

Unquestionably?  Why?

I do like the fact that it doesn't conflate goto labels with loop
names, but I still prefer the "NAME: for (;;)" form, partly because
it's consistent with several other languages.

One minor drawback, IMHO, is that the name is easier to miss, because
it's not at the beginning of the line.  This is based on zero experience
using it.

(The same problem exists with function names.  Personally, I just
tolerate that rather than using the common convention of splitting the
return type and function name across two lines.  I think I would have
preferred a syntax that puts the function name first, but I wouldn't
suggest changing it.  I mildly dislike the convention of writing
    int
    func(void)
for reasons that are vague enough that I won't go into them.)

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

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


#403229

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-10-17 01:29 +0200
Message-ID<11auc0s$206gh$3@dont-email.me>
In reply to#403224
On 2026-10-17 00:00, Keith Thompson wrote:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>[...]
>>> There's a proposal for C2y to use goto labels as loop names, and a
>>> competing one to define a new syntax like "for NAME (;;)" :
>>> [...]
>>
>> I'm not particularly a fan of multi-level break/continue.  But if
>> we're going to have one of these, the second ("for NAME (;;)") is
>> unquestionably better.
> 
> Unquestionably?  Why?

Why would one question an opinion? ;-)

> 
> I do like the fact that it doesn't conflate goto labels with loop
> names, but I still prefer the "NAME: for (;;)" form, partly because
> it's consistent with several other languages.

I've no strong opinion on that, but I find the "for NAME (;;)" to
clearer express the _local scope_ of embedded breaks or continues.
(Just a matter of taste, and my appreciation for locality.)

> 
> One minor drawback, IMHO, is that the name is easier to miss, because
> it's not at the beginning of the line.  This is based on zero experience
> using it.

If that sort of jump would be _restricted_ to the respective loop
then I'd not see how I'd miss that since it's closely placed. (It
might also help if, as shown above, some all-caps convention would
be applied to labels.)

> 
> (The same problem exists with function names.  Personally, I just
> tolerate that rather than using the common convention of splitting the
> return type and function name across two lines.  I think I would have
> preferred a syntax that puts the function name first, but I wouldn't
> suggest changing it.  I mildly dislike the convention of writing
>      int
>      func(void)
> for reasons that are vague enough that I won't go into them.)

Well, there were both variants, the Algol 60 "integer procedure"
and the Algol 68 "(...) INT :" (or Pascal's syntax equivalent with
a 'function' keyword, similarly, but with another syntax, in Awk).
But there's more syntactic factors that influence where the name is
located, so many variants are existing. (But we're anyway talking
just about "C", so it's all void, whatever personal preferences.)

The point with the separation of two lines is a question distinct
from the choice, unless we'd choose a syntactic variant of the two
forms, specifically "fname (parms) res_t" (i.e. without keyword).

As far as I recall, in "C", the name of the function was often put
separately (first in the line) to have an easy method to find its
declaration by simple "grep ^fname". (With any sophisticated editor
this might be a weak argument, though.)

Janis

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


#403239

FromMichael S <already5chosen@yahoo.com>
Date2026-10-17 19:39 +0300
Message-ID<20261017193908.00000106@yahoo.com>
In reply to#403224
On Fri, 16 Oct 2026 15:00:27 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> > Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:  
> >> I find "break NAME;", where "NAME" is the name of an enclosing
> >> construct, unambiguously better than "break N;", where N is the
> >> number of levels to break out of. [...]  
> >
> > Definitely.
> >  
> >> There's a proposal for C2y to use goto labels as loop names, and a
> >> competing one to define a new syntax like "for NAME (;;)" :
> >>
> >> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
> >> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf  
> >
> > I'm not particularly a fan of multi-level break/continue.  But if
> > we're going to have one of these, the second ("for NAME (;;)") is
> > unquestionably better.  
> 
> Unquestionably?  Why?
> 

I don't know why Tim prefers it.
I prefer it (strongly) because it is different from regular label. So
reader that wants to understand a flow of the program should not be
concerned with possibility of jumping to it from places outside for().

> I do like the fact that it doesn't conflate goto labels with loop
> names, but I still prefer the "NAME: for (;;)" form, partly because
> it's consistent with several other languages.
>

You mentioned itself that in Ada loop labels are distinct from regular
labels. I would think that Ada alone easily outweighs "several other
languages" if we compare by number (and likely by quality) of man-hours
invested into thinking and discussion of syntactic features.
Anyway I value appeal to success more than appeal to authority so by my
own standards the argument above is weak.

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


#403240

Frombart <bc@freeuk.com>
Date2026-10-17 18:23 +0100
Message-ID<11b0av3$edsd$1@dont-email.me>
In reply to#403239
On 17/10/2026 17:39, Michael S wrote:
> On Fri, 16 Oct 2026 15:00:27 -0700
> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> 
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>> I find "break NAME;", where "NAME" is the name of an enclosing
>>>> construct, unambiguously better than "break N;", where N is the
>>>> number of levels to break out of. [...]
>>>
>>> Definitely.
>>>   
>>>> There's a proposal for C2y to use goto labels as loop names, and a
>>>> competing one to define a new syntax like "for NAME (;;)" :
>>>>
>>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
>>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
>>>
>>> I'm not particularly a fan of multi-level break/continue.  But if
>>> we're going to have one of these, the second ("for NAME (;;)") is
>>> unquestionably better.
>>
>> Unquestionably?  Why?
>>
> 
> I don't know why Tim prefers it.
> I prefer it (strongly) because it is different from regular label. So
> reader that wants to understand a flow of the program should not be
> concerned with possibility of jumping to it from places outside for().
> 
>> I do like the fact that it doesn't conflate goto labels with loop
>> names, but I still prefer the "NAME: for (;;)" form, partly because
>> it's consistent with several other languages.
>>
> 
> You mentioned itself that in Ada loop labels are distinct from regular
> labels. I would think that Ada alone easily outweighs "several other
> languages" if we compare by number (and likely by quality) of man-hours
> invested into thinking and discussion of syntactic features.
> Anyway I value appeal to success more than appeal to authority so by my
> own standards the argument above is weak.

I was around when Ada was being developed and refined, a process that 
took years.

By contrast, C looks like it was just thrown together with little 
thought, and probably that is exactly what happened.

In the end, Ada was a language that you could admire, but you'd rather 
other people used. It's a solid language but I found it too formal and 
rather dull (not that it was available for me to use).

Still, I borrowed some syntactic features from it.

One interesting fact that people might forget is that it was 
case-insensitive, a welcome difference IMV.



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


#403242

Fromcross@spitfire.i.gajendra.net (Dan Cross)
Date2026-10-17 17:36 +0000
Message-ID<11b0bn8$cq8$1@reader2.panix.com>
In reply to#403240
In article <11b0av3$edsd$1@dont-email.me>, bart  <bc@freeuk.com> wrote:
>[snip]
>I was around when Ada was being developed and refined, a process that 
>took years.
>
>By contrast, C looks like it was just thrown together with little 
>thought, and probably that is exactly what happened.
>[snip]

Oh put a sock in it, guy.

No one here slavishly worships C or thinks it is perfect, but
taking every little chance you can to throw barbs at it with
otherwise utterly information-free posts like this, is merely
noise.  Honestly, the constant "notice me, senpai!" posts are
just pathetic attention-seeking.

	- Dan C.

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


#403246

FromMichael S <already5chosen@yahoo.com>
Date2026-10-17 21:03 +0300
Message-ID<20261017210359.00003dff@yahoo.com>
In reply to#403240
On Sat, 17 Oct 2026 18:23:47 +0100
bart <bc@freeuk.com> wrote:

> On 17/10/2026 17:39, Michael S wrote:
> > On Fri, 16 Oct 2026 15:00:27 -0700
> > Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> >   
> >> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:  
> >>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:  
> >>>> I find "break NAME;", where "NAME" is the name of an enclosing
> >>>> construct, unambiguously better than "break N;", where N is the
> >>>> number of levels to break out of. [...]  
> >>>
> >>> Definitely.
> >>>     
> >>>> There's a proposal for C2y to use goto labels as loop names, and
> >>>> a competing one to define a new syntax like "for NAME (;;)" :
> >>>>
> >>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
> >>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf  
> >>>
> >>> I'm not particularly a fan of multi-level break/continue.  But if
> >>> we're going to have one of these, the second ("for NAME (;;)") is
> >>> unquestionably better.  
> >>
> >> Unquestionably?  Why?
> >>  
> > 
> > I don't know why Tim prefers it.
> > I prefer it (strongly) because it is different from regular label.
> > So reader that wants to understand a flow of the program should not
> > be concerned with possibility of jumping to it from places outside
> > for(). 
> >> I do like the fact that it doesn't conflate goto labels with loop
> >> names, but I still prefer the "NAME: for (;;)" form, partly because
> >> it's consistent with several other languages.
> >>  
> > 
> > You mentioned itself that in Ada loop labels are distinct from
> > regular labels. I would think that Ada alone easily outweighs
> > "several other languages" if we compare by number (and likely by
> > quality) of man-hours invested into thinking and discussion of
> > syntactic features. Anyway I value appeal to success more than
> > appeal to authority so by my own standards the argument above is
> > weak.  
> 
> I was around when Ada was being developed and refined, a process that 
> took years.
> 
> By contrast, C looks like it was just thrown together with little 
> thought, and probably that is exactly what happened.
> 
> In the end, Ada was a language that you could admire, but you'd
> rather other people used. It's a solid language but I found it too
> formal and rather dull (not that it was available for me to use).
> 

I use Ada off-spring VHDL very regularly.
I prefer it over Verilog, but I do it due to semantics and mostly
despite [inherited from Ada] syntax.

> Still, I borrowed some syntactic features from it.
> 
> One interesting fact that people might forget is that it was 
> case-insensitive, a welcome difference IMV.
>

I don't like case-insensitivity, except, may be, for keywords.
I don't like begin..end.
Most of all, I don't like nested procedures that have visibility of
local variables of the parent (That's related to Ada, not significant
in context of VHDL).
I suppose, I don't like most of the thing that you like about
programming languages.


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


#403241

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-10-17 10:30 -0700
Message-ID<868q3wp748.fsf@linuxsc.com>
In reply to#403224
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>>> I find "break NAME;", where "NAME" is the name of an enclosing
>>> construct, unambiguously better than "break N;", where N is the
>>> number of levels to break out of.  [...]
>>
>> Definitely.
>>
>>> There's a proposal for C2y to use goto labels as loop names, and a
>>> competing one to define a new syntax like "for NAME (;;)" :
>>>
>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
>>
>> I'm not particularly a fan of multi-level break/continue.  But if
>> we're going to have one of these, the second ("for NAME (;;)") is
>> unquestionably better.
>
> Unquestionably?  Why?

Before I respond I'd like to ask you to list as many potential
differentiators as you can think of, without regard to which of
the two suggestions each one benefits, and without saying which
ones you think favor one choice or the other.  If you do that I
can try to go through your list, say which ones I think are
significant, which of the two choices each one favors, and maybe
also assign some sort of priority ranking.  Also that would give
me a chance to think about whether there are other differentiators
not on your list but that could seem to me to be relevant.

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


#403244

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-10-17 10:54 -0700
Message-ID<11b0coc$f6tl$2@kst.eternal-september.org>
In reply to#403241
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>> I find "break NAME;", where "NAME" is the name of an enclosing
>>>> construct, unambiguously better than "break N;", where N is the
>>>> number of levels to break out of.  [...]
>>>
>>> Definitely.
>>>
>>>> There's a proposal for C2y to use goto labels as loop names, and a
>>>> competing one to define a new syntax like "for NAME (;;)" :
>>>>
>>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
>>>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
>>>
>>> I'm not particularly a fan of multi-level break/continue.  But if
>>> we're going to have one of these, the second ("for NAME (;;)") is
>>> unquestionably better.
>>
>> Unquestionably?  Why?
>
> Before I respond I'd like to ask you to list as many potential
> differentiators as you can think of, without regard to which of
> the two suggestions each one benefits, and without saying which
> ones you think favor one choice or the other.  If you do that I
> can try to go through your list, say which ones I think are
> significant, which of the two choices each one favors, and maybe
> also assign some sort of priority ranking.  Also that would give
> me a chance to think about whether there are other differentiators
> not on your list but that could seem to me to be relevant.

No, Tim, I absolutely will not do that.

I asked you to explain two words that you wrote.  You do not get to
assign me homework as a precondition for answering a simple question.

You asserted that it's "unquestionably better".  You can support
that assertion or not.  If you're not going to answer my question,
an easier way to do that is to remain silent.  I'm used to that
from you.

To be blunt, I don't care enough about your opinion to do extra
work to extract it from you.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

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


#402975

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-10-11 04:26 -0700
Message-ID<864iesjx6e.fsf@linuxsc.com>
In reply to#402897
Michael S <already5chosen@yahoo.com> writes:

> The cases where I want to break out of the loop from the switch in
> the body of the loop are very common.

That surprises me.  Can you post a representative example (and
ideally not overly long)?

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


#402976

Frombart <bc@freeuk.com>
Date2026-10-11 13:35 +0100
Message-ID<11afvqt$2kloc$1@dont-email.me>
In reply to#402975
On 11/10/2026 12:26, Tim Rentsch wrote:
> Michael S <already5chosen@yahoo.com> writes:
> 
>> The cases where I want to break out of the loop from the switch in
>> the body of the loop are very common.
> 
> That surprises me.  Can you post a representative example (and
> ideally not overly long)?


An example shouldn't be necessary. It is enough to know that loop-breaks 
exist and are used.

Then, whether break works here:

    while (cond) {
         ....
         break;
         ....
    }

shouldn't need to depend on whether that break happens to be inside a 
switch statement.

Maybe it is within an if-else chain, but at some point it is refactored 
into a switch statement. Now it no long does what is expected, and in 
fact using break to quit the loop from inside switch becomes impossible.

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


#402979

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-10-11 06:13 -0700
Message-ID<86zewkidn4.fsf@linuxsc.com>
In reply to#402976
bart <bc@freeuk.com> writes:

> On 11/10/2026 12:26, Tim Rentsch wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:
>>
>>> The cases where I want to break out of the loop from the switch in
>>> the body of the loop are very common.
>>
>> That surprises me.  Can you post a representative example (and
>> ideally not overly long)?
>
> An example shouldn't be necessary.  It is enough to know that
> loop-breaks exist and are used.

It doesn't surprise me that they exist.  What surprises me is
that they are common, in code written by someone I consider a
competent programmer.  I don't care about what idiotic things
are done by people who aren't competent programmers.

You might want to think about the deeper meaning of that last
sentence.

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


#402983

Frombart <bc@freeuk.com>
Date2026-10-11 14:51 +0100
Message-ID<11ag49c$2mal9$1@dont-email.me>
In reply to#402979
On 11/10/2026 14:13, Tim Rentsch wrote:
> bart <bc@freeuk.com> writes:
> 
>> On 11/10/2026 12:26, Tim Rentsch wrote:
>>
>>> Michael S <already5chosen@yahoo.com> writes:
>>>
>>>> The cases where I want to break out of the loop from the switch in
>>>> the body of the loop are very common.
>>>
>>> That surprises me.  Can you post a representative example (and
>>> ideally not overly long)?
>>
>> An example shouldn't be necessary.  It is enough to know that
>> loop-breaks exist and are used.
> 
> It doesn't surprise me that they exist.  What surprises me is
> that they are common, in code written by someone I consider a
> competent programmer.  I don't care about what idiotic things
> are done by people who aren't competent programmers.
> 
> You might want to think about the deeper meaning of that last
> sentence.

You might also think about the deeper meaning of my comments.

You don't take a problem feature of a language design and brush it under 
the carpet.

Then, when questioned, suggest that it's very rarely used. Or when it is 
used, that they shouldn't using it because everyone should be as clever 
as you at writing convoluted code: Look how clever I am, I've never 
needed to use '(loop) break' or 'goto' ever.

(See, I even had to qualify that 'break' because 'switch' stupidly uses 
the same keyword.)

And you're ignoring my point: inside a loop is a conditional break. But 
as the language is now, you must use if-else for that condition and not 
switch. That is a flaw.

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


#402980

FromDavid Brown <david.brown@hesbynett.no>
Date2026-10-11 15:33 +0200
Message-ID<11ag37o$2ln0a$1@dont-email.me>
In reply to#402976
On 11/10/2026 14:35, bart wrote:
> On 11/10/2026 12:26, Tim Rentsch wrote:
>> Michael S <already5chosen@yahoo.com> writes:
>>
>>> The cases where I want to break out of the loop from the switch in
>>> the body of the loop are very common.
>>
>> That surprises me.  Can you post a representative example (and
>> ideally not overly long)?
> 
> 
> An example shouldn't be necessary. It is enough to know that loop-breaks 
> exist and are used.
> 
> Then, whether break works here:
> 
>     while (cond) {
>          ....
>          break;
>          ....
>     }
> 
> shouldn't need to depend on whether that break happens to be inside a 
> switch statement.
> 
> Maybe it is within an if-else chain, but at some point it is refactored 
> into a switch statement. Now it no long does what is expected, and in 
> fact using break to quit the loop from inside switch becomes impossible.
> 

The question was not about how it is possible to write a loop within a 
switch and have a "break" statement inside the loop.  The question was 
about how often such code was written, and what makes it "very common" 
for Michael.  I am also curious to know if he finds the use of the same 
"break" keyword makes the code more difficult to read, or increases the 
risk of errors or misunderstandings.

It is quite obvious that it is easy to write code with loops + break 
within a switch.  It is equally obvious that it is easy to avoid such 
constructs - there are always ways to avoid a "break" in a loop, and if 
the code run within a switch case is complex, it is often practical to 
refactor it into a separate function.  But presumably Michael has 
reasons not do do that.

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


#402988

FromAndrey Tarasevich <noone@noone.net>
Date2026-10-11 09:01 -0700
Message-ID<11agbsh$2pbk7$1@dont-email.me>
In reply to#402980
On Sun 10/11/2026 6:33 AM, David Brown wrote:
> 
> It is quite obvious that it is easy to write code with loops + break 
> within a switch.  It is equally obvious that it is easy to avoid such 
> constructs - there are always ways to avoid a "break" in a loop, and if 
> the code run within a switch case is complex, it is often practical to 
> refactor it into a separate function.  But presumably Michael has 
> reasons not do do that.

Um... The common pattern for a "search"-style loop looks as follows

   for (/* domain condition */)
   {
     ...
     if (/* search condition */)
       break;
     ...
   }

So, loops that terminate with `break` are the mainstay of every 
competently written code. Moving the "early termination" condition into 
the loop header (i.e. lumping the search condition with the domain 
condition) is a very ugly anti-pattern in most cases. Moreover, majority 
of the loops in an average C program are such "search"-style loops, 
meaning that they do have an "early termination" condition.

Now, while overwhelming majority of my loops would use `if` to check the 
"early termination", I can imagine that there sill be cases where 
`switch` is applicable and more appropriate than an `if`. Yes, a 
`switch` can always be replaced with an `if` ladder, but being _forced_ 
to do so by a language limitation doesn't look right.

And writing a separate function just to work around a weird language 
limitation... that doesn't look right either.

-- 
Best regards,
Andrey

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


#402990

FromDavid Brown <david.brown@hesbynett.no>
Date2026-10-11 19:17 +0200
Message-ID<11aggaq$2qqh9$1@dont-email.me>
In reply to#402988
On 11/10/2026 18:01, Andrey Tarasevich wrote:
> On Sun 10/11/2026 6:33 AM, David Brown wrote:
>>
>> It is quite obvious that it is easy to write code with loops + break 
>> within a switch.  It is equally obvious that it is easy to avoid such 
>> constructs - there are always ways to avoid a "break" in a loop, and 
>> if the code run within a switch case is complex, it is often practical 
>> to refactor it into a separate function.  But presumably Michael has 
>> reasons not do do that.
> 
> Um... The common pattern for a "search"-style loop looks as follows
> 
>    for (/* domain condition */)
>    {
>      ...
>      if (/* search condition */)
>        break;
>      ...
>    }
> 
> So, loops that terminate with `break` are the mainstay of every 
> competently written code. Moving the "early termination" condition into 
> the loop header (i.e. lumping the search condition with the domain 
> condition) is a very ugly anti-pattern in most cases. Moreover, majority 
> of the loops in an average C program are such "search"-style loops, 
> meaning that they do have an "early termination" condition.
> 
> Now, while overwhelming majority of my loops would use `if` to check the 
> "early termination", I can imagine that there sill be cases where 
> `switch` is applicable and more appropriate than an `if`. Yes, a 
> `switch` can always be replaced with an `if` ladder, but being _forced_ 
> to do so by a language limitation doesn't look right.
> 
> And writing a separate function just to work around a weird language 
> limitation... that doesn't look right either.
> 

Certainly plenty of loops have "break" statements, especially as an 
early exit.

Sometimes code is written with big switches in a function, and the cases 
might include loops, and those loops might have break statements.  The 
question is why someone might consider this a very common situation, and 
why they might consider it a failing that the same keyword is used for a 
switch "break" and for a loop "break".  There are two possibilities I 
can imagine, but Michael may have other things in mind.  One is that the 
code is less clear than it might otherwise have been - if that is the 
case, then I think the code should be considered for re-factoring into 
separate functions if the inner loops are too complex.  The other 
possibility is that the programmer wanted to break out of the switch 
from within the middle of the inner loop.  I can imagine that happening, 
and it would currently need either a bit of extra code to do the 
"breaking" in two steps, a "goto", or refactoring into a separate 
function.  But it seems strange to me that someone would feel that was a 
common enough problem to want to have "switch break" and "loop break" be 
separate keywords, rather than go straight to a "break <label>" solution 
that would be more general.

Only Michael can, if he wants, explain what he was thinking.

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


Page 8 of 17 — ← Prev page 1 … 6 7 [8] 9 10 … 17  Next page →

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


csiph-web