in reply to On Testing and Formatting Code
More importantly, I try and benchmark things against other answers. I always wanna know why/how things work so one day when it does matter that I did it the fast way, my instincts will lead me down the mostly-right path =)
As to formatting, I like compressed code, so I tend to hang the open braces on the main line and indent body only. I ALWAYS use tabs IRL and tend to have my vim set to 3space tabs.
Spacing brackets and parens is becoming a habit as well, I pad inside and out of brackets, braces, and parens that block code, enclose arguments, or create arrays/lists. Never spaces on array brackets or hash keys. Space on both sides of assignments and math is generally a must, excepting a few degenerate cases like $a+0 and the like.
Vertical whitespace is for separating logical blocks of code, especially in long linear sections.
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 2: On Testing and Formatting Code
by tilly (Archbishop) on Oct 05, 2000 at 06:53 UTC | |
by extremely (Priest) on Oct 06, 2000 at 06:09 UTC |