Steven D'Aprano: > There's less code, fewer bugs and lines. Less applies to continuous > quantities, like weight and "amount of code", and fewer applies to > countable quantities.
Thank you, I'll try to improve my use of the language. > Within reason, naturally. There's a reason why we write: > for button in buttons: > move(button, delta_x, delta_y) > instead of > for b in bs: mv(b, x, y) > even though the second is significantly shorter. Often Shortening names and packing more stuff in single lines that deserve to be two lines aren't good ways to shorten code. > Also, I don't think there's much advantage in trying to push new > programmers to reduce the amount of code. Until you're really comfortable > with the language, you need training wheels and scaffolding in the form > of verbose code. Sometimes you really don't appreciate Python's labour > saving features until you've experienced how much labour there is to be > saved. I don't agree. When you learn to code you also have to learn what does it mean to write "good code", you have to learn that there are several things that are important beside writing a correct output, like good comments, well thought out names, good indentation, good idioms, quick running time, small memory usage, writing clear and readable code, and later develop elegance, the power of composition, abstraction, indirection, meta programming, etc. Among such things there's the importance of writing short programs. All such things are the seeds that will develop into the personal style of the future programmer. Such things are also useful for another purpose: to help the student understand that code is craftsmanship, so she/he/shi can (and is supposed to) be proud of the code that writes. This helps the student understand that programming isn't just an ugly way to tell orders to a moronic CPU, that helps develop appreciation for the act of writing code, because it becomes something you do also for the sake of it, as you do art, beside for usefulness. So you have to teach and show such things from more or less the beginning. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list