Mailinglist Archive: opensuse (1786 mails)

< Previous Next >
Re: [opensuse] question on if clause formatting
On 11/10/2011 8:29 PM, Anton Aylward wrote:
George OLson said the following on 11/10/2011 07:58 PM:
Ah, ok. that makes sense, why it is better to use 'test' instead of
[ .. ]

1. Personal choice
2. Readability
3. Clarity

"Clarity" because while it is clear to some of us GreyBeards it
obviously wasn't clear to you, which is why this thread started.

Pff, that's what comments are for. ;)

I don't like typing. (haha no really, or maybe just run out of keystrokes after long mail list posts.)

I say, if you can't read the code, you by definition aren't qualified to be monkeying with it, since I may use dense syntax but things will be organized pretty well and commented where necessary and built to be as future adjustable as possible.

I will generally put the most likely adjustable stuff into variables at the top, with a nice comment if it's not completely self explanatory, that anyone can figure out and change without breaking it.

Anyone else, if they are fit to monkey with it at all, then they will find the main parts organized well enough into functions and/or logical blocks or sections with just the necessary comments to explain things that aren't necessarily auto-apparent by the code itself. And the use of denser syntax will not matter at all. As a reader of others scripts, I know I don't usually value their "clarity" ;)

Even the portability argument doesn't really matter any more.
Even a Xenix box from 1992 had ksh88 built-in stock and that was pretty good, and even my oldest still running SCO Open Server box has ksh93, bash, and zsh as add-ons and has ksh88 built-in stock.

I do have a tendency to use short cryptic variable names a bit too often though. A script full of single letter variables is certainly small and fast-looking, but can be a little hard to figure out a few years later. I generally try not to have to care later, make it a good robust black box that you won't have to go work on later.

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups