Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by GrandFather (Saint)
on Aug 12, 2022 at 03:57 UTC ( #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? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-11-29 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?