Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: How would you indent this?

by ikegami (Patriarch)
on Mar 18, 2021 at 07:42 UTC ( [id://11129896]=note: print w/replies, xml ) Need Help??


in reply to Re: How would you indent this?
in thread How would you indent this?

The problem with this is style is that the nether the braces nor the fields line up.

This is really bad.

We use indentation to identify where something starts and ends, but there's no } matching the row's {. It's ended up off by one.

We use indentation to indicate what is part of the same block, but name isn't at same level as key even though they're in the same block.

With both false positives and false negatives, this is an complete indentation failure.

And that's not even getting into the fact that it completely dropped the ball on offering the ability to spot differences between the lines at a glance when it could easily have done so.

Seeking work! You can reach me at ikegami@adaelis.com

Replies are listed 'Best First'.
Re^3: How would you indent this?
by parv (Parson) on Mar 18, 2021 at 08:27 UTC

    In my own code I have given up on lining up either fields or the braces. As long as closing brace (or a key|field) is placed in a same column or after of opening brace (or previous key|field) (via indentation of expanding tabs), I am good.

    Anyone or anything (commit hook for example) else is more than free to mangle that to their own liking.

    I do not understand this part if you care to explain ...

    And that's not even getting into the fact that it completely dropped the ball on offering the ability to spot differences between the lines at a glance when it could easily have done so.
      > I do not understand this part if you care to explain ...

      This particular structure is semantically a table with one empty cell. He want's this table structure to be visible.

      I'm not aware of any Perl tool with the necessary heuristics to detect that table structure and to handle empty cells.

      At best Perl::Tidy with some obscure options, but not out-of-the-box

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      I do not understand this part if you care to explain ...

      The rows have different number of fields, but your choice of style doesn't make that stand out like some of the other options do.

      Seeking work! You can reach me at ikegami@adaelis.com

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11129896]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-29 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found