47

Refactoring legacy code when...

if _out == True:
r = True
elif _out == False:
r = False

return r

Comments
  • 1
    My eyes! ๐Ÿ˜จ
  • 0
    Guh ๐Ÿคข
  • 2
    Why have one line of code when you can have five?!? ๐Ÿ˜‚๐Ÿค”๐Ÿคจ
  • 1
    For times when manager asks how many lines of code you wrote today.
  • 1
    That's much better than:

    return _out

    because when _out == None, it will blow up because r is not declared.
    Happy debugging :D
  • 0
    @Joserc87 if_out != None (return _out) else return False
  • 0
    @gears return _out or False

    What i mean is that, the multiple line version has an issue that will make it crash when _out == None
  • 0
    @Joserc87 what Lang because I tries that in python and it still crashed
  • 0
    Capitals for keywords (but not all keywords) ... My eyes ๐Ÿ˜ต
Add Comment