Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^7: How has your coding style changed over the years?

by Fletch (Bishop)
on Aug 11, 2022 at 14:01 UTC ( #11146100=note: print w/replies, xml ) Need Help??


in reply to Re^6: How has your coding style changed over the years?
in thread How has your coding style changed over the years?

(Caveat this is of course a subjective almost aesthetic argument and maybe no one's really wrong (except this is just horrible . . . 0.25*:) )

It feels as if you've (almost) reimplemented python's terrible indentation-is-block structure but kept the requirement that you have to have a non-whitespace terminator token present. With this scheme it seems the worst of both worlds in that you both have to watch indentation levels like a hawk (maybe not a hawk because it's not whitespace semantically significant; perhaps like a slightly drunk kestrel or some other minorly impaired raptor . . .) but also still need to parse out and read for the terminator that also has to be there.

If there's going to be an explicit terminator then it should be visually interesting (i.e. exdented) so it can be picked out of the flow of the meat of the block. With this scheme I'd feel one can't skim over the contents of the block as easily because the end terminator of said block doesn't stand out so one is then stuck actually parsing the entire block text to find it / make sure the block is syntactically valid.

But again, personal aesthetics tomayto tomahto let's call the whole thing off.

And a very tangentially related aside: for command line usage I like the short_loops option for zsh which lets you elide the do/done and use a braced list instead:

for i in a b c d ; { print $i ; $i/bin/do_foo }

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^8: How has your coding style changed over the years?
by GrandFather (Saint) on Aug 12, 2022 at 03:53 UTC

    For almost all of us "indent is block" is standard. The difference with Python is indent structure is forced by the language and breaking lines in sensible places becomes a real PITA.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2022-12-09 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?