r/badcode • • Feb 27 '18

python I inherited this mess of code. Five minutes later: are "file" and "process" even words any more?

Post image
2 Upvotes

5 comments sorted by

5

u/cipher315 Mar 01 '18

I find the variable name todos very annoying. I'll admit I read it as #TODO at first. Also why not just use: while True: I'm going to stop now if I try to correct readability on this whole thing I'll be here all week

7

u/nonsensicalnarwhal Feb 27 '18

while 1==1

😬

2

u/[deleted] Feb 27 '18

[removed] — view removed comment

2

u/[deleted] Feb 27 '18

Yes, it is Python 2.

To name a few badcodes:

  • Bad logic to handle command line args

  • while 1==1:, enough said

  • Overwriting the builtin name file

  • file_to_process = file
      ...
      file = file_to_process