On 03/28/2010 09:57 PM, yd wrote: > It's not homework i just want to be able to convert my algorithm into > good code, and the only way to do that is by actually writing it. I'm > just writing it to learn how it's done.
In most cases, when: 1) the code is effective (i.e. it always gives correct answer) 2) the code is efficient (i.e. it terminates in a reasonable amount of time, and uses a reasonable amount of memory) 3) you can articulate why you write your code in a particular way, can describe why the algorithm works, and can answer when challenged 4) you and other people can read your code six months later with relatively little difficulty 5) your code is as concise as possible, without affecting #4 (e.g. leveraged most of the side work to another library, used common idioms in the appropriate situations, etc) in most case, you probably have written a good code. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor