Î
Îίκος
Στις 28/9/2013 4:59 πμ, ο/η Chris Angelico ÎγÏαψε:
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?
I agree with everything you say, but i also have to say that evenIt'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
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?