Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^6: How has your coding style changed over the years?by Tux (Canon) |
on Aug 11, 2022 at 07:00 UTC ( [id://11146095]=note: print w/replies, xml ) | Need Help?? |
In my perception/style, that end (and done) should be indented
It is all about the visual understanding of the code-flow. You read the statements start (if/while/do/for/unless/…) en see the *block* will not be executed, and you need to navigate to the next statement (which of course has the same indent), The end is not the next statement, but the (visually uninteresting) end/close of the block belonging to the statement you just skipped. My brain doesn't want to see that end at all when browing code. In your Ruby example do and end are syntax only. The represent no action whatsoever and act as { and }. All of them are no statements: they are syntax (to mark start and end of a block), just like ; is to mark the end of a statement. Enjoy, Have FUN! H.Merijn
In Section
Meditations
|
|