Is it new style or just lack of style?
John Schmitt
jschmitt at vmlabs.com
Fri Aug 3 13:50:35 EDT 2001
> -----Original Message-----
> From: paul at boddie.net [mailto:paul at boddie.net]
> Sent: Friday, August 03, 2001 2:18 AM
> To: python-list at python.org
> Subject: Re: Is it new style or just lack of style?
>
>
> Roman Suzi <rnd at onego.ru> wrote in message
> news:<mailman.996819245.9680.python-list at python.org>...
> > Hello!
> >
> > More and more I am starting to see people adding extra
> > blanks in ( ).
>
> [...]
>
> > Is it new style? I am sure this contradicts Python Style
> > Guide, but where from this new style appeared? I saw Java programs
> > with the same ugly padding...
>
> I first saw it employed in Java and C++ programs some time ago. I
> suspect it has more to do with the usage of poor text editing software
> than anything else; that is, software which isn't well-suited to
> editing programs.
[...]
Not in my case it isn't. I love that formatting style. It seems that I can
see what's what with just a quick glance.
Whitespace is beautiful and my code is art! :-)
>From my web page ( http://www.geocities.com/nuonguy/ ):
"We should be willing to look at the source code we produce not as the
end product of a more interesting process, but as an artifact in its
own right. It should look good stuck up on the wall."
- Alan & Colston's "The Programmer's Stone"
if __name__ == '__main__':
sys.exit( main( sys.argv[0], sys.argv[1:] ) )
Function definitions can also be made more beautiful. I've always done this
kind of thing in C way before the blessed day I encountered Python.
If I have a function that takes a few arguments, I lay it out like this:
def foo\
(
argument1, # meaninful comments
argument2,
):
# more beautiful code here
or in C, line up the types and variables in easy-to-read columns:
void foo
(
DataType meaninful_variable, // meaninful comment goes here
int var1, // meaninful comment goes here
char var2, // meaninful comment goes here
OpaqueDataType var3 // meaninful comment goes here
)
{
// more beautful code
}
More information about the Python-list
mailing list