in reply to Different ways of formatting/writing code

I personally like your style of:
sub function_A { .... }
because human beings can see patterns better vertically rather than diagonally. There is a history behind this { on the same line stuff. I used to do it that way too, but I have changed my "evil" ways. I think that vertical paren alignment is better, but of course the language allows you do it either way.

The idea of function prototypes in Perl is a bit more dubious, but I don't think that was your question. Perl allows that too, but that doesn't necessarily mean that it is a good idea.

Replies are listed 'Best First'.
Re^2: Different ways of formatting/writing code
by DStaal (Chaplain) on Dec 09, 2009 at 17:14 UTC

    Whereas I think that's confusing: The { is just visual noise, and I'd rather it were out of the way by putting it on the line above. That way I can focus on actual pattern: It starts at the sub/if/loop, and ends at the brace. (To me.)

    But it's all personal opinion. The one thing not to do is to mix styles. If you use one in a particular source file/project, use it throughout. That way people know what to expect when they read/skim the code.