might fail the scrutiny of rigorous code reviewselection list as just mentionedthe list of languages supported by this program lives in two placesthe html file and the cgi script' tableand redundancy is killer for maintenance work field name the field name of the input parameterlanguageis hardcoded into both files as well you might remember to change it in the other if you change it in onebut you might not form mock-ups we've redundantly coded classes to mock-up form field inputs twice in this alreadythe "dummyclass here is clearly mechanism worth reusing html code html embedded in and generated by the script is sprinkled throughout the program in print call statementsmaking it difficult to implement broad web page layout changes or delegate web page design to nonprogrammers this is short exampleof coursebut issues of redundancy and reuse become more acute as your scripts grow larger as rule of thumbif you find yourself changing multiple source files to modify single behavioror if you notice that you've taken to writing programs by cut-and-paste copying of existing codeit' probably time to think about more rational program structures to illustrate coding styles and practices that are friendlier to maintainerslet' rewrite (that isrefactorthis example to fix all of these weaknesses in single mutation step sharing objects between pages-- new input form we can remove the first two maintenance problems listed earlier with simple transformationthe trick is to generate the main page dynamicallyfrom an executable scriptrather than from precoded html file within scriptwe can import the input field name and selection list values from common python module fileshared by the main and reply page generation scripts changing the selection list or field name in the common module changes both clients automatically firstwe move shared objects to common module fileas shown in example - example - pp \internet\web\cgi-bin\languages common py ""common objects shared by main and reply page scriptsneed change only this file to add new language ""inputkey 'languageinput parameter name refactoring code for maintainability