The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Re: Clever code
@ 2022-12-13  3:30 Rudi Blom
  2022-12-13  3:41 ` Warner Losh
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Rudi Blom @ 2022-12-13  3:30 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

I vaguely remember having read here about 'clever code' which took into
account the time a magnetic drum needed to rotate in order to optimise
access.

Similarly I can imagine that with resource restraints you sometimes need to
be clever in order to get your program to fit. Of course, any such
cleverness needs extra documentation.

I only ever programmed in user space but even then without lots of comment
in my code I may already start wondering what I did after only a few months
past.

Cheers,
uncle rubl
-- 
The more I learn the better I understand I know nothing.

[-- Attachment #2: Type: text/html, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread
* [TUHS] Re: Clever code
@ 2022-12-13 18:02 Noel Chiappa
  0 siblings, 0 replies; 31+ messages in thread
From: Noel Chiappa @ 2022-12-13 18:02 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Bakul Shah

    > one dealt with it by formatting the disk so that the logical blocks N &
    > N+1 (from the OS PoV) were physically more than 1 sector apart. No
    > clever coding needed!

An old hack. ('Nothing new', and all that.) DEC Rx01/02 floppies used the
same thing, circa 1976.

	Noel

^ permalink raw reply	[flat|nested] 31+ messages in thread
* [TUHS] Re: Clever code
@ 2022-12-13 17:58 Noel Chiappa
  2022-12-13 18:51 ` G. Branden Robinson
  0 siblings, 1 reply; 31+ messages in thread
From: Noel Chiappa @ 2022-12-13 17:58 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Stuff Received

    > I had always thought of a delay line as a precursor to a register (or
    > stack) for storing intermediate results. Is this not an accurate way of
    > thinking about it?

No, not at all.

First: delay lines were a memory _technology_ (one that was inherently
serial, not random-access). They preceded all others.

Second: registers used to have two aspects - one now gone (and maybe the
second too). The first was that the _technology_ used to implement them
(latches built out of tubes, then transistors) was faster than main memory -
a distinction now mostly gone, especially since caches blur the speed
distinction between today's main memory and registers. The second was that
registers, being smaller in numbers, could be named with a few bits, allowing
them to be named with a small share of the bits in an instruction. (This one
still remains, although instructions are now so long it's probably less
important.)

Some delay-line machines had two different delay line sizes (since size is
equivalent to average access time) - what one might consider 'registers' were
kept in the small ones, for fast access at all times, whereas main memory
used the longer ones.

	Noel

^ permalink raw reply	[flat|nested] 31+ messages in thread
* [TUHS] Re: Stdin Redirect in Cu History/Alternatives?
@ 2022-12-11 20:03 Larry McVoy
  2022-12-12  2:15 ` [TUHS] Clever code (was " Bakul Shah
  0 siblings, 1 reply; 31+ messages in thread
From: Larry McVoy @ 2022-12-11 20:03 UTC (permalink / raw)
  To: Dave Horsfall; +Cc: The Eunuchs Hysterical Society

On Mon, Dec 12, 2022 at 06:55:31AM +1100, Dave Horsfall wrote:
> On Sun, 11 Dec 2022, Michael Kj??rling wrote:
> 
> > By definition, if you write code as cleverly as you can, then you aren't 
> > clever enough to debug it...
> 
> Indeed...
> 
> I've always used the maxim "Write code as though the next person to 
> maintain it is an axe-wielding psychopath who knows where you live".

My main job, for the 20 years until I retired, was to keep telling 
people that code that you wrote 6 months ago might as well have been
written by someone else.  Optimize for reading the code, not writing
the code.  It's read many.

99.9% of the time, I detest clever code.  .1% of the time, I need it.
The problem is that smart engineers adore writing clever code.  They
usually, eventually, wise up.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-12-15 18:09 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  3:30 [TUHS] Re: Clever code Rudi Blom
2022-12-13  3:41 ` Warner Losh
2022-12-13  3:53 ` Dave Horsfall
2022-12-13  4:03   ` George Michaelson
2022-12-13  8:05     ` Ralph Corderoy
2022-12-13  9:45       ` Dagobert Michelsen
2022-12-13  7:47   ` Ralph Corderoy
2022-12-13 19:56     ` Dave Horsfall
2022-12-13 11:46   ` John P. Linderman
2022-12-13 14:07     ` Douglas McIlroy
2022-12-13 14:31       ` arnold
2022-12-13 14:48         ` Ralph Corderoy
2022-12-13 15:10         ` Douglas McIlroy
2022-12-13 15:34           ` Stuff Received
2022-12-13 15:56             ` Ralph Corderoy
2022-12-13 23:02           ` Harald Arnesen
2022-12-14  7:31           ` arnold
2022-12-15 18:06           ` Marc Donner
2022-12-15 18:08             ` Marc Donner
2022-12-15  6:30         ` [TUHS] Delay line memory (was: Clever code) Greg 'groggy' Lehey
2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
2022-12-13 16:14   ` Ralph Corderoy
2022-12-13 16:30     ` Bakul Shah
2022-12-15  6:39   ` [TUHS] Sector interleaving (was: Clever code) Greg 'groggy' Lehey
  -- strict thread matches above, loose matches on Subject: below --
2022-12-13 18:02 [TUHS] Re: Clever code Noel Chiappa
2022-12-13 17:58 Noel Chiappa
2022-12-13 18:51 ` G. Branden Robinson
2022-12-13 20:14   ` segaloco via TUHS
2022-12-13 20:58     ` Warren Toomey via TUHS
2022-12-14  2:28     ` Luther Johnson
2022-12-11 20:03 [TUHS] Re: Stdin Redirect in Cu History/Alternatives? Larry McVoy
2022-12-12  2:15 ` [TUHS] Clever code (was " Bakul Shah
2022-12-12  9:48   ` [TUHS] Re: Clever code Michael Kjörling

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).