Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'main()': 0.05; '__name__': 0.07; 'python': 0.07; '"__main__":': 0.09; 'to:name:python mailing list': 0.09; 'bottom.': 0.16; 'decompose': 0.16; 'thanks,': 0.17; 'this?': 0.18; 'says': 0.25; 'script': 0.26; "i'm": 0.26; 'function': 0.27; 'message-id:@mail.gmail.com': 0.28; 'problem': 0.29; 'hi,': 0.29; 'convention': 0.29; 'does': 0.31; 'however,': 0.31; 'called': 0.32; 'to:addr:python-list': 0.32; 'creates': 0.33; 'lines': 0.34; 'there': 0.35; 'some': 0.37; 'should': 0.37; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'add': 0.39; 'header:Received:5': 0.40; 'below': 0.63; 'entitled': 0.64; 'flow': 0.69; 'received:74.125.83': 0.69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=171BnhJTGFUtu3NBeUBk486uD5og5KHFHCEBNweQ0mQ=; b=N+lQp7P3idUiENRHO+NUrj+89pe38ZMQxCL2V6z/GBPZTd0Q3e5UvzLGG2GPvfc1GX SFXtCNWUStZUUv/NKSkVfMvYNDvc9tGL+JapLHViNNvsYHViVgyogYNmU8ySa3lyoSQW Das1UB6sZfKOdACmXzPbWkx5CNf38hoI8y/fw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=SFMveUgYv3TgzUo/H2SDo+l3ieF5Y/KN6PmwOPhrgIJCLKXraIABzrSZt2eqjsmLWe UHgH1KozjGWroq9Mb+a71V6A/8SBy/MnPQbjlWpz+TG4h2Lu9S6Sw221ah7YDp2oMR3G U7tOekS6MBPUma7H2LTeU3NijAb6M03QVftto= MIME-Version: 1.0 From: Jabba Laci Date: Tue, 3 May 2011 18:08:27 -0400 Subject: vertical ordering of functions To: Python mailing list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1304460530 news.xs4all.nl 81481 [::ffff:82.94.164.166]:37453 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4580 Hi, I'm just reading Robert M. Martin's book entitled "Clean Code". In Ch. 5 he says that a function that is called should be below a function that does the calling. This creates a nice flow down from top to bottom. However, when I write a Python script I do just the opposite. I start with the lines if __name__ == "__main__": main() Then I add main() above, which is a control function that contains some function calls that decompose the problem into subproblems. Then I add these functions above, etc. Is there a convention for this? Should main() be at the top and called function below? Thanks, Laszlo