Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107532
| From | Christopher Reimer <christopher_reimer@icloud.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: How much sanity checking is required for function inputs? |
| Date | 2016-04-23 20:19 -0700 |
| Message-ID | <mailman.25.1461467961.32212.python-list@python.org> (permalink) |
| References | (8 earlier) <1461302724.477236.586265777.181ACCA0@webmail.messagingengine.com> <CAGgTfkNz5aeS5Jo+3yc+nWjUKnfhe=0zBVNeNHUMHD6Uj9VyEA@mail.gmail.com> <571C2541.9050309@icloud.com> <571C30C8.5000208@gmail.com> <571C3B32.4040306@icloud.com> |
On 4/23/2016 7:34 PM, Michael Torrie wrote > Procedural programming does not necessarily mean BASIC-style goto hell. > Not sure why you would think that. In fact that's not really what > procedural programming is about. I mentioned several messages back that I spent two years writing procedural scripts AND translating BASIC games into Python, which can be goto hell if the program has a drop-down structure that makes sense only from following the entry point of the goto statement (see link for example). http://www.atariarchives.org/basicgames/showpage.php?page=9 I try to follow the BASIC program structure as closely as possible, get it working in Python, and use pylint to make my code PEP8-compliant. Pylint frequently complains about exceeding a dozen if branches in the main function. I then create helper functions to reduce the if branches. Sometimes that makes the Python version either shorter or longer than the original BASIC program. Thank you, Chris R.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: How much sanity checking is required for function inputs? Christopher Reimer <christopher_reimer@icloud.com> - 2016-04-23 20:19 -0700
csiph-web