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


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

What I've learned in comp.lang.c

Started bybart <bc@freeuk.com>
First post2024-02-05 01:09 +0000
Last post2024-02-05 23:29 +0000
Articles 20 on this page of 133 — 16 participants

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


Contents

  What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-05 01:09 +0000
    Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-05 05:58 +0000
      Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-04 22:49 -0800
        Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-05 07:03 +0000
          Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-04 23:51 -0800
            Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-04 23:52 -0800
              Re: What I've learned in comp.lang.c Jan van den Broek <balglaas@dds.nl> - 2024-02-05 08:36 +0000
      Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-05 18:23 +0200
      Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-05 18:32 +0200
        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-05 20:53 +0100
          Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-05 20:53 +0000
            Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-06 09:44 +0100
              Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-06 01:03 -0800
              Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-06 13:41 +0200
                Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-06 13:08 +0100
              Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-06 23:23 +0000
                Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 08:54 +0100
                  Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-07 08:59 +0000
                    Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-07 10:47 +0000
                      Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 11:04 +0000
                        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 14:21 +0100
                          Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 14:24 +0000
                            Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 21:30 +0100
                        Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-07 15:36 +0000
                          Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 18:05 +0000
                            Re: What I've learned in comp.lang.c scott@slp53.sl.home (Scott Lurndal) - 2024-02-07 18:26 +0000
                              Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 19:53 +0000
                                Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-07 21:38 +0000
                                  Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 00:29 +0000
                            Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 21:37 +0100
                              Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 22:52 +0000
                                Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 01:13 +0000
                                  Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 02:09 +0000
                                    Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 03:07 +0000
                                      Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 14:17 +0000
                                    Re: What I've learned in comp.lang.c Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-08 16:02 -0800
                                      Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-09 00:48 +0000
                                        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-09 08:53 +0100
                                        Re: What I've learned in comp.lang.c Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-10 21:55 -0800
                                Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-08 13:01 +0100
                            Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-08 11:37 +0000
                              Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 12:10 +0000
                                Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-08 13:24 +0100
                                  Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 13:03 +0000
                                  Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 13:17 +0000
                                    Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-08 16:52 +0100
                                Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-08 17:17 +0000
                              Re: What I've learned in comp.lang.c Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-09 14:50 -0800
                      Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-07 12:44 +0000
                        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 14:49 +0100
                        Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-07 16:13 +0000
                        Re: What I've learned in comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-07 08:21 -0800
                    Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 14:01 +0100
                      Re: What I've learned in comp.lang.c Richard Harnden <richard.nospam@gmail.invalid> - 2024-02-07 13:21 +0000
                      Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-07 13:42 +0000
                        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 16:17 +0100
                      Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-07 21:34 +0000
                    Re: What I've learned in comp.lang.c scott@slp53.sl.home (Scott Lurndal) - 2024-02-07 16:21 +0000
                      Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-08 13:26 +0200
                  Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-07 10:04 +0000
                    Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 14:51 +0100
                      Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-07 15:30 +0000
                        Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-07 15:45 +0000
                          Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 21:44 +0100
                            Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 00:33 +0000
                              Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 01:30 +0000
                              Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-08 01:38 +0000
                                Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 02:21 +0000
                                  Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 03:07 +0000
                          Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-08 11:45 +0000
                            Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 12:15 +0000
                              Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-08 13:29 +0100
                                Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-08 12:55 +0000
                                  Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-09 09:02 +0100
                                Re: What I've learned in comp.lang.c scott@slp53.sl.home (Scott Lurndal) - 2024-02-08 16:09 +0000
                                  Re: What I've learned in comp.lang.c Richard Harnden <richard.nospam@gmail.invalid> - 2024-02-08 16:28 +0000
                                  Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-08 17:13 +0000
                        Re: What I've learned in comp.lang.c Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-08 17:53 -0800
      Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-05 19:02 +0200
        Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-05 23:28 +0000
          Re: What I've learned in comp.lang.c Richard Harnden <richard.nospam@gmail.invalid> - 2024-02-05 23:40 +0000
          Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-06 01:46 +0200
            Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-06 09:54 +0100
          Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-05 16:03 -0800
            Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-05 16:06 -0800
          Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-06 09:50 +0100
            Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-06 01:01 -0800
            Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-06 23:24 +0000
              Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 08:56 +0100
                Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-07 12:09 +0200
                  Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 15:03 +0100
                Re: What I've learned in comp.lang.c scott@slp53.sl.home (Scott Lurndal) - 2024-02-07 16:25 +0000
                  Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 21:49 +0100
                    Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-07 13:04 -0800
                    Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-07 23:37 +0200
                      Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-08 08:52 +0100
                        Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-09 15:55 +0200
                          Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-09 15:29 +0100
                            Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-09 16:52 +0200
                              Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-09 17:22 +0100
                                Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-10 07:18 +0000
                                  Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-10 17:11 +0100
                                    Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-10 21:23 +0000
                                      Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-11 14:01 +0100
                  Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-07 21:41 +0000
      Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 02:18 +0000
        Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-07 09:30 +0100
        Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-07 09:04 +0000
        Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-07 23:24 +0000
          Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 01:46 +0000
            Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 02:50 +0000
              Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 11:08 +0000
              Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-08 13:10 +0200
                Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-08 17:48 +0000
                  Re: What I've learned in comp.lang.c Michael S <already5chosen@yahoo.com> - 2024-02-08 21:30 +0200
                  Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-08 20:39 +0000
                  Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-08 13:39 -0800
                    Re: What I've learned in comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-08 14:18 -0800
                      Re: What I've learned in comp.lang.c gazelle@shell.xmission.com (Kenny McCormack) - 2024-02-08 22:29 +0000
                        Re: What I've learned in comp.lang.c "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-08 14:43 -0800
                          Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-09 09:12 +0100
    Re: What I've learned in comp.lang.c Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-04 23:36 -0800
      Re: What I've learned in comp.lang.c scott@slp53.sl.home (Scott Lurndal) - 2024-02-05 14:52 +0000
        Re: What I've learned in comp.lang.c gazelle@shell.xmission.com (Kenny McCormack) - 2024-02-05 22:58 +0000
      Re: What I've learned in comp.lang.c Jim Jackson <jj@franjam.org.uk> - 2024-02-05 18:01 +0000
    Re: What I've learned in comp.lang.c Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-05 08:29 +0000
      Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 01:35 +0000
        Re: What I've learned in comp.lang.c Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-07 02:26 +0000
          Re: What I've learned in comp.lang.c bart <bc@freeuk.com> - 2024-02-07 10:47 +0000
    Re: What I've learned in comp.lang.c Dan Purgert <dan@djph.net> - 2024-02-05 11:03 +0000
    Re: What I've learned in comp.lang.c David Brown <david.brown@hesbynett.no> - 2024-02-05 13:15 +0100
      Re: What I've learned in comp.lang.c Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-05 14:09 +0000
    Re: What I've learned in comp.lang.c Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-05 23:29 +0000

Page 4 of 7 — ← Prev page 1 2 3 [4] 5 6 7  Next page →


#381973

FromDavid Brown <david.brown@hesbynett.no>
Date2024-02-07 14:51 +0100
Message-ID<uq01ti$1erim$2@dont-email.me>
In reply to#381955
On 07/02/2024 11:04, Ben Bacarisse wrote:
> David Brown <david.brown@hesbynett.no> writes:
> 
>> Making some "temp" variables and re-using them was also common for some
>> people in idiomatic C90 code, where all your variables are declared at the
>> top of the function.
> 
> The comma suggests (I think) that it is C90 that mandates that all one's
> variables are declared at the top of the function.  But that's not the
> case (as I am sure you know).

Yes.

>  The other reading -- that this is done in
> idiomatic C90 code -- is also something that I'd question, but not
> something that I'd want to argue.

"Idiomatic" is perhaps not the best word.  (And "idiotic" is too 
strong!)  I mean written in a way that is quite common in C90 code.

> 
> I comment just because there seems to be a myth that "old C" had to have
> all the declarations at the top of a function.  That was true once, but
> so long ago as to be irrelevant.  Even K&R C allowed declarations at the
> top of a compound statement.
> 

It's good to make it clear.

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


#381985

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2024-02-07 15:30 +0000
Message-ID<87msscthq3.fsf@bsb.me.uk>
In reply to#381973
David Brown <david.brown@hesbynett.no> writes:

> On 07/02/2024 11:04, Ben Bacarisse wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>> 
>>> Making some "temp" variables and re-using them was also common for some
>>> people in idiomatic C90 code, where all your variables are declared at the
>>> top of the function.
>> The comma suggests (I think) that it is C90 that mandates that all one's
>> variables are declared at the top of the function.  But that's not the
>> case (as I am sure you know).
>
> Yes.
>
>>  The other reading -- that this is done in
>> idiomatic C90 code -- is also something that I'd question, but not
>> something that I'd want to argue.
>
> "Idiomatic" is perhaps not the best word.  (And "idiotic" is too strong!)
> I mean written in a way that is quite common in C90 code.

The most common meaning of "idiomatic", and the one I usually associate
with it in this context, is "containing expressions that are natural and
correct".  That's not how I would describe eschewing declarations in
inner blocks.

-- 
Ben.

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


#381989

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2024-02-07 15:45 +0000
Message-ID<uq08i5$1fvu8$1@dont-email.me>
In reply to#381985
On 07/02/2024 15:30, Ben Bacarisse wrote:
> David Brown <david.brown@hesbynett.no> writes:
> 
>> On 07/02/2024 11:04, Ben Bacarisse wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>
>>>> Making some "temp" variables and re-using them was also common for some
>>>> people in idiomatic C90 code, where all your variables are declared at the
>>>> top of the function.
>>> The comma suggests (I think) that it is C90 that mandates that all one's
>>> variables are declared at the top of the function.  But that's not the
>>> case (as I am sure you know).
>>
>> Yes.
>>
>>>   The other reading -- that this is done in
>>> idiomatic C90 code -- is also something that I'd question, but not
>>> something that I'd want to argue.
>>
>> "Idiomatic" is perhaps not the best word.  (And "idiotic" is too strong!)
>> I mean written in a way that is quite common in C90 code.
> 
> The most common meaning of "idiomatic", and the one I usually associate
> with it in this context, is "containing expressions that are natural and
> correct".  That's not how I would describe eschewing declarations in
> inner blocks.
> 
No. It means writing the code in a way which is common in C and has 
certain advantages, but is not so in other languages.
-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

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


#382019

FromDavid Brown <david.brown@hesbynett.no>
Date2024-02-07 21:44 +0100
Message-ID<uq0q3a$1j1v4$3@dont-email.me>
In reply to#381989
On 07/02/2024 16:45, Malcolm McLean wrote:
> On 07/02/2024 15:30, Ben Bacarisse wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 07/02/2024 11:04, Ben Bacarisse wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> Making some "temp" variables and re-using them was also common for 
>>>>> some
>>>>> people in idiomatic C90 code, where all your variables are declared 
>>>>> at the
>>>>> top of the function.
>>>> The comma suggests (I think) that it is C90 that mandates that all 
>>>> one's
>>>> variables are declared at the top of the function.  But that's not the
>>>> case (as I am sure you know).
>>>
>>> Yes.
>>>
>>>>   The other reading -- that this is done in
>>>> idiomatic C90 code -- is also something that I'd question, but not
>>>> something that I'd want to argue.
>>>
>>> "Idiomatic" is perhaps not the best word.  (And "idiotic" is too 
>>> strong!)
>>> I mean written in a way that is quite common in C90 code.
>>
>> The most common meaning of "idiomatic", and the one I usually associate
>> with it in this context, is "containing expressions that are natural and
>> correct".  That's not how I would describe eschewing declarations in
>> inner blocks.

Some people do feel it is more "natural" to have all their declarations 
at the start of their functions (and never declare variables in any 
inner block scopes).  It's common, and their code can be correct.  You 
and I both think there are usually better ways to structure code, but 
does that mean it is not "idiomatic" ?  I'm not sure there is a good 
answer here.  Unfortunately the C standards don't define the term 
"idiomatic" :-(

If you can think of a better term to use here, I'd be happy to hear it - 
otherwise I think we all know the kind of code structure I meant, which 
was the most important point.

>>
> No. It means writing the code in a way which is common in C and has 
> certain advantages, but is not so in other languages.

An idiom in C could also be an idiom in C++, Python, or any other 
language.  Nothing in "idiomatic" implies that it is unique to a 
particular language, just that it is commonly used in that language.

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


#382050

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2024-02-08 00:33 +0000
Message-ID<uq17gv$1l7dv$2@dont-email.me>
In reply to#382019
On 07/02/2024 20:44, David Brown wrote:
> On 07/02/2024 16:45, Malcolm McLean wrote:
>> On 07/02/2024 15:30, Ben Bacarisse wrote:
>>>
>>> The most common meaning of "idiomatic", and the one I usually associate
>>> with it in this context, is "containing expressions that are natural and
>>> correct".  That's not how I would describe eschewing declarations in
>>> inner blocks.
>>>
>> No. It means writing the code in a way which is common in C and has 
>> certain advantages, but is not so in other languages.
> 
> An idiom in C could also be an idiom in C++, Python, or any other 
> language.  Nothing in "idiomatic" implies that it is unique to a 
> particular language, just that it is commonly used in that language.
> 
We must be able to point to at least one other language where it is not 
the idiom, in order to say that it is an idiom.
-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

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


#382058

FromKaz Kylheku <433-929-6894@kylheku.com>
Date2024-02-08 01:30 +0000
Message-ID<20240207171803.654@kylheku.com>
In reply to#382050
On 2024-02-08, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
> On 07/02/2024 20:44, David Brown wrote:
>> On 07/02/2024 16:45, Malcolm McLean wrote:
>>> On 07/02/2024 15:30, Ben Bacarisse wrote:
>>>>
>>>> The most common meaning of "idiomatic", and the one I usually associate
>>>> with it in this context, is "containing expressions that are natural and
>>>> correct".  That's not how I would describe eschewing declarations in
>>>> inner blocks.
>>>>
>>> No. It means writing the code in a way which is common in C and has 
>>> certain advantages, but is not so in other languages.
>> 
>> An idiom in C could also be an idiom in C++, Python, or any other 
>> language.  Nothing in "idiomatic" implies that it is unique to a 
>> particular language, just that it is commonly used in that language.
>> 
> We must be able to point to at least one other language where it is not 
> the idiom, in order to say that it is an idiom.

There are two meanings of *idiom*.

The "strong" meaning of idiom is that it's a meaning arbitrarily
assigned to a canned combination of words which otherwise make no
sense or are ungrammatical.

The "weak" meaning refers to some often used phrase.

Your proposed rule has a logical flaw because it requires us to confirm
that something is not an idiom in order to confirm that it is.
Even though that is in separate languages, it is still a problem.

Suppose that that all the literal translations of some phrase X into all
known languages are naively considered idioms by all their respective
speakers.

Then according to your criterion, none of the languages have the right
to consider it to be an idiom. 

Suppos that English speakers are the first to realize this problem, and
choose to stop considering the English translation of X an idiom.

At that point, the other remaining languages may keep it as an idiom:
their speakers can now point to at least one language where it isn't.

Problem is, the choice of which group must stop treating it as an idiom,
so that the others may, is arbitrary.

This is not a well-founded definition for a term!

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


#382061

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-02-08 01:38 +0000
Message-ID<uq1ba3$1lp15$2@dont-email.me>
In reply to#382050
On Thu, 8 Feb 2024 00:33:35 +0000, Malcolm McLean wrote:

> We must be able to point to at least one other language where it is not
> the idiom, in order to say that it is an idiom.

How about pointing to alternative ways it might be said in the same 
language, and then proclaiming that “for some reason, nobody who uses the 
language is supposed to do it that way”?

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


#382067

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2024-02-08 02:21 +0000
Message-ID<uq1ds2$1m55t$1@dont-email.me>
In reply to#382061
On 08/02/2024 01:38, Lawrence D'Oliveiro wrote:
> On Thu, 8 Feb 2024 00:33:35 +0000, Malcolm McLean wrote:
> 
>> We must be able to point to at least one other language where it is not
>> the idiom, in order to say that it is an idiom.
> 
> How about pointing to alternative ways it might be said in the same
> language, and then proclaiming that “for some reason, nobody who uses the
> language is supposed to do it that way”?

So how do you say "My French is lousy" in idomatic French?
Accroding to a Frenchman, it is "Doucement. Le Francais n'est pas ma 
langue maternelle."
Now that means literally "Softly. The French is not my maternal language".
You wouldn't say that in English. You'd say "go easy" instead of 
"softly". It would be "French" rather than "the French". And whilst you 
might say "maternal language" it would be rare. Normally it would be 
"native language".
So the French has one idiom and the English another, and we say things 
in a slightly different way. What is the convention in one is not so in 
the other, and that is what makes it idiom.

And of course the Frenchman made the point that whilst his information 
was correct, to actually use his translation would be self-refuting.
-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

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


#382070

FromKaz Kylheku <433-929-6894@kylheku.com>
Date2024-02-08 03:07 +0000
Message-ID<20240207190720.286@kylheku.com>
In reply to#382067
On 2024-02-08, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
> On 08/02/2024 01:38, Lawrence D'Oliveiro wrote:
>> On Thu, 8 Feb 2024 00:33:35 +0000, Malcolm McLean wrote:
>> 
>>> We must be able to point to at least one other language where it is not
>>> the idiom, in order to say that it is an idiom.
>> 
>> How about pointing to alternative ways it might be said in the same
>> language, and then proclaiming that “for some reason, nobody who uses the
>> language is supposed to do it that way”?
>
> So how do you say "My French is lousy" in idomatic French?

Je parle Quebecois.

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

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


#382090

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2024-02-08 11:45 +0000
Message-ID<87cyt7rxh8.fsf@bsb.me.uk>
In reply to#381989
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On 07/02/2024 15:30, Ben Bacarisse wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>> 
>>> On 07/02/2024 11:04, Ben Bacarisse wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> Making some "temp" variables and re-using them was also common for some
>>>>> people in idiomatic C90 code, where all your variables are declared at the
>>>>> top of the function.
>>>> The comma suggests (I think) that it is C90 that mandates that all one's
>>>> variables are declared at the top of the function.  But that's not the
>>>> case (as I am sure you know).
>>>
>>> Yes.
>>>
>>>>   The other reading -- that this is done in
>>>> idiomatic C90 code -- is also something that I'd question, but not
>>>> something that I'd want to argue.
>>>
>>> "Idiomatic" is perhaps not the best word.  (And "idiotic" is too strong!)
>>> I mean written in a way that is quite common in C90 code.
>> The most common meaning of "idiomatic", and the one I usually associate
>> with it in this context, is "containing expressions that are natural and
>> correct".  That's not how I would describe eschewing declarations in
>> inner blocks.
>> 
> No. It means writing the code in a way which is common in C and has certain
> advantages, but is not so in other languages.

Where do you get your superior knowledge of English from, and is there a
way anyone else can hope to achieve your level of competence?

-- 
Ben.

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


#382094

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2024-02-08 12:15 +0000
Message-ID<uq2gk5$1uvp4$2@dont-email.me>
In reply to#382090
On 08/02/2024 11:45, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> 
>> No. It means writing the code in a way which is common in C and has certain
>> advantages, but is not so in other languages.
> 
> Where do you get your superior knowledge of English from, and is there a
> way anyone else can hope to achieve your level of competence?
> 
Degree in English literature.
Places are difficult to obtain but not impossible. You need to convince 
the dons that you deserve one as many other people will be after them.

-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

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


#382097

FromDavid Brown <david.brown@hesbynett.no>
Date2024-02-08 13:29 +0100
Message-ID<uq2hev$1v5v8$2@dont-email.me>
In reply to#382094
On 08/02/2024 13:15, Malcolm McLean wrote:
> On 08/02/2024 11:45, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>
>>> No. It means writing the code in a way which is common in C and has 
>>> certain
>>> advantages, but is not so in other languages.
>>
>> Where do you get your superior knowledge of English from, and is there a
>> way anyone else can hope to achieve your level of competence?
>>
> Degree in English literature.

I would never have guessed that from the way you write and from how 
often you fail to read other people's posts.

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


#382100

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2024-02-08 12:55 +0000
Message-ID<uq2j01$1vg9n$1@dont-email.me>
In reply to#382097
On 08/02/2024 12:29, David Brown wrote:
> On 08/02/2024 13:15, Malcolm McLean wrote:
>> On 08/02/2024 11:45, Ben Bacarisse wrote:
>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>
>>>> No. It means writing the code in a way which is common in C and has 
>>>> certain
>>>> advantages, but is not so in other languages.
>>>
>>> Where do you get your superior knowledge of English from, and is there a
>>> way anyone else can hope to achieve your level of competence?
>>>
>> Degree in English literature.
> 
> I would never have guessed that from the way you write and from how 
> often you fail to read other people's posts.
> 

What an Oxford English tutor mostly cares about is that the essay is 
produced. Not so much what it says. You'll always get some marks for 
writing something and will therefore pass, but you can get no marks for 
nothing and can only fail. So handing in a stupid essay is acceptable 
but not handing in the essay at all is a big no no and tutors really 
hate that. It's all about pulling something together in a tight deadline 
on a subject about which you knew absolutely nothing last week, and 
that's what they value. So it does encourage a rather slapdash approach 
and reading things quickly, and maybe that is a fault.

-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

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


#382165

FromDavid Brown <david.brown@hesbynett.no>
Date2024-02-09 09:02 +0100
Message-ID<uq4m64$2hive$2@dont-email.me>
In reply to#382100
On 08/02/2024 13:55, Malcolm McLean wrote:
> On 08/02/2024 12:29, David Brown wrote:
>> On 08/02/2024 13:15, Malcolm McLean wrote:
>>> On 08/02/2024 11:45, Ben Bacarisse wrote:
>>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>>
>>>>> No. It means writing the code in a way which is common in C and has 
>>>>> certain
>>>>> advantages, but is not so in other languages.
>>>>
>>>> Where do you get your superior knowledge of English from, and is 
>>>> there a
>>>> way anyone else can hope to achieve your level of competence?
>>>>
>>> Degree in English literature.
>>
>> I would never have guessed that from the way you write and from how 
>> often you fail to read other people's posts.
>>
> 
> What an Oxford English tutor mostly cares about is that the essay is 
> produced. Not so much what it says. You'll always get some marks for 
> writing something and will therefore pass, but you can get no marks for 
> nothing and can only fail. So handing in a stupid essay is acceptable 
> but not handing in the essay at all is a big no no and tutors really 
> hate that. It's all about pulling something together in a tight deadline 
> on a subject about which you knew absolutely nothing last week, and 
> that's what they value. So it does encourage a rather slapdash approach 
> and reading things quickly, and maybe that is a fault.
> 

I guess there are good tutors and bad tutors, even at Oxford.  What you 
describe bears no relation to the experiences of friends at Oxford 
university who studied English literature.  My /maths/ tutor would have 
failed someone who handed in work as carelessly and thoughtlessly 
written as some of your posts, regardless of whether the mathematics 
itself were correct.

Are you really suggesting your tutor merely counted the number of pages 
you handed in, and didn't care if you had read the texts or not?  He/she 
didn't care if you talked about Shakespeare's plays, or if you called 
them "actions" since that's what actors perform, and because you 
consider the use of standard terms to be beneath you?

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


#382111

Fromscott@slp53.sl.home (Scott Lurndal)
Date2024-02-08 16:09 +0000
Message-ID<N07xN.342025$c3Ea.10589@fx10.iad>
In reply to#382097
David Brown <david.brown@hesbynett.no> writes:
>On 08/02/2024 13:15, Malcolm McLean wrote:
>> On 08/02/2024 11:45, Ben Bacarisse wrote:
>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>
>>>> No. It means writing the code in a way which is common in C and has 
>>>> certain
>>>> advantages, but is not so in other languages.
>>>
>>> Where do you get your superior knowledge of English from, and is there a
>>> way anyone else can hope to achieve your level of competence?
>>>
>> Degree in English literature.
>
>I would never have guessed that from the way you write and from how 
>often you fail to read other people's posts.

And Malcolm doesn't apparently recognize sarcasm.

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


#382115

FromRichard Harnden <richard.nospam@gmail.invalid>
Date2024-02-08 16:28 +0000
Message-ID<uq2vev$21oav$1@dont-email.me>
In reply to#382111
On 08/02/2024 16:09, Scott Lurndal wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 08/02/2024 13:15, Malcolm McLean wrote:
>>> On 08/02/2024 11:45, Ben Bacarisse wrote:
>>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>>
>>>>> No. It means writing the code in a way which is common in C and has
>>>>> certain
>>>>> advantages, but is not so in other languages.
>>>>
>>>> Where do you get your superior knowledge of English from, and is there a
>>>> way anyone else can hope to achieve your level of competence?
>>>>
>>> Degree in English literature.
>>
>> I would never have guessed that from the way you write and from how
>> often you fail to read other people's posts.
> 
> And Malcolm doesn't apparently recognize sarcasm.

I think they only teach that at Cambridge.

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


#382123

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2024-02-08 17:13 +0000
Message-ID<87v86yria3.fsf@bsb.me.uk>
In reply to#382111
scott@slp53.sl.home (Scott Lurndal) writes:

> David Brown <david.brown@hesbynett.no> writes:
>>On 08/02/2024 13:15, Malcolm McLean wrote:
>>> On 08/02/2024 11:45, Ben Bacarisse wrote:
>>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>>
>>>>> No. It means writing the code in a way which is common in C and has 
>>>>> certain
>>>>> advantages, but is not so in other languages.
>>>>
>>>> Where do you get your superior knowledge of English from, and is there a
>>>> way anyone else can hope to achieve your level of competence?
>>>>
>>> Degree in English literature.
>>
>>I would never have guessed that from the way you write and from how 
>>often you fail to read other people's posts.
>
> And Malcolm doesn't apparently recognize sarcasm.

I think it's extremely unlikely that he missed it.

-- 
Ben.

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


#382157

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2024-02-08 17:53 -0800
Message-ID<86plx65roq.fsf@linuxsc.com>
In reply to#381985
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> The most common meaning of "idiomatic", and the one I usually
> associate with it in [the context of some C coding conventions],
> is "containing expressions that are natural and correct".  [...]

It surprised me to read this.  In my lexicon "idiomatic" usually
means something more like "easily understood by a native speaker
but resistant to literal translation".  An example might be
"raining cats and dogs".

Looking up "idiom" and "idiomatic" in several online dictionaries,
the meanings are definitely multi-valued.  In C we might say that
Duff's Device is idiomatic.  On the other hand we could say K&R
style function definitions are unusual in contemporary C idiom
(and so by implication ANSI/ISO C style function definitions are
idiomatic).  So one meaning is more or less "normal practice"
whereas another meaning is more like "strange although often used
construction".

Please note that I am expressing no opinion on which meaning is
"better" or "worse", or anything along those lines.  I just found
it interesting that these words have somewhat divergent meanings.

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


#381830

FromMichael S <already5chosen@yahoo.com>
Date2024-02-05 19:02 +0200
Message-ID<20240205190209.00002c1f@yahoo.com>
In reply to#381793
On Mon, 5 Feb 2024 05:58:55 -0000 (UTC)
Kaz Kylheku <433-929-6894@kylheku.com> wrote:
> > * Nearly everyone here is working on massively huge and complex 
> > projects, which all take from minutes to hours for a full build.  
> 
> That's the landscape. Nobody is going to pay you for writing small
> utilities in C. That sort of thing all went to scripting languages.
> (It happens from time to time as a side task.)
> 
> I currently work on a a firmware application that compiles to a 100
> megabyte (stripped!) executable.
>

My before last firmware project compiles from scratch in 0m1.623s
despite using bloated STmicro libraries and headers.
On Windows, with antivirus running, using 10 y.o. PC.
With brand new CPU, bare metal Linux and modern NVMe SSD it will likely
finish 3 times faster.
Windows by itself is not a measurable slowdown, but antivirus is, and
until now I didn't find a way to get antivirus-free Windows at work.

Projects that small are not typical in my embedded development
practice practice. But embedded projects that on somewhat beefier 5 y.o.
hardware compile from scratch in less than 5 sec are typical.

As to PC development, project that I am trying to fix right now uses
link-time code generation, so it takes ~8 seconds (VS 2019, msbuild,
command line tools) to rebuild when just one file changed. I accept it
because it's not my own project. If it was mine, I'd probably want to
improve it. Besides, today I grew older, less intolerable of delays
than 25-30 years ago.





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


#381867

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-02-05 23:28 +0000
Message-ID<uprqu3$gcqc$4@dont-email.me>
In reply to#381830
On Mon, 5 Feb 2024 19:02:09 +0200, Michael S wrote:

> Windows by itself is not a measurable slowdown, but antivirus is, and
> until now I didn't find a way to get antivirus-free Windows at work.

But if you don’t have antivirus on your build machine, the sad fact of 
development on Windows is that there are viruses that will insinuate 
themselves into the build products.

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


Page 4 of 7 — ← Prev page 1 2 3 [4] 5 6 7  Next page →

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


csiph-web