Computer Old Farts Forum
 help / color / mirror / Atom feed
Subject: [COFF] [TUHS] Algol 68 and Unix (was cron and at ...)
Date: Thu, 17 Dec 2020 18:30:51 +0000	[thread overview]
Message-ID: <d1d9cc69-65aa-485e-86f2-3dba022ac826@localhost> (raw)
In-Reply-To: <20201217180048.GG13368@mcvoy.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]

On 17 Dec 2020 10:00 -0800, from lm at mcvoy.com (Larry McVoy):
> Most old guys get it.  But my guys were seasoned and still would try and 
> slip stuff in.  
> 
> I think it is part of being really smart, it's a puzzle for them and they
> "win" if they can do something clever.  I always replied "It is write once,
> read many.  Optimize for reads".  It's depressing how much of my job was
> pounding that message home year after year.

I would rather say to optimize for debugging, which in my experience
happen even more often than (casual) reads. My personal experience is
that most code pretty much just sits there until there's (a) a bug
involving it in some manner, or (b) a new feature that requires
somehow modifying it. When you're trying to figure out why in the
$DEITY $EXPLETIVE $VOLUME the code doesn't do what you think it
should, _any_ amount of "clever" is usually too much.

Yes, it might save a few lines of code somewhere.

Yes, it might be fun to play with a brand new language or compiler or
framework feature.

Yes, every once in a long while there's actually an actual, good
reason to go the "clever" route because it provides some _significant_
advantage. Performance for performance-critical code is one such
example. (I think that so far, professionally, I've written _one_
piece of code where performance was actually critical enough to
warrant getting clever. More often, trying to be clever has just ended
up confusing the compiler.)

But if it takes the next person a week to figure out why the code
doesn't work right when a more direct approach would have made the
error obvious at a glance without any significant downsides other than
that it doesn't use Feature X, then almost every time that's going to
be a really, really, _really_ bad trade-off.

What was that saying again? The person who will need to fix the bugs
in or build upon your code is a sociopathic axe murderer who knows
where you live, so write your code accordingly?

For me, I try quite hard to steer clear of "clever" unless the
cleverness offers some seriously compelling advantage.

And I don't even consider myself particularly old.

-- 
Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se
 “Remember when, on the Internet, nobody cared that you were a dog?”



  reply	other threads:[~2020-12-17 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKH6PiVLgdPVEGvGfyVAwNMz66=0huVyvRY90E+PduwG4ssVRQ@mail.gmail.com>
     [not found] ` <0EA02917-243E-4612-9F7E-D370EE0A7C2E@ronnatalie.com>
     [not found]   ` <20201217143558.GD13268@mcvoy.com>
2020-12-17 15:22     ` clemc
2020-12-17 15:50       ` [COFF] [SPAM] " lm
2020-12-17 17:57         ` imp
2020-12-17 18:00           ` lm
2020-12-17 18:30             `  [this message]
2020-12-17 21:10             ` clemc
2020-12-18 14:43               ` lm
2020-12-18 15:46                 ` clemc
2020-12-18 17:41                 ` tytso
2020-12-18 19:24                   ` [COFF] " lm

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

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

  git send-email \
    --in-reply-to=d1d9cc69-65aa-485e-86f2-3dba022ac826@localhost \
    --to=coff@minnie.tuhs.org \
    /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 NNTP newsgroup(s).