My text-editor (Vim with a set of macros; thanks Damian, Randal, Uri, Anonymmous, and others) does a fair job of highlighting Perl source code and has an auto-bounce-on-the-%-key feature that shows were the closing character matches up. Add that to a perl-tidy() run every week or so, and I have a reasonably easy tool chain I can use to enforce my coding style.
The important thing to remember is that "Coding Style" is a convention used to make your code easier for the Maintenance Programmer to understand. There is no one 'Holy and Sacred Way'; no Tao.
Like text editor choice, Style is good for discussions over Beer, but there is no one-true-way. (Rudyard Kipling said it better than I can -- "There are nine and sixty ways of constructing Tribal Lays, and every single one of them is right!", from 'In the Neolithic Age')
The worst thing you can do is *not* to have a consistent style. Pick a style of bracing and indentation that works for the way you feel comfortable writing your code a stick with it. Set up your editor of choice to produce that style and build a perl-tidy() configuration to regenerate code in that style. The MP will thank you for it. (And, there is nothing more embarrassing than picking a five-year-old piece of crufty old code, discovering that the coding style is "HidJe-ous! The indenting is inconsistent, and the bracing is **all** wrong!!", and then realizing who wrote it....)
----
I Go Back to Sleep, Now.
OGB
In reply to Re: Different ways of formatting/writing code
by Old_Gray_Bear
in thread Different ways of formatting/writing code
by DreamT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |