[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: |
Fri, 18 Feb 2022 00:06:05 +0100 (CET) |
> ----------------------------------------
> Message: 1
> Date: Tue, 15 Feb 2022 17:17:19 -0600
> From: Dennis Williamson <dennistwilliamson@gmail.com>
> To: Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
> Cc: help-bash <help-bash@gnu.org>
> Subject: Re: simpler question about my script
>
> A few tips (some are specific to shell scripts):
> ....
> Avoid being clever. Clarity is important. Avoid side effects whenever
> possible.
> ....
> Know when and why to bend the rules, but keep it to a minimum.
>
> Some of these tips are intended to draw a distinction between command-line
> use where brevity has value and scripting where clarity is a higher
> priority.
That's an excellent list except for the (qualified) part about cleverness, IMO.
If you read through old (I mean 70s and 80s) code, it's stuffed with
cleverness. Being clever forces a deeper understanding of the language in use,
forces brevity, and forces tight flow-control. It doesn't take away from
readability if you comment your code well (which is also a dying art probably
tied to the advice about cleverness). I see "avoid being clever" becoming "be
lazy" in the real world.
--
Sent with https://mailfence.com
Secure and private email
- Re: simpler question about my script, (continued)
- Re: simpler question about my script, Alex fxmbsw7 Ratchev, 2022/02/15
- Re: simpler question about my script, Greg Wooledge, 2022/02/15
- Re: simpler question about my script, Alex fxmbsw7 Ratchev, 2022/02/15
- Re: simpler question about my script, Alex fxmbsw7 Ratchev, 2022/02/15
- Re: simpler question about my script, Alex fxmbsw7 Ratchev, 2022/02/15
- Re: simpler question about my script, Dennis Williamson, 2022/02/15
- Re: simpler question about my script, Alex fxmbsw7 Ratchev, 2022/02/16
- Re: simpler question about my script, Dave Jennings, 2022/02/15
- Re: simpler question about my script, Dennis Williamson, 2022/02/15
- Re: simpler question about my script, Dave Jennings, 2022/02/16
Re: simpler question about my script,
Sysadmin Lists <=
Re: simpler question about my script, Sysadmin Lists, 2022/02/18
Re: simpler question about my script, Sysadmin Lists, 2022/02/20