( names in the enclosing moduleare usually poor way for functions to communicate they can create dependencies and timing issues that make programs difficult to debugchangeand reuse couplingdon' change mutable arguments unless the caller expects it functions can change parts of passed-in mutable objectsbut (as with global variablesthis creates tight coupling between the caller and calleewhich can make function too specific and brittle cohesioneach function should have singleunified purpose when designed welleach of your functions should do one thing--something you can summarize in simple declarative sentence if that sentence is very broad ( "this function implements my whole program")or contains lots of conjunctions ( "this function gives employee raises and submits pizza order")you might want to think about splitting it into separate and simpler functions otherwisethere is no way to reuse the code behind the steps mixed together in the function sizeeach function should be relatively small this naturally follows from the preceding goalbut if your functions start spanning multiple pages on your displayit' probably time to split them especially given that python code is so concise to begin witha long or deeply nested function is often symptom of design problems keep it simpleand keep it short couplingavoid changing variables in another module file directly we introduced this concept in and we'll revisit it in the next part of the book when we focus on modules for referencethoughremember that changing variables across file boundaries sets up coupling between modules similar to how global variables couple functions--the modules become difficult to understand and reuse use accessor functions whenever possibleinstead of direct assignment statements figure - summarizes the ways functions can talk to the outside worldinputs may come from items on the left sideand results may be sent out in any of the forms on the right good function designers prefer to use only arguments for inputs and return statements for outputswhenever possible of coursethere are plenty of exceptions to the preceding design rulesincluding some related to python' oop support as you'll see in part vipython classes depend on changing passed-in mutable object--class functions set attributes of an automatically passed-in argument called self to change per-object state information ( self name='bob'moreoverif classes are not usedglobal variables are often the most straightforward way for functions in modules to retain single-copy state between calls side effects are usually dangerous only if they're unexpected in general thoughyou should strive to minimize external dependencies in functions and other program components the more self-contained function isthe easier it will be to understandreuseand modify advanced function topics