Regarding coding style

Lie Lie.1296 at gmail.com
Sun Mar 9 10:25:24 CET 2008


On Mar 9, 3:27 am, castiro... at gmail.com wrote:
> To Lie:
>
> > Personally I preferred a code that has chosen good names but have
> > little or no comments compared to codes that makes bad names and have
>
> Personally I don't.  Show me a good one.  Until you do, it's not that
> I won't like it, it's that I can't.  You know, in linguistics, there's
> what's called 'code switching', which is switching between two
> languages you know midstream.  People can understand 'hear' a language
> but not speak it.  If you speak it, <leaves open>.  If comments aren't
> the 'short version', then patience is the problem.  There's not one
> word for lots and lots of things.  Examples on backorder.

But I much prefer it that the code has good names AND concise
comments, not too short and not too long that it becomes obscure. If
the code is complex, that it's hard to explain in a few sentences, it
might be a good idea to refactor it.

If I have to choose between bad names + twenty pages of documentation
and good names + a paragraph of short documentation, I chose the
latter.




More information about the Python-list mailing list