[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Spaghetti, macaroni or ravioli?
- From: Francisco Olarte <folarte@...>
- Date: Wed, 16 Aug 2017 13:10:18 +0200
On Wed, Aug 16, 2017 at 12:17 PM, Frank Kastenholz
> The 2 primary rules for indentation that I use are
> 1 follow whatever the style is that already exists as
> 2 always indent the same way
> This reduces the amount of interpretation and thinking needed by the next person to read the code
Whish many times happens to be your older self.
> So I would always indent as:
>> if condition then
> And, as was suggested, I'd probably recast as
> if ~condition then
I've found that the second style is easy to reparse when there is more
code following, and teh indentation-saving is a nice to have, but when
it is alone, i.e.,
do -- or if, or for, or whatever block construct
if condition then
This version is easier (for me) to read.