Στις 28/9/2013 4:59 πμ, ο/η Chris Angelico έγραψε:
On Sat, Sep 28, 2013 at 8:06 AM, Νίκος <nikos.gr...@gmail.com> wrote:
Well to tell the truth no matter what you say to me if something can be
written in less lines than another implementation but still retain its
simplicity and straightforward logic behind it i would prefer it!
I don't know why you think otherwise, especially people who are used to
write Perl code(me being one of them) would agree with me!
It's high time you stopped trying to write Perl code that runs under
the Python interpreter, and started writing Python code that runs
under the Python interpreter.
There are rules. You first learn the rules and learn to code within
them; then later, once you actually achieve some measure of
competence, you begin learning when to break the rules.
ChrisA
χεχεf
I agree with everything you say, but i also have to say that even
writing compact code which still retain its simplicity and understanding
its preferred to me and to other coders too.
For example i wouldn't change this line for anything in my code no
matter how simple you can get it look..
#check if date entered as intented, format it properly for MySQL
lastvisit = datetime.strptime(lastvisit, '%d %m %Y').strftime('%Y-%m-%d')
why write it in 2-3 lines when you cna have it written in 1-liner?
Isn't it clear as it is now?
--
https://mail.python.org/mailman/listinfo/python-list