unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org>
To: Jason Duerstock <jason.duerstock@gmail.com>
Cc: A <amit234234234234@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: size_t vs long.
Date: Thu, 17 Nov 2022 21:01:17 +0100	[thread overview]
Message-ID: <c2545c18-813d-6775-b04c-61bcd127e2b3@gmail.com> (raw)
In-Reply-To: <CAP5F8cKtbO7W67eLcikcBDa4yC=y7ORVxFF5FmFGNST+v=kXeA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1503 bytes --]

Hi Jason,

On 11/17/22 20:40, Jason Duerstock wrote:
> On Thu, Nov 17, 2022 at 6:01 AM Alejandro Colomar via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>>
>> Not really.  I was trying to be explicative, while being a bit funny, to make it
>> more entertaining to read.  But as Brian Kernighan said, noone is smart enough
>> to debug its own code:
>>
>> [
>> Debugging is twice as hard as writing the code in the first place. Therefore, if
>> you write the code as cleverly as possible, you are, by definition, not smart
>> enough to debug it.
>> ]
>>           — Brian W. Kernighan and P. J. Plauger in The Elements of Programming
>> Style.
> 
> Not to get too far off topic, but I took this to mean that one should
> endeavor to be boring and straightforward when coding unless it was
> absolutely necessary to be clever, as the boring and straightforward
> code would be easier to debug.

Yes, that a valid reading of it.

My extended reading of it is:

-  Code is hard to debug by yourself; keep it simple (your point, I think).
-  If you write more complex code trying to debug your own code, you are by 
necessity violating the previous point.
-  If you went ahead and wrote code to debug your own code, will you go further 
to write code that debugs the debugging code?
-  The algorithm crashed.  :)

> 
> Or at the very least, one should never be more than 50% clever about it.
> 
> Jason

Cheers,

Alex

-- 
<http://www.alejandro-colomar.es/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-11-17 20:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  7:02 size_t vs long A via Libc-alpha
2022-11-17  9:21 ` Alejandro Colomar via Libc-alpha
2022-11-17  9:48   ` A via Libc-alpha
2022-11-17 11:00     ` Alejandro Colomar via Libc-alpha
2022-11-17 19:40       ` Jason Duerstock via Libc-alpha
2022-11-17 20:01         ` Alejandro Colomar via Libc-alpha [this message]
2022-11-17 19:17   ` Paul Eggert
2022-11-17 20:27     ` Alejandro Colomar via Libc-alpha
2022-11-17 21:39       ` Paul Eggert
2022-11-17 23:04         ` Alejandro Colomar via Libc-alpha
2022-11-23 20:08           ` Using size_t to crash on off-by-one errors (was: size_t vs long.) Alejandro Colomar via Libc-alpha
2022-11-18  2:11         ` size_t vs long Maciej W. Rozycki
2022-11-18  2:47           ` Paul Eggert
2022-11-23 20:01             ` Alejandro Colomar via Libc-alpha
2022-11-17 21:58 ` DJ Delorie via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2545c18-813d-6775-b04c-61bcd127e2b3@gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=alx.manpages@gmail.com \
    --cc=amit234234234234@gmail.com \
    --cc=jason.duerstock@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).