The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: norman@oclsc.org (Norman Wilson)
Subject: [TUHS] 80 columns ...
Date: Fri, 10 Nov 2017 13:21:09 -0400	[thread overview]
Message-ID: <1510334474.27585.for-standards-violators@oclsc.org> (raw)

Nemo:

  And for that reason, I have never used Python.  (I have a mental block
  about that.)

====

I used to feel the same way.  A few years ago I held my nose
and jumped in.  I'm glad I did; Python is a nifty little
language that, now I know it, hits a sweet spot twixt low-level
C and high-level shell and awk scripts.

Denoting blocks solely by indentation isn't at all bad once
you do it; no worse than adapting from do ... end to C's {}.

What still bugs me about Python:
-- It is unreasonably messy to give someone else a copy of
a program composed of many internal modules.  Apparently
you are expected to give her a handful of files, to be
installed in some directory whose name must be added to
the search path in every Python source file that imports
them.  I have come up with my own hacky workaround but it
would be nice if the language provided a graceful way to,
e.g., catenate multiple modules into a single source file
for distribution.
-- I miss C's style of for loop, though not often.  (Not
quite everything can be turned into a list or an iterator.)
-- I miss one particular case of assigment having a value:
that of
	while ((val = function()) != STOP)
		do something with val
Again, there are clunky ways to work around this.

As for 80 columns, I'm firmly in the camp that says that
if you need a lot of indentation you're doing it wrong.
Usually it means you should be pulling the details out
into separate functions.  Functions that run on for many,
many lines (once upon a time it was meaningful to say
for many pages, but no longer) are just as bad, for the
same reason: it's hard to read and understand the code,
because you have to keep so many details in your head at
once.

Likewise for excessive use of global variables, for that
matter, a flaw that is still quite common in C code.

Having to break an expression or a function call over
multiple lines is more problematic.  It's clearer not
to have to do that.  It helps not to make function or
variable names longer than necessary, but one can carry
that too far too.

Style and clarity are hard, but they are what distinguishes
a crap hack programmer from a good one.

Norman Wilson
Toronto ON
(Sitting on the lower level of a train in Texas,
not on a pedestal)


             reply	other threads:[~2017-11-10 17:21 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 17:21 Norman Wilson [this message]
2017-11-10 17:56 ` Larry McVoy
2017-11-11 17:04 ` Ian Zimmerman
2017-11-11 17:30   ` Random832
2017-11-11 18:05     ` Ian Zimmerman
  -- strict thread matches above, loose matches on Subject: below --
2017-11-08 20:52 ron minnich
2017-11-08 21:02 ` Larry McVoy
2017-11-08 21:19   ` Dan Cross
2017-11-08 21:24     ` Larry McVoy
2017-11-08 21:28       ` Steve Nickolas
2017-11-08 23:28         ` Dave Horsfall
2017-11-08 23:35           ` Ron Natalie
2017-11-08 23:39             ` Dave Horsfall
2017-11-08 21:34       ` Dan Cross
2017-11-08 21:40         ` Dan Cross
2017-11-08 21:40         ` Larry McVoy
2017-11-08 21:43           ` Dan Cross
2017-11-09  1:00             ` Theodore Ts'o
2017-11-08 23:46     ` Steffen Nurpmeso
2017-11-09  6:52       ` Otto Moerbeek
2017-11-08 21:06 ` Bakul Shah
2017-11-08 21:18   ` Steve Nickolas
2017-11-08 22:17 ` Grant Taylor
2017-11-08 22:30   ` Arthur Krewat
2017-11-08 23:07     ` Andy Kosela
2017-11-08 23:15       ` Arthur Krewat
2017-11-08 23:15         ` Warner Losh
2017-11-08 23:49           ` Arthur Krewat
2017-11-09  0:04             ` Dave Horsfall
2017-11-08 23:24         ` Andy Kosela
2017-11-09  7:24 ` Lars Brinkhoff
2017-11-09 15:02   ` Don Hopkins
2017-11-09 19:14     ` Ron Natalie
2017-11-10 16:18       ` Nemo
2017-11-10 19:05         ` Jon Steinhart
2017-11-10 20:36           ` Toby Thain
2017-11-10 20:39             ` Larry McVoy
2017-11-10 20:46               ` Warner Losh
2017-11-10 20:59                 ` Larry McVoy
2017-11-11  9:24                 ` David Arnold
2017-11-10 20:43             ` Jon Steinhart
2017-11-10 20:58               ` Larry McVoy
2017-11-10 21:02                 ` Jon Steinhart
2017-11-10 21:09                   ` Larry McVoy
2017-11-10 21:12                     ` Jon Steinhart
2017-11-10 21:34                       ` William Corcoran
2017-11-10 21:50                         ` Jon Steinhart
2017-11-10 22:58                         ` Dave Horsfall
2017-11-10 23:05                           ` Jon Steinhart
2017-11-10 23:52                             ` Toby Thain
2017-11-11  0:24                             ` Larry McVoy
2017-11-11 16:40                   ` Ian Zimmerman
2017-11-11 16:47                     ` Larry McVoy
2017-11-11 17:23                       ` Jon Steinhart
2017-11-11 17:38                         ` Ralph Corderoy
2017-11-10 22:46               ` Toby Thain
2017-11-10 22:59                 ` Jon Steinhart
2017-11-11 14:33                   ` Andy Kosela
2017-11-11 17:19                     ` Jon Steinhart
2017-11-11 17:24                       ` Larry McVoy
2017-11-11 17:25                         ` Jon Steinhart
2017-11-10 23:59           ` Don Hopkins
2017-11-10 22:10         ` Dave Horsfall
2017-11-09 20:46     ` Lars Brinkhoff

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=1510334474.27585.for-standards-violators@oclsc.org \
    --to=norman@oclsc.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).