help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simpler question about my script


From: Sysadmin Lists
Subject: Re: simpler question about my script
Date: Sun, 20 Feb 2022 23:28:25 +0100 (CET)

> ------------------------------
> From: Dennis Williamson <dennistwilliamson@gmail.com>
> To: Sysadmin Lists <sysadmin.lists@mailfence.com>
> Cc: help-bash <help-bash@gnu.org>
> Subject: Re: simpler question about my script
>
> There are differences (and sometimes overlap) among concise, verbose,
> dense, gibberish, time- or space-constrained and "too clever by half"
> pieces of code. Sometimes priorities have to be compromised, but
> readability and maintainability have to be among the highest because
> programmer time remains expensive while hardware cost per performance has
> declined. In very small-scale (project life span, for example) or personal
> environments sometimes expediency becomes the top priority, but - surprise!
> - now your "quick-and-dirty" has become production and the technical debt
> starts ballooning.

Throughout my career I've been tasked with maintaining legacy sed, perl, and
awk scripts. I've lost count how often I've read something written 10-15
years ago and thought, "damn, that's clever!" But not modern scripts; their
quality has deteriorated. On several occasions I've needed to modify a legacy
script, written out 4 lines of code, thought about it for 5 minutes, and reduced
it to a single-line change. The advice on simplicity is having an unintended
effect on new coders|sysadmins: in practice we've turned "keep it simple, 
stupid"
into "keep it stupid, simpleton."

You're right about the benefits, but there are detrimental effects. We're
destroying our industry. Have you seen some modern Python scripts?
Goodness gracious, they'd make an old coder blanch.

There's something deeply rewarding about coming up with some clever construct
or approach, then seeing it in one of O'Reilly's old books or the like. It's 
evidence of
a deeper understanding of the language. And it makes scripting fun. We should
encourage those high standards, not discourage them for the sake of time=money.
That should be the compromise: raise code-documentation standards instead of
lowering coding standards.

-- 
Sent with https://mailfence.com  
Secure and private email



reply via email to

[Prev in Thread] Current Thread [Next in Thread]