[TriLUG] Broad question

William Sutton via TriLUG trilug at trilug.org
Wed Sep 6 19:03:23 EDT 2023


On Mon, 4 Sep 2023, Steve Litt via TriLUG wrote:

> William Sutton via TriLUG said on Mon, 4 Sep 2023 13:29:52 -0400 (EDT)
>
>
>> One more negative about Python:  the use of indentation to determine 
>> scope.  That's just a horrible idea.
>
> 1) With indentation based scope, you never again need to count curly
>   braces.

I don't have to because
1. I'm careful
2. when I'm not, Perl tells me something's wrong
3. I can bounce between braces in vim using % :-)

>
> 2) You never again have your indentation depart from what's really
>   happening.

On the other hand, if I (sanely) freeform indent, it /can/ be more 
readable.  I tend to use perltidy with -b -gnu in my .perltidyrc file.

>
> 3) No more brace placement feuds. GNU! No, Whitesmith! Oh HELL no, K&R!
>   No way, Ratliff! Ratliff's ridiculous, use Pico! Oh never mind,
>   we'll just each do it our own way.

True ... or you just set up a linter or something with agreed upon (or 
dictated) standards, and fail code that doesn't meet those.  Or in my 
case, use perltidy.

>
> 4) With indentation based scope, you know exactly what's going on at a
>   glance.

mmmm ... or with braces, I can use freeform indentation and better see 
what's going on.  Not to argue with you that there are a lot of coders who 
use crummy formatting.  There are.  And they need a cluebat or other 
suitable LART to reform them.

>
> 5) With indentation based scope, the interpreter checks your
>   indentation against your code, lessening the chance of you doing
>   something you didn't intend to do.
>
> Obviously, the one downside is that everyone in the organization must
> agree on tabs vs spaces and stick to their choice religiously.

Another reason to use a linter or something like.

All in friendly discussion, of course.

>
> SteveT
> -- 
> This message was sent to: William <william at trilug.org>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web	: https://www.trilug.org/mailman/options/trilug/william%40trilug.org
> Welcome to TriLUG: https://trilug.org/welcome


More information about the TriLUG mailing list