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


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

Which code style do you prefer the most?

Started byAr Rakin <rakinar2@onesoftnet.eu.org>
First post2025-02-25 21:15 +0600
Last post2025-03-18 13:59 +0100
Articles 20 on this page of 295 — 27 participants

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


Contents

  Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-25 21:15 +0600
    Re: Which code style do you prefer the most? David LaRue <huey.dll@tampabay.rr.com> - 2025-02-25 15:23 +0000
      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-25 21:34 +0600
        Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-25 16:17 +0000
          Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-25 22:50 +0600
          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-25 22:51 +0100
        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-25 17:28 +0100
          Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-25 22:52 +0600
            Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-25 20:35 +0100
              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-25 23:02 +0100
                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 09:41 +0100
                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 13:25 +0100
              Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 17:43 +0600
                Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 13:39 +0100
                  Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 01:03 +0000
                    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 05:58 +0100
                    Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 22:11 +0600
                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 15:37 +0100
                  Re: Which code style do you prefer the most? bks@panix.com (Bradley K. Sherman) - 2025-02-26 14:39 +0000
                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 17:32 +0100
                      Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-26 16:47 +0000
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 20:45 +0100
                        Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-09 12:18 -0700
                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-09 22:30 +0100
                            Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-10 13:21 -0700
                      Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 18:13 +0100
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 20:56 +0100
                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 06:57 +0100
                            Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 16:47 +0100
                              Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-02-28 00:29 +0000
                                Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-02-28 14:44 +0200
                                  Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:14 +0000
                                  Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 13:17 -0800
                                    Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-03-03 14:13 +0200
                                      Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-03 12:29 +0000
                                        Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-03 13:33 +0000
                                          Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-03 13:57 +0000
                                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 03:16 +0000
                                      Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-03 10:49 -0800
                                    Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-03 15:25 +0000
                                      Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-03 10:34 -0800
                                      Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-03 15:23 -0800
                                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 03:17 +0000
                                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-04 06:12 +0100
                                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 05:39 +0000
                                              Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-04 03:42 -0800
                                                Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-04 15:55 +0000
                                              Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 20:49 +0000
                                                Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-04 22:15 +0000
                                                Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 05:09 +0100
                                                  Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-05 04:24 +0000
                                        Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-21 02:41 -0700
                                          Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-21 14:06 +0000
                                            Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-21 14:08 +0000
                                              Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-22 06:49 -0700
                                                Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-22 14:32 +0000
                                                  Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-22 12:45 -0700
                                          Re: 80 char lines and holerith cards [Was:Which code style do you prefer the most?] Jakob Bohm <egenagwemdimtapsar@jbohm.dk> - 2025-04-01 05:46 +0200
                                            Re: 80 char lines and holerith cards [Was:Which code style do you prefer the most?] Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-01 09:46 +0200
                                            Re: 80 char lines and holerith cards [Was:Which code style do you prefer the most?] scott@slp53.sl.home (Scott Lurndal) - 2025-04-01 13:52 +0000
                                              Re: 80 char lines and holerith cards [Was:Which code style do you prefer the most?] Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-01 19:11 +0200
                                                Re: 80 char lines and holerith cards [Was:Which code style do you prefer the most?] scott@slp53.sl.home (Scott Lurndal) - 2025-04-01 17:20 +0000
                              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-28 10:00 +0100
                                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-28 12:54 +0100
                                  Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-02-28 12:21 +0000
                                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-28 16:44 +0100
                                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:10 +0000
                                      Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-02-28 23:32 +0000
                                        Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 23:49 +0000
                                          Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-28 16:15 -0800
                                            Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-01 01:02 +0000
                                            Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-01 17:30 +0100
                                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-01 02:55 +0000
                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-01 07:07 +0100
                      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 22:04 +0600
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 21:10 +0100
                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 01:04 +0000
                      Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 07:06 +0100
                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 06:17 +0000
                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 09:38 +0100
                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 09:15 +0000
                              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-28 08:50 +0100
                                Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 08:55 +0000
                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-28 10:21 +0100
                                    Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 10:19 +0000
                                      Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-28 14:26 +0100
                                      Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-02-28 14:22 +0000
                                        Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-02-28 16:34 +0200
                                          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:09 +0000
                                        Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-28 21:55 +0600
                                      Re: Which code style do you prefer the most? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-02-28 10:47 -0800
                                      Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-28 18:53 +0000
                                      Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:08 +0000
                                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-01 17:32 +0100
                                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-01 21:32 +0100
                                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-01 22:20 +0000
                                              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-01 23:43 +0100
                                                Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-01 17:24 -0800
                                                  Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-02 02:42 +0000
                                                    Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-01 20:46 -0800
                                                  Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-01 21:29 -0800
                                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-02 06:46 +0100
                                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-02 06:48 +0100
                                                  Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-02 11:31 +0000
                                                    Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-02 12:17 -0800
                                                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-02 22:13 +0000
                                                  Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-02 12:52 +0100
                                                    Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-02 13:42 +0000
                                                      Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-02 19:04 +0100
                                                Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-02 16:32 +0000
                                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-02 17:50 +0100
                                                    Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-02 18:28 +0000
                                                      [OT] Pascal identifiers [digression] (was Re: Which code style do you prefer the most?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-02 23:00 +0100
                                                        Re: [OT] Pascal identifiers [digression] (was Re: Which code style do you prefer the most?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-02 14:49 -0800
                                                          Re: [OT] Pascal identifiers [digression] (was Re: Which code style do you prefer the most?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-03 02:16 +0000
                                                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-02 22:07 +0000
                                          Re: Which code style do you prefer the most? cross@spitfire.i.gajendra.net (Dan Cross) - 2025-03-01 21:41 +0000
                                Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 05:52 -0800
                                  Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-02 14:21 +0000
                                    Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-03 17:03 -0800
          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-25 22:59 +0100
      Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-25 15:43 +0000
    Re: Which code style do you prefer the most? John McCue <jmccue@reddwf.jmcunx.com> - 2025-02-25 18:36 +0000
      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 00:39 +0600
      Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-25 18:51 +0000
        Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-25 19:33 +0000
          Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-25 20:40 +0000
            Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-25 21:09 +0000
          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-25 23:10 +0100
            Re: Which code style do you prefer the most? G <g@nowhere.invalid> - 2025-02-26 09:21 +0000
              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 13:58 +0100
            Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 17:53 +0600
              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 14:06 +0100
                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 15:58 +0100
                  Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-26 16:26 +0000
                    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 17:47 +0100
                      Re: Which code style do you prefer the most? John McCue <jmccue@whitedwf.jmcunx.com> - 2025-02-26 19:32 +0000
                        Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-26 19:50 +0000
                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 01:22 +0000
                        Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 07:34 +0100
                          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 08:06 +0000
                            Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 09:47 +0100
                              Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 09:16 +0000
                      Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 21:09 +0100
                        Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 07:59 +0100
                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-26 21:01 +0100
                      Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-26 22:13 +0000
                    Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 00:49 -0800
                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 17:32 +0100
                Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-26 13:31 -0800
                  Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 01:10 +0000
                    Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 19:05 +0600
                      Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 17:23 +0100
                        Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 23:17 +0600
                Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 06:00 -0800
                  Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-03-02 16:20 +0200
                    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-02 15:53 +0100
        Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-02-25 20:21 +0000
        Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 17:51 +0600
          Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-26 17:59 +0000
            Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-26 18:59 +0000
              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 08:14 +0100
              Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 00:21 -0800
                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-02 13:21 +0100
            Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 19:02 +0600
              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-28 10:32 +0100
                Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-28 18:54 +0600
          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 01:08 +0000
            Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 18:59 +0600
      Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 06:22 -0800
    Re: Which code style do you prefer the most? Rosario19 <Ros@invalid.invalid> - 2025-02-25 22:46 +0100
      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 17:54 +0600
    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-25 22:47 +0100
    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-25 22:48 +0000
      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-26 17:59 +0600
        Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-26 14:26 +0100
          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-26 21:44 +0000
            Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-02-26 23:17 +0000
              Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 18:56 +0600
                Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-27 14:13 +0000
                  Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 21:12 +0600
                  Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 17:26 +0100
                    Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 23:17 +0600
                    Re: Which code style do you prefer the most? candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-02-28 02:40 +0000
                      Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-28 04:29 +0000
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-28 10:21 +0100
                          Re: Which code style do you prefer the most? candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-02-28 17:30 +0000
                            Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-02-28 18:39 +0000
                        Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-02-28 15:30 +0200
                      Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-28 18:59 +0600
                  Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-27 13:24 -0800
                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-28 10:22 +0100
                      Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 10:24 +0000
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-28 13:03 +0100
                          Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-02 09:35 +0000
                        Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-02-28 14:19 +0200
                          Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-01 21:30 -0800
                          Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-02 09:29 +0000
                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-03 02:17 +0000
                              Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-03 02:46 +0000
                                Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-03 03:28 +0000
                            Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-11 22:11 -0700
                              Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-12 06:52 +0000
                                Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-03-12 11:12 +0200
                                  Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-12 09:23 +0000
                                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-13 00:06 +0000
                                Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-15 09:26 -0700
                                  Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-15 18:23 +0000
                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:15 +0000
                          Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 22:15 +0000
                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 22:38 +0000
                              Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-02-28 23:21 +0000
                                Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-01 02:56 +0000
                                  Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-01 06:17 +0000
                                    Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-01 20:25 +0000
                                      Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-01 21:03 +0000
                                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-01 22:21 +0000
                Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-02-27 14:16 +0000
                  Re: Which code style do you prefer the most? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-02-27 14:21 +0000
                  Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 21:13 +0600
                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 17:33 +0100
                      Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-02-27 17:27 +0000
                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-02-27 21:14 +0100
                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 23:24 +0000
                          Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-28 22:12 +0600
                            Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-28 21:25 +0000
                Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-02-27 14:18 +0000
                  Re: Which code style do you prefer the most? Ar Rakin <rakinar2@onesoftnet.eu.org> - 2025-02-27 21:11 +0600
                  Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-01 21:56 -0800
            Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-02-27 08:45 +0100
              Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-02-27 08:08 +0000
    Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-02 04:01 -0800
    Re: Which code style do you prefer the most? Anton Shepelev <anton.txt@g{oogle}mail.com> - 2025-03-04 17:56 +0300
      Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-04 15:18 +0000
        Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-04 16:01 +0000
          Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-04 18:14 +0000
            Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-04 21:49 +0000
              Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-04 22:17 +0000
                Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-04 22:26 +0000
                  Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-04 22:40 +0000
                Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 23:45 +0000
                Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 05:46 +0100
                  Re: Which code style do you prefer the most? vallor <vallor@cultnix.org> - 2025-03-05 07:02 +0000
                    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 09:35 +0100
                      Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-05 08:39 +0000
                        Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 09:58 +0100
                          Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-05 19:12 +0000
                            Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 21:53 +0100
                              Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-06 01:22 +0000
                          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-06 02:34 +0000
                Re: Which code style do you prefer the most? Anton Shepelev <anton.txt@g{oogle}mail.com> - 2025-03-05 15:22 +0300
                  Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-05 14:44 +0100
                    Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-05 14:20 +0000
                      Re: Which code style do you prefer the most? Anton Shepelev <anton.txt@g{oogle}mail.com> - 2025-03-05 18:30 +0300
                        Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-05 16:40 +0000
                          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 18:09 +0100
                            Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-05 17:32 +0000
                              Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-05 17:51 +0000
                                Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 19:50 +0100
                                Re: Which code style do you prefer the most? richard@cogsci.ed.ac.uk (Richard Tobin) - 2025-03-05 19:09 +0000
                                Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-05 19:18 +0000
                                  Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-05 20:07 +0000
                                    Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 21:46 +0100
                                      Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-05 14:58 -0800
                                        Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-06 10:35 +0100
                                Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-06 10:29 +0100
                                  Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-06 14:49 +0000
                                    Re: Which code style do you prefer the most? Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-06 17:52 +0000
                                      Re: Which code style do you prefer the most? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-06 18:05 +0000
                                        Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-06 21:14 +0000
                                          Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-07 15:37 +0100
                                            Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-07 12:17 -0800
                                              Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-08 16:47 +0100
                                                Re: Which code style do you prefer the most? candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-03-12 22:20 +0000
                                                  Re: Which code style do you prefer the most? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-12 15:23 -0700
                                                    Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-13 00:12 +0000
                                                      Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-13 09:30 +0100
                                                        Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-13 09:44 +0000
                                                          Re: Which code style do you prefer the most? Michael S <already5chosen@yahoo.com> - 2025-03-13 16:19 +0200
                                                            Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-13 16:20 +0100
                                    Re: Which code style do you prefer the most? David Brown <david.brown@hesbynett.no> - 2025-03-06 20:36 +0100
                                      Re: Which code style do you prefer the most? G <g@nowhere.invalid> - 2025-03-07 09:28 +0000
                                        Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-07 21:16 +0000
                                    Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-06 20:49 +0000
                          Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-05 22:02 +0000
                            Re: Which code style do you prefer the most? bart <bc@freeuk.com> - 2025-03-05 23:46 +0000
                              Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-06 00:46 +0000
                              Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-06 10:53 +0100
                              Re: Which code style do you prefer the most? scott@slp53.sl.home (Scott Lurndal) - 2025-03-06 14:48 +0000
                                Re: Which code style do you prefer the most? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-06 21:18 +0000
                                  Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-07 08:10 +0100
              Re: Which code style do you prefer the most? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-04 23:36 +0000
              Re: Which code style do you prefer the most? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-09 11:41 -0700
          Re: Which code style do you prefer the most? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-05 05:21 +0100
    Re: Which code style do you prefer the most? Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-18 13:59 +0100

Page 12 of 15 — ← Prev page 1 … 10 11 [12] 13 14 15  Next page →


#390525

FromDavid Brown <david.brown@hesbynett.no>
Date2025-02-27 17:33 +0100
Message-ID<vpq45i$35inm$5@dont-email.me>
In reply to#390516
On 27/02/2025 16:13, Ar Rakin wrote:
> On 2/27/25 8:16 PM, Scott Lurndal wrote:
>> Ar Rakin <rakinar2@onesoftnet.eu.org> writes:
>>> bart <bc@freeuk.com> writes:
>>>
>>>> // isn't devoid of quirks (this is still C after all), for example:
>>>>
>>>>     fopen(file,"rb");   // open file in \windows\system32\
>>>>     fread(...);
>>>>
>>>> Here, the // line continues onto the next, so that the fread is
>>>> commented out. But they are fewer.
>>>
>>> Interesting. Isn't this considered a compiler bug?
>>
>> No, it is standard C line continuation behavior remaining from
>> the days of punched cards.  More useful for strings
>> and invented prior to the invention of unterminated comments (//).
>>
> 
> Understood.
> 
> Even though I have been writing C code for around four years now, I 
> still learn new things about this *simple* language every day.
> 

Like most quirks, as found in every language, you have to be very 
unlucky to be hit by it, and extraordinarily unlucky to do so without it 
being immediately obvious when you compile your code or at least when 
you try to run it.  And it's peanuts to avoid triggering it once you 
know about it - but most people can spend their entire careers as C 
programmers without ever coming across it.

These things can be inconvenient for people making C tools (compilers, 
syntax highlighters, etc.), but are rarely a problem for C programmers.

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


#390528

Frombart <bc@freeuk.com>
Date2025-02-27 17:27 +0000
Message-ID<vpq79j$36qgh$1@dont-email.me>
In reply to#390525
On 27/02/2025 16:33, David Brown wrote:
> On 27/02/2025 16:13, Ar Rakin wrote:
>> On 2/27/25 8:16 PM, Scott Lurndal wrote:
>>> Ar Rakin <rakinar2@onesoftnet.eu.org> writes:
>>>> bart <bc@freeuk.com> writes:
>>>>
>>>>> // isn't devoid of quirks (this is still C after all), for example:
>>>>>
>>>>>     fopen(file,"rb");   // open file in \windows\system32\
>>>>>     fread(...);
>>>>>
>>>>> Here, the // line continues onto the next, so that the fread is
>>>>> commented out. But they are fewer.
>>>>
>>>> Interesting. Isn't this considered a compiler bug?
>>>
>>> No, it is standard C line continuation behavior remaining from
>>> the days of punched cards.  More useful for strings
>>> and invented prior to the invention of unterminated comments (//).
>>>
>>
>> Understood.
>>
>> Even though I have been writing C code for around four years now, I 
>> still learn new things about this *simple* language every day.
>>
> 
> Like most quirks, as found in every language, you have to be very 
> unlucky to be hit by it, and extraordinarily unlucky to do so without it 
> being immediately obvious when you compile your code or at least when 
> you try to run it.  And it's peanuts to avoid triggering it once you 
> know about it - but most people can spend their entire careers as C 
> programmers without ever coming across it.
> 
> These things can be inconvenient for people making C tools (compilers, 
> syntax highlighters, etc.), but are rarely a problem for C programmers.
> 

Problems involving \ and // commonly come up with multi-line macros. 
Suppose your macro looks like this:

  #define M \
  a=0;\
  b=0;\
  c=0;

By itself it'll work; M expands to 'a=0;b=0;c=0;'. But then you want to 
comment each line. Both of these methods have problems:

  #define M \
  a=0;\ // one
  b=0;\ // two
  c=0;  // three

  #define M \
  a=0; // one\
  b=0; // two\
  c=0; // three

In the first, the \ no longer acts as line continuation (just the 
following space will be troublesome); the last two lines are outside the 
definition, and the part that is expanded has a stray \.

In the second, the lines are joined, but the b=0/c=0 lines become part 
of the first comment.

The only method that works is to use /*...*/ comments, and have the \ 
right at the end.

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


#390530

FromDavid Brown <david.brown@hesbynett.no>
Date2025-02-27 21:14 +0100
Message-ID<vpqh3j$38moj$2@dont-email.me>
In reply to#390528
On 27/02/2025 18:27, bart wrote:
> On 27/02/2025 16:33, David Brown wrote:
>> On 27/02/2025 16:13, Ar Rakin wrote:
>>> On 2/27/25 8:16 PM, Scott Lurndal wrote:
>>>> Ar Rakin <rakinar2@onesoftnet.eu.org> writes:
>>>>> bart <bc@freeuk.com> writes:
>>>>>
>>>>>> // isn't devoid of quirks (this is still C after all), for example:
>>>>>>
>>>>>>     fopen(file,"rb");   // open file in \windows\system32\
>>>>>>     fread(...);
>>>>>>
>>>>>> Here, the // line continues onto the next, so that the fread is
>>>>>> commented out. But they are fewer.
>>>>>
>>>>> Interesting. Isn't this considered a compiler bug?
>>>>
>>>> No, it is standard C line continuation behavior remaining from
>>>> the days of punched cards.  More useful for strings
>>>> and invented prior to the invention of unterminated comments (//).
>>>>
>>>
>>> Understood.
>>>
>>> Even though I have been writing C code for around four years now, I 
>>> still learn new things about this *simple* language every day.
>>>
>>
>> Like most quirks, as found in every language, you have to be very 
>> unlucky to be hit by it, and extraordinarily unlucky to do so without 
>> it being immediately obvious when you compile your code or at least 
>> when you try to run it.  And it's peanuts to avoid triggering it once 
>> you know about it - but most people can spend their entire careers as 
>> C programmers without ever coming across it.
>>
>> These things can be inconvenient for people making C tools (compilers, 
>> syntax highlighters, etc.), but are rarely a problem for C programmers.
>>
> 
> Problems involving \ and // commonly come up with multi-line macros. 

I think it is fair and useful to point this out as a potential problem 
or complication - I don't think it is equally fair to characterise it as 
"common".

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


#390534

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2025-02-27 23:24 +0000
Message-ID<vpqs7t$3aker$1@dont-email.me>
In reply to#390528
On Thu, 27 Feb 2025 17:27:17 +0000, bart wrote:

> Problems involving \ and // commonly come up with multi-line macros.

C macros are yet another example of the wrong way to do macros.

The only right way to do macros is at the AST level.

Think how many problems would be solved if you could do gensym in a C 
macro.

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


#390568

FromAr Rakin <rakinar2@onesoftnet.eu.org>
Date2025-02-28 22:12 +0600
Message-ID<87eczigi9z.fsf@onesoftnet.eu.org>
In reply to#390534
On 27 Feb 2025 23:24, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Thu, 27 Feb 2025 17:27:17 +0000, bart wrote:
>
>> Problems involving \ and // commonly come up with multi-line macros.
>
> C macros are yet another example of the wrong way to do macros.
>
> The only right way to do macros is at the AST level.
>
> Think how many problems would be solved if you could do gensym in a C 
> macro.

Would you say that the Rust compiler's implementation is *close* to what
you expect?
The Rust compiler processes macros during tokenization, so it is not
exactly what you specified.  I am just curious.

--
Ar Rakin

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


#390581

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2025-02-28 21:25 +0000
Message-ID<vpt9jh$3r2n0$11@dont-email.me>
In reply to#390568
On Fri, 28 Feb 2025 22:12:40 +0600, Ar Rakin wrote:

> Would you say that the Rust compiler's implementation is *close* to what
> you expect?

Looking at this overview
<https://doc.rust-lang.org/book/ch20-06-macros.html>, I think so.

> The Rust compiler processes macros during tokenization ...

So does C, but Rust does seem to be doing it at the AST level, which is 
the right way.

But note how they need two types of macros, one involving expanding a 
template and the other allowing the more elaborate execution of arbitrary 
code. In LISP-family languages (where the idea of AST-level macros came 
from), there doesn’t need to be such a distinction.

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


#390512

Frombart <bc@freeuk.com>
Date2025-02-27 14:18 +0000
Message-ID<vpps7v$34tq7$1@dont-email.me>
In reply to#390506
On 27/02/2025 12:56, Ar Rakin wrote:
> bart <bc@freeuk.com> writes:
> 
>> // isn't devoid of quirks (this is still C after all), for example:
>>
>>     fopen(file,"rb");   // open file in \windows\system32\
>>     fread(...);
>>
>> Here, the // line continues onto the next, so that the fread is
>> commented out. But they are fewer.
> 
> Interesting. Isn't this considered a compiler bug?

It's to do with how C is defined, which requires that its implementation 
corresponds to series of phases.

Then line-splicing, which combines two lines if the first ends with \, 
is done before processing // comments.

  I am aware that you
> can do the same thing with strings like this:
> 
> fprintf(stderr, "multi\
> line\
> strings\
> are fun.");
> 
> I can understand how this might be useful; but with *comments*?? Was
> that actually a thing in the official C standards?

It's isn't that useful for strings; the following is simpler and also works:

   "multi"
   "line"
   "string"

But it is needed for multi-line macros, as C's proprocessor is strictly 
line-oriented and a macro definition must fit onto one line.

So lines spliced with \ can be used to combine multiple lines into one. 
A side-effect is that you can't use // comments for individual lines of 
a multi-line macro, it would screw things up.

> To me it just feels like a compiler bug that was never fixed.

To me the whole of C feels like one huge language bug!

The way line splicing works has even weirder repercussions; any token 
can be split across lines:

i\
n\
t abc;      // split 'int' across 3 lines

/\
/ This is a '//' comment with // split across two lines

/\
* This is a /* ... comment */

"ABC\\
nDEF"      // A split string escape code

if (a =\
= b) ...

In fact, any C source file can be written with one character per line, 
plus the \ line continuation.

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


#390514

FromAr Rakin <rakinar2@onesoftnet.eu.org>
Date2025-02-27 21:11 +0600
Message-ID<vppvb6$35gb9$1@dont-email.me>
In reply to#390512
On 2/27/25 8:18 PM, bart wrote:
> On 27/02/2025 12:56, Ar Rakin wrote:
>> bart <bc@freeuk.com> writes:
>>
>>> // isn't devoid of quirks (this is still C after all), for example:
>>>
>>>     fopen(file,"rb");   // open file in \windows\system32\
>>>     fread(...);
>>>
>>> Here, the // line continues onto the next, so that the fread is
>>> commented out. But they are fewer.
>>
>> Interesting. Isn't this considered a compiler bug?
> 
> It's to do with how C is defined, which requires that its implementation 
> corresponds to series of phases.
> 
> Then line-splicing, which combines two lines if the first ends with \, 
> is done before processing // comments.
> 
>   I am aware that you
>> can do the same thing with strings like this:
>>
>> fprintf(stderr, "multi\
>> line\
>> strings\
>> are fun.");
>>
>> I can understand how this might be useful; but with *comments*?? Was
>> that actually a thing in the official C standards?
> 
> It's isn't that useful for strings; the following is simpler and also 
> works:
> 
>    "multi"
>    "line"
>    "string"
> 
> But it is needed for multi-line macros, as C's proprocessor is strictly 
> line-oriented and a macro definition must fit onto one line.
> 
> So lines spliced with \ can be used to combine multiple lines into one. 
> A side-effect is that you can't use // comments for individual lines of 
> a multi-line macro, it would screw things up.
> 
>> To me it just feels like a compiler bug that was never fixed.
> 
> To me the whole of C feels like one huge language bug!
> 
> The way line splicing works has even weirder repercussions; any token 
> can be split across lines:
> 
> i\
> n\
> t abc;      // split 'int' across 3 lines
> 
> /\
> / This is a '//' comment with // split across two lines
> 
> /\
> * This is a /* ... comment */
> 
> "ABC\\
> nDEF"      // A split string escape code
> 
> if (a =\
> = b) ...
> 
> In fact, any C source file can be written with one character per line, 
> plus the \ line continuation.
> 
> 

This is so weird LMAO, good to know though.  But still, I will continue 
to love C and will still write more C code :-)

-- 
Rakin

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


#390628

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2025-03-01 21:56 -0800
Message-ID<865xksx9eo.fsf@linuxsc.com>
In reply to#390512
bart <bc@freeuk.com> writes:

> On 27/02/2025 12:56, Ar Rakin wrote:
>
>> [concerning line splicing with \ at end of line]
>
> Then line-splicing, which combines two lines if the first ends
> with \, is done before processing // comments.
>
>> I am aware that you can do the same thing with strings like this:
>>
>> fprintf(stderr, "multi\
>> line\
>> strings\
>> are fun.");
>>
>> I can understand how this might be useful;  but with *comments*??
>> Was that actually a thing in the official C standards?
>
> It's isn't that useful for strings;  the following is simpler and
> also works:
>
>   "multi"
>   "line"
>   "string"

Just as a historical note, this construction wasn't available in
pre-standard C.  So line splicing used to be needed in such cases.

> But it is needed for multi-line macros, as C's proprocessor is
> strictly line-oriented and a macro definition must fit onto one
> line.

Since 1989 when the original C standard was done, multi-line macros
can be written without needing to use \ for line splicing.  I was
surprised to learn this when I first saw it.  An example:

    #define MASK_WIDTH( m ) ( 0U + (unsigned)+(          /*
    */    (m)  /((m)%32767 +1)  /32767  %32767  *15      /*
    */    +  (m)  %32767  /((m)%31 +1)  /31  %31  *5     /*
    */    +  4  -  12 / ((m)%31 + 3)                     /*
    */))

Yes, it's ugly.  Yes, it means line breaks can be put in only at
token boundaries (although in practice that limitation is observed
anyway).  Yes, I know of no production code that uses this
technique.  Still I think this trick is one worth knowing about.

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


#390498

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2025-02-27 08:45 +0100
Message-ID<vpp57g$318u4$1@dont-email.me>
In reply to#390483
On 26.02.2025 22:44, Lawrence D'Oliveiro wrote:
> On Wed, 26 Feb 2025 14:26:41 +0100, Janis Papanagnou wrote:
> 
>> Personally (in "C") I prefer '//' though.
> 
> I don’t know why, really.

Beyond punctuation cluttering that I already mentioned it is its
simplicity, less typing, better readability, and also less issues
with it. - I see that bart already answered that sufficiently.

> C started with the “/* ... */”, and that remains 
> more versatile with its ability to be inserted in more places.

Historic decisions are not (per se) a reason to use something.

There's reasons why '//' had been introduced, and I understand
perfectly why.

I acknowledge that you have different preferences.

BTW, there's many languages that use this comment syntax type.
E.g. '#' in Shell, Awk, and other scripting languages, '--' in
Eiffel, '//' in C++. It's noteworthy that ASN.1 (for example)
uses '--' to start a comment (up to the end of the line) but
you can also end the comment within the same line with another
'--'.
Then we have the brace-types, C's /*...*/, or Pascal's (*...*),
or Algol's 'co' ... 'co', or 'comment' ... 'comment'.
Then we have Simula's [explicit] (multi-line) 'comment' ... ;
or its (syntactically not explicitly marked) 'end'-comments.

You take what the language provides, or what suits you best in
case you have options.

Janis

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


#390501

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2025-02-27 08:08 +0000
Message-ID<vpp6h7$31cet$4@dont-email.me>
In reply to#390498
On Thu, 27 Feb 2025 08:45:50 +0100, Janis Papanagnou wrote:

> On 26.02.2025 22:44, Lawrence D'Oliveiro wrote:
>
>> C started with the “/* ... */”, and that remains more versatile with
>> its ability to be inserted in more places.
> 
> Historic decisions are not (per se) a reason to use something.

I didn’t say they were.

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


#390637

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2025-03-02 04:01 -0800
Message-ID<86plizwsiq.fsf@linuxsc.com>
In reply to#390416
Ar Rakin <rakinar2@onesoftnet.eu.org> writes:

> Hello there,
>
> I've been writing C code for a long time, in different styles, but
> always wanted to know which code style most people prefer.  This is all
> about that question.  Which one of the following do you prefer the
> most?
>
> [...]
>
> 3. Other Styles?
>
> Please show an example!

The question being asked is mostly about indentation and placement
of braces.  There are a few points here that I think are worth
making.

One, simply asking for a preference or an opinion is a waste of
time.  The question is not what choices are preferred but what
factors motivate the choices made (example to be given below).

Two, it's just as useless to say a particular layout is "more clear"
or "more readable".

Three, the idea that it's all just opinions or personal preferences
is cowardly.  In effect the message there is that any opinion is
equally valuable.  That is not the case.

Four, there are lots of different layout choices used widely enough
to have recognized communities of adherents.  Here is a list
constructed from the wikipedia page on indentation style:

    1TBS aka One True Brace Style
    BSD aka Allman
    BSD KNF ("kernel normal form")
    "FORTRAN" (no indentation)
    GNU
    Horstmann
    Java-like
    K&R
    Linux Kernel
    "Lispish" (C as it might be written by a Lisp programmer)
    Pico
    Ratliff
    Stroustrup
    Whitesmiths

Note:  as best I can tell the principal difference between K&R
and 1TBS is K&R allows single-statement bodies of if() and
while(), etc, to be given indented on the next line, without
any braces, whereas 1TBS insists on braces in such cases.

The layout style I personally prefer is closest to 1TBS.  As it
turns out I tried lots of different layout choices, and ended up
on a 1TBS-like pattern, years before I ever learned C.  That's a
data point but it doesn't really convey much information, in line
with my earlier statement in point One.

Five, an example.  Consider a decision with only one degree of
freedom:  for the start of a function definition, should we write
this

    size_t length_of_string( const char *s ){

or this

    size_t
    length_of_string( const char *s ){

(ignoring other layout choices as being incidental to the
question here).

There are three areas of consideration:

  (a) effects on development-time activity
  (b) effects on code-reading or code-inspection activity
  (c) effects on the source code itself.

For (c), the one-line style uses one fewer lines, but has a
higher chance of needing to split the function parameters across
a line boundary.

For (a), the two-line style lends itself to searching using
standard editor tools

For (b), the two-line style
  (1) makes it easy to find both names of functions and types
      of functions using just my eyes (fast thinking) without
      having to parse the symbols involved and separate them
      (slow thinking);  slow thinking uses more energy and
      mental effort than fast thinking
  (2) related to (1), the same holds true for reading on
      hardcopy rather than a display
  (3) is easier to process using simple tools such as grep
      or awk
  (4) gives an increase in code size, probably in the range
      of 5 to 10 percent, which means programs are longer
      and take up more "space" on an output medium (which
      may affect reading time)

Of the factors listed, probably the largest effect is due to
being able to find function names and types visually, rather than
having to use higher level brain functions.  The cost of longer
program source is significant, but in my experience that is more
than outweighed by the savings in energy and mental effort used
when reading and developing.

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


#390760

FromAnton Shepelev <anton.txt@g{oogle}mail.com>
Date2025-03-04 17:56 +0300
Message-ID<20250304175602.c9fe683d678d3a2ed101a4ac@g{oogle}mail.com>
In reply to#390416
Ar Rakin:

> I've been writing C code for a long time, in different styles, but 
> always wanted to know which code style most people prefer. This is all 
> about that question. Which one of the following do you prefer the most?

> 1. GNU Style
> 2. Linux Style

I don't like them much. Below is a piece of my code
(previosly shown in this group). It uses tabs for
indentation and spaces for alignment.

-- sort.c --
#include <stdio.h>
#include <limits.h>
#include "sort.h"

/* Partition an array [l..r] around a "pivot" member so that */
/* the elements of the left sub-array do not exceed, and the ones */
/* of the right sub-array are not less than, the pivot. */
static int /* returns the right boundary of the left sub-array */
partition
(	void * data, /* pointer to the full array              */
	int    l,    /* left  boundary of the sub-array        */
	int    r,    /* right boundary of the sub-array, l < r */
  	comp_f comp,
	swap_f swap,
	void * extra
)
{	int p; /* index of the pivot, element */
	p = ( l + r ) / 2; /* Chose the middle element as pivot */

	while( 1 )
	{	/* advance cursors until they stop at a pair of elements */
		/* that should be swapped or meet or go past each other.  */
		/* The pivot element serves as a sentinel.                */
		while( comp( data, l, p, extra ) < 0 ) l += 1;
		while( comp( data, r, p, extra ) > 0 ) r -= 1;
		if( l >= r ) break;

		swap( data, l, r );      /* Swap the pair found         */
		     if( l == p ) p = r; /* Update pivot location if it */
		else if( r == p ) p = l; /* was changed during the swap */

		/* Advance the cursors. If they are adjecent they will cross: */
		l += 1; r -= 1;
	}
	return r;
}

void sort
(	void * data,
	int    len,
	comp_f comp,
	swap_f swap,
	void * extra
)
{  /* In this algorithm, minimun sufficient stack size is Log(len) */
	int sl[sizeof(int) * CHAR_BIT]; /* left  sub-array boundaries on the stack */
	int sr[sizeof(int) * CHAR_BIT]; /* right sub-array boundaries nn the stack */

	int d;          /* stack depth */
	int l, r;       /* left and right boundaries of a sub-array */
	int lpos, rpos; /* positions of the left and right new sub-arrays on the stack */
	int newr;       /* the right boundary of the new left sub-array */

	d     = 1; /* Put the initial sub-array onto the stack */
	sl[0] = 0; sr[0] = len - 1;	
	while( d > 0 )
	{	d -= 1; /* Take an element from the stack */
		l = sl[d]; r = sr[d];
		if( l >= r ) continue; /* Skip a subarray shorter than two */
		
		newr = partition( data, l , r, comp, swap, extra );

		/* process the shorter sub-array first to ease the stack: */
		lpos = d; rpos = d; 
		if( newr - l > r - newr - 1 ) rpos += 1;
		else                          lpos += 1;

		/* Put partiioned sub-arrays onto the stack: */
		sl[lpos] = l;        sr[lpos] = newr;
		sl[rpos] = newr + 1; sr[rpos] = r;
		d += 2;
	}
}
-- sort.h --
/* ----------------------- A generic sorting routine ------------------------ */
/* Comparison function:
    > 0 <=> data[i] > data[j]
    < 0 <=> data[i] < data[j]
   == 0 <=> data[i] = data[j] */
typedef int  (*comp_f)( const void * data, int i, int j, void * extra );

/* Exchange ith and jth elements: */
typedef void (*swap_f)( void * data, int i, int j );

void sort
(	void * data, /* pointer to data to sort         */
	int    len,  /* length of data to sort          */
	comp_f comp, /* comparison function             */
	swap_f swap, /* swap function                   */
	void * extra /* user-supplied parameter to comp */
);
-- test.c --
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "sort.h"

static void print( int * a, int n )
{	int i;
	for( i = 0; i < n; i++ )
		printf("%i ", a[i] );
	printf("\n");
}

static int intcomp( int a, int b )
{	if( a > b ) return  1;
	if( a < b ) return -1;
	            return  0;
}

static int comp( const void * data, int i, int j, void * extra )
{	return intcomp( ( (int*)data )[i], ( (int*)data )[j] );  }

/* comparison for qsort: */
static int qscomp(const void * a, const void * b)
{	return intcomp( *(int*)a, *(int*)b );  }

static void swap( void * data, int i, int j )
{	int buf;
	buf = ( (int*)data )[i];
	( (int*)data )[i] = ( (int*)data )[j];
	( (int*)data )[j] = buf;
}

#define TESTLEN 500
/* performance test with a random array: */
static void test()
{	int     a[TESTLEN], c[TESTLEN];
	int     i, j;
	clock_t start, total;

	total = 0;
	for( i = 0; i < 1000; i++ )
	{	for( j = 0; j < TESTLEN; j++ )
		{	a[j] = rand() % 5;
			c[j] = a[j];
		}
		start = clock();
		/*qsort( a, testlen, sizeof(int), &qscomp );*/
		sort( a, TESTLEN, &comp, &swap, NULL );
		total += clock() - start;	
		for( j = 0; j < TESTLEN-1; j++ )
		{	if( a[j] > a[j+1] )
			{	print( c, TESTLEN );
				print( a, TESTLEN );
				return;
			}
		}
	}
	printf("Time: %f\n", (float)total / CLOCKS_PER_SEC );
}

/* test with a small hard-coded array: */
#define TMLEN 3
static void testman( void )
{	int ta[TMLEN] = {3,2,1};
	print( ta, TMLEN );
	sort ( ta, TMLEN, &comp, &swap, NULL );
	print( ta, TMLEN );
}

int main( int argc, char** argv )
{	/*testman();
	return 0;*/

	test();
	return 0;
}

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


#390761

FromRichard Heathfield <rjh@cpax.org.uk>
Date2025-03-04 15:18 +0000
Message-ID<vq75k8$1t6ut$2@dont-email.me>
In reply to#390760
On 04/03/2025 14:56, Anton Shepelev wrote:
> Ar Rakin:
> 
>> I've been writing C code for a long time, in different styles, but
>> always wanted to know which code style most people prefer. This is all
>> about that question. Which one of the following do you prefer the most?
> 
>> 1. GNU Style
>> 2. Linux Style
> 
> I don't like them much. Below is a piece of my code

I don't like most of the choices you've made :-) *but* I can see 
perfectly good reasons for making those choices (if that's any 
consolation).

Just about the only choice of yours that I /do/ like is your 
brace placement:

{
   {
     {
     }
   }
}

which  like because it makes the code's structure stand out so 
clearly. I know a lot of people criticise this style for being 
wasteful of vertical space, but I've never seen that as a 
problem. My screen can hold more than enough code to occupy me, 
and my annual vertical space bill is very reasonable.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

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


#390764

Frombart <bc@freeuk.com>
Date2025-03-04 16:01 +0000
Message-ID<vq785i$1u7v7$1@dont-email.me>
In reply to#390761
On 04/03/2025 15:18, Richard Heathfield wrote:
> On 04/03/2025 14:56, Anton Shepelev wrote:
>> Ar Rakin:
>>
>>> I've been writing C code for a long time, in different styles, but
>>> always wanted to know which code style most people prefer. This is all
>>> about that question. Which one of the following do you prefer the most?
>>
>>> 1. GNU Style
>>> 2. Linux Style
>>
>> I don't like them much. Below is a piece of my code
> 
> I don't like most of the choices you've made :-) *but* I can see 
> perfectly good reasons for making those choices (if that's any 
> consolation).
> 
> Just about the only choice of yours that I /do/ like is your brace 
> placement:
> 
> {
>    {
>      {
>      }
>    }
> }
> 
> which  like because it makes the code's structure stand out so clearly. 
> I know a lot of people criticise this style for being wasteful of 
> vertical space, but I've never seen that as a problem. My screen can 
> hold more than enough code to occupy me, and my annual vertical space 
> bill is very reasonable.
> 

I assume that style would be used like this:

     if (cond)
     {
         stmt1;
     }
     else
     {
         stmt2;
     }

So 50% of lines are solely for braces, with braces not having their own 
indent level. However if I now look at AS's post, that isn't it: opening 
braces don't have their own dedicated line, they are shared with the 
first line of the block:

     if (cond)
     {   stmt1;
     }
     else
     {   stmt2;
     }

This cuts down the line count, but now the first line is a special case: 
it's got that extra clutter at the start, makes it harder to swap with 
other lines, to temporarily comment out, to delete, or to add extra, 
perhaps debugging, lines at the start of the block.

The style I use for generated code is like this:

     if (cond) {
        stmt1;
     }
     else {
        stmt2;
     }

The same amount of vertical space, but none of those problems. So this 
is superior IMV.

(That is, when you have to use braces; generally I don't like that style 
of syntax *because* there are so many placement styles: there are 
multiple ways of writing the three tokens of '} else {'; not so many if 
it's just the single token 'else'.)

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


#390770

FromKaz Kylheku <643-408-1753@kylheku.com>
Date2025-03-04 18:14 +0000
Message-ID<20250304101022.154@kylheku.com>
In reply to#390764
On 2025-03-04, bart <bc@freeuk.com> wrote:
> The style I use for generated code is like this:
>
>      if (cond) {
>         stmt1;
>      }
>      else {
>         stmt2;
>      }

I've been known to do this:

  if (case_ineligible_for_switch) {
    // ...
  } else switch (state_variable) {
    // ...
  }

or

  if (case_not_requiring_loop) {
    // ...
  } else for (;;) {
    // ...
  }

and I might even have historically perpetrated something like:

  if (case_not_requiring_loop) {
    // ...
  } else if (case_requiring_loop) for (;;) {
    // ...
  } else {
    // ...
  }

:)

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

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


#390775

FromRichard Harnden <richard.nospam@gmail.invalid>
Date2025-03-04 21:49 +0000
Message-ID<vq7shq$226p3$1@dont-email.me>
In reply to#390770
On 04/03/2025 18:14, Kaz Kylheku wrote:
> On 2025-03-04, bart <bc@freeuk.com> wrote:
>> The style I use for generated code is like this:
>>
>>       if (cond) {
>>          stmt1;
>>       }
>>       else {
>>          stmt2;
>>       }
> 
> I've been known to do this:
> 
>    if (case_ineligible_for_switch) {
>      // ...
>    } else switch (state_variable) {
>      // ...
>    }
> 
> or
> 
>    if (case_not_requiring_loop) {
>      // ...
>    } else for (;;) {
>      // ...
>    }
> 
> and I might even have historically perpetrated something like:
> 
>    if (case_not_requiring_loop) {
>      // ...
>    } else if (case_requiring_loop) for (;;) {
>      // ...
>    } else {
>      // ...
>    }
> 
> :)
> 

I like the brace on its own line.  It visually separates the condidition 
from the statement.

How do people format long and complex conditions, given that you're 
trying not to a much over 80 columns?


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


#390777

FromRichard Heathfield <rjh@cpax.org.uk>
Date2025-03-04 22:17 +0000
Message-ID<vq7u5u$21gol$2@dont-email.me>
In reply to#390775
On 04/03/2025 21:49, Richard Harnden wrote:

<snip>

> 
> I like the brace on its own line.  It visually separates the 
> condidition from the statement.

Agreed.

> 
> How do people format long and complex conditions, given that 
> you're trying not to a much over 80 columns?

I like to break after a binary operator so that it is 
syntactically obvious that the line must continue:

if((a != b        &&
     c != d        &&
     e != f)       ||
    (g = h() * i() &&
    (j = k))
{
   foo();
}

(You'll be glad to hear that that's not a direct quote!)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

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


#390778

FromKaz Kylheku <643-408-1753@kylheku.com>
Date2025-03-04 22:26 +0000
Message-ID<20250304142114.131@kylheku.com>
In reply to#390777
On 2025-03-04, Richard Heathfield <rjh@cpax.org.uk> wrote:
> On 04/03/2025 21:49, Richard Harnden wrote:
>
><snip>
>
>> 
>> I like the brace on its own line.  It visually separates the 
>> condidition from the statement.
>
> Agreed.
>
>> 
>> How do people format long and complex conditions, given that 
>> you're trying not to a much over 80 columns?
>
> I like to break after a binary operator so that it is 
> syntactically obvious that the line must continue:
>
> if((a != b        &&
>      c != d        &&
>      e != f)       ||
>     (g = h() * i() &&
>     (j = k))
> {
>    foo();
> }
>
> (You'll be glad to hear that that's not a direct quote!)

  (when (or (and (/= a b)
                 (/= c d)
                 (/= e f))
            (and (= g (* (h)
                         (i)))
                 (= j k)))
    (foo))


-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

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


#390779

FromRichard Heathfield <rjh@cpax.org.uk>
Date2025-03-04 22:40 +0000
Message-ID<vq7vg3$21gol$3@dont-email.me>
In reply to#390778
On 04/03/2025 22:26, Kaz Kylheku wrote:
> On 2025-03-04, Richard Heathfield <rjh@cpax.org.uk> wrote:
>> On 04/03/2025 21:49, Richard Harnden wrote:
>>
>> <snip>
>>
>>>
>>> I like the brace on its own line.  It visually separates the
>>> condidition from the statement.
>>
>> Agreed.
>>
>>>
>>> How do people format long and complex conditions, given that
>>> you're trying not to a much over 80 columns?
>>
>> I like to break after a binary operator so that it is
>> syntactically obvious that the line must continue:
>>
>> if((a != b        &&
>>       c != d        &&
>>       e != f)       ||
>>      (g = h() * i() &&
>>      (j = k))
>> {
>>     foo();
>> }
>>
>> (You'll be glad to hear that that's not a direct quote!)
> 
>    (when (or (and (/= a b)
>                   (/= c d)
>                   (/= e f))
>              (and (= g (* (h)
>                           (i)))
>                   (= j k)))
>      (foo))

@  (or)
@    (output)
Take one down and pass it around...

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

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


Page 12 of 15 — ← Prev page 1 … 10 11 [12] 13 14 15  Next page →

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


csiph-web