Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by GrandFather (Saint)
on Aug 12, 2022 at 03:57 UTC ( [id://11146111]=note: print w/replies, xml ) Need Help??


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

I'm curious to know why the opening brace goes on the conditional line.

It is reassuring that someone else uses the same argument for indented braces that I do. It seems to be a highly unusual thing!

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
  • Comment on Re^5: How has your coding style changed over the years?

Replies are listed 'Best First'.
Re^6: How has your coding style changed over the years?
by Tux (Canon) on Aug 12, 2022 at 06:12 UTC

    The opening brace goes on the line of the statement because

    • It saves vertical space: now I can see more code on my screen/window and have a bigger (over)view on the context
    • As the closing vrace, it is just syntax and by that reason does not deserve a line of its own
    • The closing brace has a line of its own, because the last line in the block is likely to change or new lines to be inserted before the brace.

    (In an ideal world, my editor should optionally replace the line with the closing brace with a (coloured) hairline starting at the left indent of the block till the right edge of the windown.)

    Maybe obvious from above: I am not a big fan of too much vertical whitespace. I'd forbid more than one blank line between logical blocks.


    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found