UTF-conversion was failing for a chinese # user for reasons I couldn't understand. # Added "ignore" as second argument to handle # that temporarily. name = name.encode("utf-8", "ignore") Document special cases
int value for {}".format(key)) def add(input_data): x = get_int(input_data, "x") y = get_int(input_data, "y") return x+y Avoid Duplication - generalize instead
required • Split the program into small independent modules & functions • Avoid duplication • Suppress implementation details • Always optimize for readability
and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.”
and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.”
like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.” - The Tao of Programming