[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Spaghetti, macaroni or ravioli?
- From: Francisco Olarte <folarte@...>
- Date: Wed, 16 Aug 2017 13:10:18 +0200
Hi:
On Wed, Aug 16, 2017 at 12:17 PM, Frank Kastenholz
<fkastenholz@verizon.net> wrote:
> 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
>> call_my_routine()
>> else
>> return
>> end
> And, as was suggested, I'd probably recast as
> if ~condition then
> return
> end
> call_my_routine()
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
call_my_routine()
else
return
end
end
This version is easier (for me) to read.
Francisco Olarte.