Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #109665 > unrolled thread
| Started by | Thiago Adams <thiago.adams@gmail.com> |
|---|---|
| First post | 2017-05-10 06:29 -0700 |
| Last post | 2017-06-05 13:50 -0700 |
| Articles | 20 on this page of 364 — 31 participants |
Back to article view | Back to comp.lang.c
If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 06:29 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 15:42 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 15:36 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 17:23 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 16:40 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 22:22 +0200
Re: If statement with initializer Manfred <noname@invalid.add> - 2017-05-13 17:15 +0200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-13 21:13 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 20:40 +0100
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-13 22:30 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 22:01 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 16:20 +0200
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-15 11:53 -0400
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 22:21 +0200
Re: If statement with initializer Manfred <noname@invalid.add> - 2017-05-13 17:24 +0200
Re: If statement with initializer Philip Lantz <prl@canterey.us> - 2017-05-14 16:10 -0700
Re: If statement with initializer Manfred <noname@invalid.add> - 2017-05-15 15:54 +0200
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 06:44 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 16:38 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-15 12:49 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 15:39 +0200
Re: If statement with initializer Reinhardt Behm <rbehm@hushmail.com> - 2017-05-15 22:03 +0800
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 16:50 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-15 10:02 -0700
Re: If statement with initializer Philip Lantz <prl@canterey.us> - 2017-05-18 19:05 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 08:57 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 07:14 -0700
Re: If statement with initializer joel.rees@gmail.com - 2017-05-16 23:11 -0700
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-17 14:26 +0100
Re: If statement with initializer supercat@casperkitty.com - 2017-05-17 08:40 -0700
Re: If statement with initializer David Kleinecke <dkleinecke@gmail.com> - 2017-05-18 18:59 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 09:04 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-19 07:33 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 18:17 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-19 09:53 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 19:20 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-19 10:45 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-19 11:27 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-19 11:32 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-19 12:30 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-19 13:45 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-10 16:22 +0200
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 07:29 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-10 17:40 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-10 08:48 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 22:24 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-10 13:29 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 23:27 +0200
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 09:40 -0700
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 19:15 +0100
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 11:22 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-10 18:06 +0100
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 19:19 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-10 20:19 +0100
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-10 13:21 -0700
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 22:16 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-10 23:31 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-10 22:50 +0100
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-11 01:15 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 14:15 +0100
Re: If statement with initializer supercat@casperkitty.com - 2017-05-11 08:17 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 19:00 +0100
Re: If statement with initializer supercat@casperkitty.com - 2017-05-11 11:49 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 20:51 +0100
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-12 20:02 +1200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-12 02:01 -0500
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-13 08:54 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-13 17:45 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 13:14 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-23 09:45 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-23 18:07 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-26 15:41 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-14 16:20 -0500
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 19:14 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-14 21:54 -0500
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-15 07:01 +0200
Re: If statement with initializer Melzzzzz <Melzzzzz@zzzzz.com> - 2017-05-15 05:40 +0000
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-15 19:59 +0200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-15 18:56 -0500
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-15 09:31 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 06:55 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 10:33 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 10:54 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-15 12:00 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-16 05:11 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-17 08:24 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-19 18:43 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-20 22:06 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-26 15:54 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-27 11:06 +1200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-15 19:15 -0500
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-16 12:54 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-17 00:12 -0500
Re: If statement with initializer supercat@casperkitty.com - 2017-05-17 08:15 -0700
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-17 15:46 +0000
Re: If statement with initializer supercat@casperkitty.com - 2017-05-17 08:57 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-17 09:45 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-17 10:09 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-17 11:37 -0500
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-18 07:24 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-23 09:42 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-23 10:44 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 12:16 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 11:49 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 15:21 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 15:14 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 17:04 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-12 08:27 -0700
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 05:03 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 14:29 +0100
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-12 20:04 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 13:27 -0700
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-11 21:56 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-11 23:27 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 00:26 +0100
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-12 01:16 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 01:35 +0100
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-12 01:58 +0100
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-12 22:36 +0200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-12 22:19 +0200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-12 22:06 +0200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-12 02:09 +0200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-12 22:38 +0200
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-12 17:15 -0400
Re: If statement with initializer supercat@casperkitty.com - 2017-05-12 15:10 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-13 00:02 -0500
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 08:41 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-13 09:11 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 00:59 +0200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-13 00:04 -0500
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 13:17 +0200
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-13 06:37 -0700
Re: If statement with initializer James Kuyper <jameskuyper@verizon.net> - 2017-05-13 10:29 -0400
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 18:14 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-13 14:04 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 23:44 +0200
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-13 18:22 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 04:49 +0200
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-13 20:23 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 05:40 +0200
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-14 06:42 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 16:30 +0200
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-16 08:19 -0700
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-18 17:22 -0400
Re: If statement with initializer supercat@casperkitty.com - 2017-05-18 15:00 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-18 16:20 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-18 16:33 -0700
Re: If statement with initializer luser droog <luser.droog@gmail.com> - 2017-05-18 15:58 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-18 16:24 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 09:13 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-21 17:30 +0000
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-14 12:40 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-14 00:18 -0500
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 14:45 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 00:08 -0700
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-14 10:51 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 14:32 -0700
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 11:37 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-14 13:40 +0100
Re: If statement with initializer Manfred <invalid@invalid.add> - 2017-05-14 16:03 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-14 16:04 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-14 16:27 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 15:26 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-15 17:14 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 08:55 -0700
Re: If statement with initializer Gareth Owen <gwowen@gmail.com> - 2017-05-15 19:10 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-16 04:29 -0700
Re: If statement with initializer Gareth Owen <gwowen@gmail.com> - 2017-05-16 18:46 +0100
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-17 08:40 +1200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-19 19:07 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-20 22:04 +1200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-14 11:09 +0200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 15:05 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 14:55 -0700
Re: If statement with initializer Alan Mackenzie <acm@muc.de> - 2017-05-12 16:25 +0000
Re: If statement with initializer joel.rees@gmail.com - 2017-05-10 16:45 -0700
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 05:07 -0700
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 05:10 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-11 14:29 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-15 12:55 +0000
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 08:37 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 23:03 +0200
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-15 22:12 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 23:29 +0200
Re: If statement with initializer Melzzzzz <Melzzzzz@zzzzz.com> - 2017-05-15 21:32 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 12:23 +0200
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-16 13:29 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 14:48 +0200
Re: If statement with initializer Manfred <invalid@invalid.add> - 2017-05-17 00:22 +0200
Re: If statement with initializer Manfred <invalid@invalid.add> - 2017-05-16 01:27 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 16:34 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 00:58 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 12:32 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-16 08:59 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 22:28 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-16 14:20 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-17 10:24 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-17 10:42 -0700
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-24 08:14 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-16 17:31 +1200
Re: If statement with initializer Melzzzzz <Melzzzzz@zzzzz.com> - 2017-05-15 21:31 +0000
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-15 22:39 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-17 10:52 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-17 23:14 +0200
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-18 18:24 +1200
Re: If statement with initializer joel.rees@gmail.com - 2017-05-18 05:43 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-18 15:13 +0200
Re: If statement with initializer joel.rees@gmail.com - 2017-05-18 08:52 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-18 22:18 +0200
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-19 08:29 +1200
Re: If statement with initializer DFS <nospam@dfs.com> - 2017-05-18 21:59 -0400
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-19 19:30 +1200
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-19 12:34 +0000
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-19 06:37 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-18 22:09 -0500
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-18 13:59 +0000
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-18 09:21 -0700
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-18 12:55 -0400
Re: If statement with initializer joel.rees@gmail.com - 2017-05-19 01:17 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-19 12:16 +0200
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-19 11:58 +0100
Re: If statement with initializer joel.rees@gmail.com - 2017-05-20 03:20 -0700
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-20 15:18 +0100
Re: If statement with initializer James Kuyper <jameskuyper@verizon.net> - 2017-05-20 10:55 -0400
Re: If statement with initializer joel.rees@gmail.com - 2017-05-21 01:29 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-21 20:39 +1200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-21 14:15 +0200
Re: If statement with initializer James Kuyper <jameskuyper@verizon.net> - 2017-05-21 15:29 -0400
Re: If statement with initializer joel.rees@gmail.com - 2017-05-22 23:38 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-23 00:16 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-23 19:26 +1200
Re: If statement with initializer joel.rees@gmail.com - 2017-05-23 16:25 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-24 20:38 +1200
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-23 09:33 +0200
Re: If statement with initializer James Kuyper <jameskuyper@verizon.net> - 2017-05-23 08:00 -0400
Re: If statement with initializer supercat@casperkitty.com - 2017-05-23 08:27 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-24 07:17 +1200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-23 12:28 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-24 10:04 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-24 16:30 +0000
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-24 15:01 -0400
Re: If statement with initializer supercat@casperkitty.com - 2017-05-24 13:04 -0700
Re: If statement with initializer joel.rees@gmail.com - 2017-05-24 14:55 -0700
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-24 16:23 -0700
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-21 18:01 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-22 10:04 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-24 08:10 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-24 17:54 +0200
Re: If statement with initializer "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-19 12:39 -0400
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-24 07:55 -0700
Re: If statement with initializer Ike Naar <ike@iceland.freeshell.org> - 2017-05-17 21:14 +0000
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-21 17:34 +0000
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-21 19:40 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-22 10:13 +0200
Re: If statement with initializer Gareth Owen <gwowen@gmail.com> - 2017-05-15 22:16 +0100
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-17 11:44 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-17 23:30 +0200
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-18 18:30 +1200
Re: If statement with initializer joel.rees@gmail.com - 2017-05-18 06:04 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-18 17:29 +0200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-17 23:37 +0200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-15 18:41 -0500
Re: If statement with initializer "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-05-15 17:39 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 12:35 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-17 11:50 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-15 19:17 +0200
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-15 17:57 +0000
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-15 18:51 -0500
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-16 13:17 +0000
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 14:29 +0100
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-16 14:50 +0000
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 16:35 +0100
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-16 17:33 +0100
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-21 18:05 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 17:29 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-11 09:10 -0700
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 09:49 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 18:51 +0100
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 11:19 -0700
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-11 18:31 +0000
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-11 11:59 -0700
Re: If statement with initializer David Kleinecke <dkleinecke@gmail.com> - 2017-05-11 12:58 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-11 21:18 +0100
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 13:45 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-12 20:08 +1200
Re: If statement with initializer Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-12 01:37 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 12:08 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 15:31 +0200
Re: If statement with initializer Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-12 07:03 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 15:21 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 17:06 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-12 16:36 +0100
Re: If statement with initializer David Kleinecke <dkleinecke@gmail.com> - 2017-05-12 11:58 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 17:03 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-14 16:15 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 23:25 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-14 13:55 -0700
Re: If statement with initializer Gareth Owen <gwowen@gmail.com> - 2017-05-15 19:00 +0100
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-14 13:38 +0000
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-14 16:42 +0200
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 17:07 +0200
Re: If statement with initializer Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-14 08:12 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 23:27 +0200
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-15 16:59 +1200
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-15 11:33 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-15 12:59 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 12:34 +0200
Re: If statement with initializer David Kleinecke <dkleinecke@gmail.com> - 2017-05-12 11:48 -0700
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-13 07:41 +1200
Re: If statement with initializer David Kleinecke <dkleinecke@gmail.com> - 2017-05-12 17:38 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 01:23 +0200
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-13 08:55 +0200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-13 13:24 +0200
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-13 14:53 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 17:10 +0200
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-15 12:56 +0000
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-15 07:15 -0700
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-11 13:49 -0500
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-11 21:57 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-11 13:11 -0700
Re: If statement with initializer "Patrick.Schluter" <Patrick.Schluter@free.fr> - 2017-05-11 22:21 +0200
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-11 13:56 -0700
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 12:42 +0200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-11 15:44 -0500
Re: If statement with initializer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-11 23:13 +0100
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-12 16:16 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 12:35 +0200
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-12 11:41 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-12 17:27 +0200
Re: If statement with initializer Robert Wessel <robertwessel2@yahoo.com> - 2017-05-12 10:57 -0500
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-14 17:15 +0200
Re: If statement with initializer joel.rees@gmail.com - 2017-05-12 06:55 -0700
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-15 12:35 +0000
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-16 07:41 +1200
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-15 21:46 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-15 21:36 +0100
Re: If statement with initializer Thiago Adams <thiago.adams@gmail.com> - 2017-05-15 13:44 -0700
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-15 14:23 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 14:36 -0700
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-15 15:27 -0700
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 16:21 -0700
Re: If statement with initializer jameskuyper@verizon.net - 2017-05-16 07:47 -0700
Re: If statement with initializer GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-05-15 23:39 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-15 15:42 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 00:03 +0100
Re: If statement with initializer Ian Collins <ian-news@hotmail.com> - 2017-05-16 17:33 +1200
Re: If statement with initializer Richard Heathfield <rjh@cpax.org.uk> - 2017-05-16 12:03 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 14:34 +0200
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 14:20 +0100
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 17:37 +0200
Re: If statement with initializer Keith Thompson <kst-u@mib.org> - 2017-05-16 09:10 -0700
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 17:26 +0100
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 19:28 +0100
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-16 18:53 +0000
Re: If statement with initializer bartc <bc@freeuk.com> - 2017-05-16 20:17 +0100
Re: If statement with initializer scott@slp53.sl.home (Scott Lurndal) - 2017-05-16 20:03 +0000
Re: If statement with initializer David Brown <david.brown@hesbynett.no> - 2017-05-16 22:34 +0200
Re: If statement with initializer supercat@casperkitty.com - 2017-05-15 14:24 -0700
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-24 20:49 +0000
Re: If statement with initializer supercat@casperkitty.com - 2017-05-24 14:11 -0700
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-05-24 21:37 +0000
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-26 15:52 -0700
Re: If statement with initializer raltbos@xs4all.nl (Richard Bos) - 2017-06-03 10:20 +0000
Re: If statement with initializer Tim Rentsch <txr@alumni.caltech.edu> - 2017-06-05 13:50 -0700
Page 9 of 19 — ← Prev page 1 … 7 8 [9] 10 11 … 19 Next page →
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-05-14 16:04 +0100 |
| Message-ID | <9m_RA.52577$xr3.12348@fx43.am4> |
| In reply to | #109950 |
On 14/05/2017 15:03, Manfred wrote:
> On 05/14/2017 02:40 PM, bartc wrote:
>> So it is useful to keep code uncluttered of such declarations. This is
>> the case more generally too, for separating an algorithm from the
>> fiddly details of its implementation.
> I think, FWIW, that the variables and their types required by an
> algorithm are an essential part of the algorithm itself, better kept
> coupled with it.
The algorithm will still have the variables (assuming you are using some
universally understood notation), but the types can usually be inferred
from the initial assignments or shown in an accompanying, but separate,
annotation.
If you started putting C++-style declarations amongst the code then you
can forget about to trying to easily understand what it's trying to do.
>> But C-style block scopes also introduce another factor, which is
>> needing to match a particular identifier with a specific declaration
>> and a certain scope. This is an extra distraction.
>>
> In many cases, for me this would not be a distraction, since the
> "certain scope" would be the /current/ scope.
{ int a;
{ int b,A;
{ int c;
a = b + c;
int a,b,c;
}
}
}
What's the 'current scope' on the a=b+c line? It's not tidily
delineated. You have to keep constructing such an enclosing envelope,
and it's associated context of declared entities, for every expression.
--
bartc
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-05-14 16:27 +0100 |
| Message-ID | <8H_RA.34100$2_3.21366@fx45.am4> |
| In reply to | #109958 |
On 14/05/2017 16:04, bartc wrote:
> { int a;
> { int b,A;
> { int c;
> a = b + c;
> int a,b,c;
Actually the last c is not allowed as there are two declarations of it
without intervening braces.
Which highlights another problem as you have to look more carefully to
see if repeated declarations like this are legal or not.
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-05-14 15:26 -0700 |
| Message-ID | <kfnk25joz11.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #109938 |
Ben Bacarisse <ben.usenet@bsb.me.uk> writes: > Tim Rentsch <txr@alumni.caltech.edu> writes: > <snip> >> I have read through the comments in this thread with much >> interest. Sometime after seeing this posting I thought I would >> go through some code on a similar venture to the one described >> above. I have enough experience with both styles so that I >> didn't feel a need to make changes, but I wanted to see where and >> how big the differences would be. I looked at sources from two >> different projects: one, a fair number of functions that had >> been written under C90 rules; and two, to add some perspective, >> a single, rather complex, function that had been written under >> C99 rules. > > Did any of the code strictly follow bartc's rules? He abjures even > declarations in blocks other than the function body. No, the code routinely made use of variable declarations in nested blocks, in nearly all cases where the function's structure allowed doing so. (Also, whether by coincidence or not, all those nested declarations had initializers.) > <snip the details> > >> After all of that, what are my conclusions? I think the main >> conclusions are these: >> >> One: I normally read function bodies "all at once" rather >> than a line at a time. For me reading a function means >> getting the whole function body in my head so I can think >> about all of it at the same time. >> >> Two: As both a cause and effect of the above, I very strongly >> prefer functions be kept short, and that have been kept short. >> >> Three: If function bodies are short, declaration placement >> doesn't matter so much. >> >> Four: There are several competing factors for where to put >> declarations. Some favor putting declarations in one place, >> some favor a different placement. Neither choice is right >> in all cases; nor does one seem to predominate. >> >> Five: As a corollary to (three) and (four), if refactoring >> needs to be done, focusing on function length is more likely >> to give a better ROI than moving declarations around. > > I've not done this exercise, but I think I'd probably come to the same > conclusions. I might have a different view of point five if the code > had no declarations in nested scopes (i.e. was full-on bartc style), but > even then I suspect I'd be more interested in function size. If I were looking at code that never used declarations in nested scopes, even in places where it clearly could have, there's a good chance I would take a first pass over the code to do that (this is assuming of course some sort of refactoring is on the agenda). My reasoning is (a) it's low cost, (b) it's low risk, and (c) is likely to help subsequent changes be easier and more reliable. Without actually trying it I can't say for sure, but I suspect that would hold over a broad range of function size distribution, ie, as long as functions were large enough so that they had more than just a few nested scopes as candidates.
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2017-05-15 17:14 +1200 |
| Message-ID | <ensrq2FrasmU2@mid.individual.net> |
| In reply to | #109933 |
On 05/14/17 07:08 PM, Tim Rentsch wrote:
<snip>
> What makes the function interesting is four related variables,
> let me call them a, b, x, and y. In the main flow of the
> algorithm, x and y are set based on the value of a parameter, and
> a and b are then set based on the values of x and y. However,
> for a small subset of input values, there is fast path that only
> sets 'a' (and then falls into some subsequent code). Practically
> speaking the variable a must be declared before being given its
> initial value. The question is what to do about the other three
> related variables. Should they be declared parallel to a,
> reflecting their relationship to a in the main line of the
> algorithm? Or should they be declared separately, in only the
> "slow path" of the algorithm, even though that is the predominate
> case? (Note: the fast path is solely about performance - the
> slow path always works, it just runs slower than the fast path.)
> The code could be written either way. Ultimately I decided that
> it made more sense to declare a, b, x, and y all together, even
> though b, x, and y could have been declared more locally (and
> clearly the function being fairly small played a significant
> part in that decision). I think either decision is plausible, as
> they both have their plusses and minuses, but on balance grouping
> them all together seems like a better fit. I expect other people
> would make a different decision.
>
> After all of that, what are my conclusions? I think the main
> conclusions are these:
>
> One: I normally read function bodies "all at once" rather
> than a line at a time. For me reading a function means
> getting the whole function body in my head so I can think
> about all of it at the same time.
>
> Two: As both a cause and effect of the above, I very strongly
> prefer functions be kept short, and that have been kept short.
>
> Three: If function bodies are short, declaration placement
> doesn't matter so much.
>
> Four: There are several competing factors for where to put
> declarations. Some favor putting declarations in one place,
> some favor a different placement. Neither choice is right
> in all cases; nor does one seem to predominate.
>
> Five: As a corollary to (three) and (four), if refactoring
> needs to be done, focusing on function length is more likely
> to give a better ROI than moving declarations around.
>
> And now I look forward to hearing all the kind responses and
> rebuttals. :)
Interesting analysis.
No rebuttals, just follow-ups to a couple of the points raised.
Firstly mention of the "fast path" through the code: a generalisation of
this, checking preconditions, is one of the reasons I prefer the C99
style. I like to start functions with precondition checks like:
int someFn( int* p, int n )
{
if( !p )
{
return nullPointerError;
}
if( n == someInvalidValue )
{
return someInvalidValueError;
}
// Guts of function
}
Yes, you can do this with if/else blocks in C90, but I find the newer
style clearer and it minimises right creep.
Secondly the mention of refactoring larger functions: if the variables
are declared where they are first used, they are more likely to be in
the block of code you want to extract. Probably a minor benefit, but
one none the less.
A final observation form my own work on many code bases is that the
functions that need refactoring into multiple functions tend to be those
with all of the variables at the top, which makes the process harder..
--
Ian
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-05-15 08:55 -0700 |
| Message-ID | <kfn60h2nmhi.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #109999 |
Ian Collins <ian-news@hotmail.com> writes:
> On 05/14/17 07:08 PM, Tim Rentsch wrote:
>
> <snip>
>
>> What makes the function interesting is four related variables,
>> let me call them a, b, x, and y. In the main flow of the
>> algorithm, x and y are set based on the value of a parameter, and
>> a and b are then set based on the values of x and y. However,
>> for a small subset of input values, there is fast path that only
>> sets 'a' (and then falls into some subsequent code). Practically
>> speaking the variable a must be declared before being given its
>> initial value. [...]
> [re:] the "fast path" through the code: a generalisation of this,
> checking preconditions, is one of the reasons I prefer the C99
> style. [...]
Actually that isn't a generalization, but I guess my description
wasn't clear enough. Written in very rough pseudo-code, the
function I was talking about looks like this
(declaration of a, and some other stuff)
if (fast path okay) then
a = ...
(a small amount of related computation)
else
x = ...
y = ...
b = ...
a = ...
(complicated computation that changes a)
fi
do
(do something based on a)
(update a for next iteration)
while (loop test)
return (value calculated as part of if condition)
The "fast path" and the "slow path" both fall into common code
after the if/else. It may have sounded like the "fast path"
did an early return, but that is not the case.
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2017-05-15 19:10 +0100 |
| Message-ID | <87mvae3s9z.fsf@gmail.com> |
| In reply to | #110048 |
Tim Rentsch <txr@alumni.caltech.edu> writes:
> (declaration of a, and some other stuff)
>
> if (fast path okay) then
> a = ...
> (a small amount of related computation)
> else
> x = ...
> y = ...
> b = ...
> a = ...
> (complicated computation that changes a)
> fi
>
> do
> (do something based on a)
> (update a for next iteration)
> while (loop test)
>
> return (value calculated as part of if condition)
My inclination for refactoring this would be
if (fast path okay)
a =
(a small amount of related computation)
else
a = do_slow_path_as_function_maybe_inlined()
fi
do
stuff
while (criterion)
return whatever
but that seems so close to the original as no matter.
I tend to scope as narrowly as possible, and now when I see
if() {
// some stuff;
} else {
int whatever, variables;
char * we, need;
// other stuff
}
my mind has been trained to say "Should that block with the all those
extra variables actually be a subroutine"?
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-05-16 04:29 -0700 |
| Message-ID | <kfnd1b9m44z.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #110061 |
Gareth Owen <gwowen@gmail.com> writes:
> Tim Rentsch <txr@alumni.caltech.edu> writes:
>
>> (declaration of a, and some other stuff)
>>
>> if (fast path okay) then
>> a = ...
>> (a small amount of related computation)
>> else
>> x = ...
>> y = ...
>> b = ...
>> a = ...
>> (complicated computation that changes a)
>> fi
>>
>> do
>> (do something based on a)
>> (update a for next iteration)
>> while (loop test)
>>
>> return (value calculated as part of if condition)
>
> My inclination for refactoring this would be
>
>
> if (fast path okay)
> a =
> (a small amount of related computation)
> else
> a = do_slow_path_as_function_maybe_inlined()
> fi
>
>
> do
> stuff
> while (criterion)
>
> return whatever
A quite reasonable reaction, given the earlier description. It
doesn't work well in the actual source, for reasons that aren't
apparent in the (very rough!) pseudo-code rendition, but it
might have under different circumstances.
> but that seems so close to the original as no matter.
> I tend to scope as narrowly as possible, and now when I see
>
> if() {
> // some stuff;
> } else {
> int whatever, variables;
> char * we, need;
> // other stuff
> }
>
> my mind has been trained to say "Should that block with the all
> those extra variables actually be a subroutine"?
I often have a similar reaction but for somewhat different
reasons. My heuristic compares the relative level of detail in
the two branches (or that of the branches and the rest of the
function. If the disparity is too large -- that is, if one piece
of code has a level of detail that is much higher than code
elsewhere in the function -- then that piece of code usually
should be pushed off to a subroutine, if possible. I think the
most common problem I see reviewing source code generally is
function bodies that cross too many levels of detail. A big
disparity between branches of an if/else is one example of
that (ie, a situation that might merit refactoring).
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2017-05-16 18:46 +0100 |
| Message-ID | <87o9us3d9w.fsf@gmail.com> |
| In reply to | #110130 |
Tim Rentsch <txr@alumni.caltech.edu> writes: > A quite reasonable reaction, given the earlier description. It > doesn't work well in the actual source, for reasons that aren't > apparent in the (very rough!) pseudo-code rendition, but it > might have under different circumstances. I suspected that might be the case. > I often have a similar reaction but for somewhat different > reasons. My heuristic compares the relative level of detail in > the two branches (or that of the branches and the rest of the > function. If the disparity is too large -- that is, if one piece > of code has a level of detail that is much higher than code > elsewhere in the function -- then that piece of code usually > should be pushed off to a subroutine, if possible Completely agree.
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2017-05-17 08:40 +1200 |
| Message-ID | <eo16djFrasmU8@mid.individual.net> |
| In reply to | #110130 |
On 05/16/17 11:29 PM, Tim Rentsch wrote:
> Gareth Owen <gwowen@gmail.com> writes:
>
>
>> but that seems so close to the original as no matter.
>> I tend to scope as narrowly as possible, and now when I see
>>
>> if() {
>> // some stuff;
>> } else {
>> int whatever, variables;
>> char * we, need;
>> // other stuff
>> }
>>
>> my mind has been trained to say "Should that block with the all
>> those extra variables actually be a subroutine"?
>
> I often have a similar reaction but for somewhat different
> reasons. My heuristic compares the relative level of detail in
> the two branches (or that of the branches and the rest of the
> function.
In addition to detail (I tend to see it a balance), I also like to add a
degree of narrative to the heuristic. If extracting the function makes
the narrative of this function easier to follow, do it.
For example given
if (some condition)
{
// bunch of code to process condition A
...
}
else
{
// bunch of code to process condition B
...
}
I prefer to see
if (some condition)
{
processConditionA();
}
else
{
processConditionB();
}
So I'm not distracted by the processing code. If I want to read it, I
know where I can see it. If I don't, it doesn't get in the way of
reading the current function.
--
Ian
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-05-19 19:07 -0700 |
| Message-ID | <kfnpof4jn5x.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #110180 |
Ian Collins <ian-news@hotmail.com> writes:
> On 05/16/17 11:29 PM, Tim Rentsch wrote:
>> Gareth Owen <gwowen@gmail.com> writes:
>>
>>
>>> but that seems so close to the original as no matter.
>>> I tend to scope as narrowly as possible, and now when I see
>>>
>>> if() {
>>> // some stuff;
>>> } else {
>>> int whatever, variables;
>>> char * we, need;
>>> // other stuff
>>> }
>>>
>>> my mind has been trained to say "Should that block with the all
>>> those extra variables actually be a subroutine"?
>>
>> I often have a similar reaction but for somewhat different
>> reasons. My heuristic compares the relative level of detail in
>> the two branches (or that of the branches and the rest of the
>> function.
>
> In addition to detail (I tend to see it a balance), I also like to add
> a degree of narrative to the heuristic. If extracting the function
> makes the narrative of this function easier to follow, do it.
>
> For example given
>
> if (some condition)
> {
> // bunch of code to process condition A
> ...
> }
> else
> {
> // bunch of code to process condition B
> ...
> }
>
> I prefer to see
>
> if (some condition)
> {
> processConditionA();
> }
> else
> {
> processConditionB();
> }
>
> So I'm not distracted by the processing code. If I want to read it, I
> know where I can see it. If I don't, it doesn't get in the way of
> reading the current function.
I think what you're talking about is a little bit different than
what I'm talking about. Now I'm guessing what you mean by "make
the narrative better", but if I have understood you then what I
have is a heuristic for /predicting/ whether the narrative will get
better. If I knew the narrative would get better then I wouldn't
need the heuristic! So I'm not sure if I have misunderstood you or
if we're talking about different things, or what.
In the example you give (re-written as pseudo-code):
IF relevant test
.. glob of code when test is TRUE
ELSE
.. glob of code when test is FALSE
FI
and assuming that some revising looks called for, whether I would
choose to subroutine-ize one branch or both branches would be
influenced a lot by what's in the globs. I don't have a general
rule like subroutine-ize neither or both.
(Let me be clear that I really don't know if this is what you
were trying to say; I'm not trying to put words in your mouth,
just describe my own reactions.)
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2017-05-20 22:04 +1200 |
| Message-ID | <eoaim7Fp50iU2@mid.individual.net> |
| In reply to | #110437 |
On 05/20/17 02:07 PM, Tim Rentsch wrote:
> Ian Collins <ian-news@hotmail.com> writes:
>
>> On 05/16/17 11:29 PM, Tim Rentsch wrote:
>>>
>>> I often have a similar reaction but for somewhat different
>>> reasons. My heuristic compares the relative level of detail in
>>> the two branches (or that of the branches and the rest of the
>>> function.
>>
>> In addition to detail (I tend to see it a balance), I also like to add
>> a degree of narrative to the heuristic. If extracting the function
>> makes the narrative of this function easier to follow, do it.
>>
>> For example given
>>
>> if (some condition)
>> {
>> // bunch of code to process condition A
>> ...
>> }
>> else
>> {
>> // bunch of code to process condition B
>> ...
>> }
>>
>> I prefer to see
>>
>> if (some condition)
>> {
>> processConditionA();
>> }
>> else
>> {
>> processConditionB();
>> }
>>
>> So I'm not distracted by the processing code. If I want to read it, I
>> know where I can see it. If I don't, it doesn't get in the way of
>> reading the current function.
>
> I think what you're talking about is a little bit different than
> what I'm talking about. Now I'm guessing what you mean by "make
> the narrative better", but if I have understood you then what I
> have is a heuristic for /predicting/ whether the narrative will get
> better. If I knew the narrative would get better then I wouldn't
> need the heuristic! So I'm not sure if I have misunderstood you or
> if we're talking about different things, or what.
>
> In the example you give (re-written as pseudo-code):
>
> IF relevant test
> .. glob of code when test is TRUE
> ELSE
> .. glob of code when test is FALSE
> FI
>
> and assuming that some revising looks called for, whether I would
> choose to subroutine-ize one branch or both branches would be
> influenced a lot by what's in the globs. I don't have a general
> rule like subroutine-ize neither or both.
>
> (Let me be clear that I really don't know if this is what you
> were trying to say; I'm not trying to put words in your mouth,
> just describe my own reactions.)
I think you have the gist of what I was saying. I often write my code
starting with the higher level steps of function, so I often end up with
functions for even short globs. So I would start with the function
calls rather than than extracting them later.
--
Ian
[toc] | [prev] | [next] | [standalone]
| From | "Patrick.Schluter" <Patrick.Schluter@free.fr> |
|---|---|
| Date | 2017-05-14 11:09 +0200 |
| Message-ID | <59181ee6$0$10204$426a34cc@news.free.fr> |
| In reply to | #109774 |
Le 11.05.2017 à 21:56, Patrick.Schluter a écrit : > I'm currently in the process of replacing systematically on our porject > the style of declaration, from the standard C way to the new C99 in-code > declarations. What I have notices during that process is that > > - the code always gets shorter (1 line of declaration +1 line first > usage gets replaced by 1 line of declaration with initialisation. > - this often leads to some optimisations as very often the old > declarations initialised the variables for no reason. > - I've found several bugs in the code where variables got mixed up in > big functions. > - for loop declared variables allows to copy paste code more easily. > - refactoring long functions in to several smaller ones becomes order of > magnitude easier if you declare the variable where it is used. I was > surprized to see how often a variable was declared at the beginning and > only used twice at the end of the function in a very unlikely error path. > > The funny thing is that doing that has brought the need for the if( with > declaration as the pattern of > > type var = call(); > if(var == somethin) callsomething(var); > > is really very frequent. > > What I forgot to mention there were some cases where that transformation uncovered subtle bugs. The bug could have also been diagnosticised by the compiler if the variable hadn't been initialised, the position of the declaration was not the problem in that case, only the initial value. By systematically initialising a variable in the head of a function (to 0 or NULL), the compiler was not able to do a proper life time analysis of the variable and wouldn't emit the warning that a variable was used before it had a proper value. These cases were not frequent but often enough that I start to think that often given advice to always initialise auto variables to not be such a good idea. The C99 declaration as you go has the advantage that you can now bind the declaration of the variable with the right initial value. A thing that was not always possible before (vla, variables in initialisers and compound statements help also in these cases).
[toc] | [prev] | [next] | [standalone]
| From | GOTHIER Nathan <nathan.gothier@gmail.com> |
|---|---|
| Date | 2017-05-14 15:05 +0200 |
| Message-ID | <20170514150508.735c7dcc6fe3ab0fa0b1d902@gmail.com> |
| In reply to | #109935 |
On Sun, 14 May 2017 11:09:59 +0200 "Patrick.Schluter" <Patrick.Schluter@free.fr> wrote: > These cases were not frequent but often enough that I start to think > that often given advice to always initialise auto variables to not be > such a good idea. The bad idea is to allocate an useless memory space filled with dumb data at the wrong time. Thus the necessity to initialize any object only when it should have to be (i.e. the first time) at the best scope (cf. recursion).
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-05-14 14:55 -0700 |
| Message-ID | <kfno9uvp0gi.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #109935 |
"Patrick.Schluter" <Patrick.Schluter@free.fr> writes: > Le 11.05.2017 at 21:56, Patrick.Schluter a ecrit : >> I'm currently in the process of replacing systematically on our porject >> the style of declaration, from the standard C way to the new C99 in-code >> declarations. What I have notices during that process is that >> >> - the code always gets shorter (1 line of declaration +1 line first >> usage gets replaced by 1 line of declaration with initialisation. >> - this often leads to some optimisations as very often the old >> declarations initialised the variables for no reason. >> - I've found several bugs in the code where variables got mixed up in >> big functions. >> - for loop declared variables allows to copy paste code more easily. >> - refactoring long functions in to several smaller ones becomes order of >> magnitude easier if you declare the variable where it is used. I was >> surprized to see how often a variable was declared at the beginning and >> only used twice at the end of the function in a very unlikely error path. >> >> The funny thing is that doing that has brought the need for the if( with >> declaration as the pattern of >> >> type var = call(); >> if(var == somethin) callsomething(var); >> >> is really very frequent. > > What I forgot to mention there were some cases where that > transformation uncovered subtle bugs. The bug could have also been > diagnosticised by the compiler if the variable hadn't been > initialised, the position of the declaration was not the problem in > that case, only the initial value. > > By systematically initialising a variable in the head of a function > (to 0 or NULL), the compiler was not able to do a proper life time > analysis of the variable and wouldn't emit the warning that a variable > was used before it had a proper value. > > These cases were not frequent but often enough that I start to think > that often given advice to always initialise auto variables to not be > such a good idea. My practice is not to initialize variables with "empty" values, for just this very reason. > The C99 declaration as you go has the advantage that you can now bind > the declaration of the variable with the right initial value. Something I think is interesting is that this has always been possible, by starting a new block, but even so it is (and was) almost never done. To me that suggests that the capability isn't so important as some would have us believe. Also, I believe it's possible to initialize variables with their "right" initial values, even following C90 declaration placement, a lot more often than most people do, by taking advantage of conditional operators (and sometimes other "tricks"). A big part of the problem is not technical but cultural. > A thing > that was not always possible before (vla, variables in initialisers > and compound statements help also in these cases). Compound statements - no question. VLA - they avoid having to use malloc() - what else do they do (if anything)? Variables in initializers - do you mean non-constant values in aggregate initializers? If not then what do you mean?
[toc] | [prev] | [next] | [standalone]
| From | Alan Mackenzie <acm@muc.de> |
|---|---|
| Date | 2017-05-12 16:25 +0000 |
| Message-ID | <of4nlm$2adu$1@news.muc.de> |
| In reply to | #109705 |
bartc <bc@freeuk.com> wrote: > On 10/05/2017 19:19, Ben Bacarisse wrote: >> bartc <bc@freeuk.com> writes: >>> Not me. I prefer declarations all tucked away in a corner so they >>> don't clutter up the code. >> I prefer to have my scopes all tucked away so the names don't clutter up >> the rest of the code. That way I have smaller regions of code to verify. > Then it means having to analyse every line back to the start of the > function to find the declaration of some variable. Just in case it might > have been declared somewhere in between. With the right tool, i.e. an editor that highlights declarations, this is not an onerous task. [ .... ] > -- > bartc -- Alan Mackenzie (Nuremberg, Germany).
[toc] | [prev] | [next] | [standalone]
| From | joel.rees@gmail.com |
|---|---|
| Date | 2017-05-10 16:45 -0700 |
| Message-ID | <f83fef09-67f6-4f2d-a2cd-c207eba4f030@googlegroups.com> |
| In reply to | #109691 |
On Thursday, May 11, 2017 at 2:06:28 AM UTC+9, Bart wrote:
> On 10/05/2017 14:29, Thiago Adams wrote:
> >
> > C++ 17, has now a new if.
> >
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r0.html
> >
> > if ( for-init-statement condition ) statement
> >
> > is equivalent to
> >
> > {
> > for-init-statement
> > if ( condition ) statement
> > }
> >
> > and
> >
> > if ( for-init-statement condition ) statement else statement
> >
> > is equivalent to
> >
> > {
> > for-init-statement
> > if ( condition ) statement else statement
> > }
> >
> > Would you like to see this if on C?
>
> Not me. I prefer declarations all tucked away in a corner so they don't
> clutter up the code.
>
> People complain about Hungarian notation but this doesn't seem much
> different.
>
> Besides, this can be done now with {} either surrounding the if
> statement (assuming the scope extends to the end of the second
> statement), or inside the condition using the gcc extension.
>
> --
> bartc
{ int ch;
if ( ( ch = getchar() ) == EOF )
break;
...
buffer[ i++ ] = ch;
...
}
As opposed to
if ( getchar() == EOF ) { ... }
If I'm going to go to the trouble of explicitly saving a result, I think I want the result.
If I want to throw it away, I want to throw it away.
On the for loop, providing explicit loop variables does make the syntax useful.
--
Joel Rees
Ranting randomly:
http://reiisi.blogspot.com
[toc] | [prev] | [next] | [standalone]
| From | Thiago Adams <thiago.adams@gmail.com> |
|---|---|
| Date | 2017-05-11 05:07 -0700 |
| Message-ID | <195ea05a-4289-4a6f-a290-736d929d408e@googlegroups.com> |
| In reply to | #109665 |
On Wednesday, May 10, 2017 at 10:29:40 AM UTC-3, Thiago Adams wrote: > C++ 17, has now a new if. [...] One more: Single-Quotation-Mark as a Digit Separator http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf int i = 1'000'000; What I find weird is that the position of ' is not verified. "An integer literal is a sequence of digits that has no period or exponent part, with optional separating single quotes that are ignored when determining its value"
[toc] | [prev] | [next] | [standalone]
| From | Thiago Adams <thiago.adams@gmail.com> |
|---|---|
| Date | 2017-05-11 05:10 -0700 |
| Message-ID | <5009a013-2fda-40e6-8f5b-a860a377342c@googlegroups.com> |
| In reply to | #109745 |
On Thursday, May 11, 2017 at 9:07:25 AM UTC-3, Thiago Adams wrote: > On Wednesday, May 10, 2017 at 10:29:40 AM UTC-3, Thiago Adams wrote: > > C++ 17, has now a new if. > [...] > One more: Binary Literals in the C++ Core Language http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf int i = 0b1100; (I liked this)
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2017-05-11 14:29 +0200 |
| Message-ID | <of1l8n$rur$1@dont-email.me> |
| In reply to | #109746 |
On 11/05/17 14:10, Thiago Adams wrote: > On Thursday, May 11, 2017 at 9:07:25 AM UTC-3, Thiago Adams wrote: >> On Wednesday, May 10, 2017 at 10:29:40 AM UTC-3, Thiago Adams wrote: >>> C++ 17, has now a new if. >> [...] >> One more: > > Binary Literals in the C++ Core Language > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf > > int i = 0b1100; > > (I liked this) > Many compilers support that as an extension (in C and C++). Indeed, C++ picked it up as a feature that existing tools had supported for years, users found useful, and there were no conflicts with anything else in the language. So it was a cheap and easy addition to the C++ standards. Apparently in the C world, we are supposed to define our own macros of various levels of ugliness and odd restrictions, and use them. Since it is /possible/ to use macros to write binary literals, it does not need to be added to the language. Yes, /I/ would like to see it added to C - and I truly believe it would have negligible costs. I appreciate that one of the aims of C is to keep the language small and stable, and let C++ be the relative with all the latest bells and whistles. But this would be a couple of paragraphs to add to the standard - and /nothing/ to change in the major compiler implementations. Binary constants are easier to write when there is a digit separator. The choice of ' is not pretty, but all the better alternatives have disadvantages. I'd be happy to see that in C too, and would use it occasionally. Both these changes are zero cost to the user - the don't affect existing correct code, they don't introduce new ways to get things wrong, they can be safely ignored if you don't need them, and they are easily understood when you see them for the first time.
[toc] | [prev] | [next] | [standalone]
| From | raltbos@xs4all.nl (Richard Bos) |
|---|---|
| Date | 2017-05-15 12:55 +0000 |
| Message-ID | <5919a4e1.18599000@news.xs4all.nl> |
| In reply to | #109746 |
Thiago Adams <thiago.adams@gmail.com> wrote: > Binary Literals in the C++ Core Language > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf > > int i = 0b1100; > > (I liked this) This I like. It's useful, and most importantly, it's small and only has local implications. No need to search through the whole code base for its effects: you have, here and now, one binary literal. The digit separator one I'm not sure I'd use, but it's a small and localised addition as well, so I'd have no objection to it. Richard
[toc] | [prev] | [next] | [standalone]
Page 9 of 19 — ← Prev page 1 … 7 8 [9] 10 11 … 19 Next page →
Back to top | Article view | comp.lang.c
csiph-web