Timeline for In Python, should I use else after a return in an if block?
Current License: CC BY-SA 2.5
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 18, 2011 at 8:17 | comment | added | Rafał Dowgird | Some logging and assertions can be put in a decorator. Others not so easily, so good point. | |
Feb 17, 2011 at 20:45 | comment | added | Corey Ogburn | I've never liked One Entry, One Exit style of programming. If you are done with your method and have exactly what you need to return... RETURN! I feel the stack plumps up with wasted result variables. | |
Feb 17, 2011 at 20:38 | history | made wiki | Post Made Community Wiki by Robert Harvey | ||
Feb 17, 2011 at 20:16 | comment | added | S.Lott |
@John Machin: Guilty as charged. And too much formal theory. It's easier to add logging and formal assertions before the return .
|
|
Feb 17, 2011 at 20:15 | comment | added | John Machin | Symptom of excessive exposure to Pascal in infancy :-) | |
Feb 17, 2011 at 20:08 | history | edited | S.Lott | CC BY-SA 2.5 |
added 56 characters in body
|
Feb 17, 2011 at 20:02 | history | answered | S.Lott | CC BY-SA 2.5 |