Coding Confessional

Anonymous Confessions from Programmers.

Comments

Bruce:

That is the true sign of a weak programmer.

guchi:

It gets better.

sivaji:

x = expression
:) :)

Anonymous:

x = (bool) expression;

Anonymous:

The guy I replaced did this everywhere...

Anonymous:

The 1 line version is more efficient in LOC, if not real performance. But woe unto the lead dev who now has to spend a 1/2 hour explaining it to a junior dev who doesn't get it. The multi-line version is at least explicit about what it's doing.

Anonymous:

brillant! but just to be extra supa dupa clear, you should write it instead as follows:
if expression==True: x = True
if expression==False: x = False

Anonymous:

Maybe "True" and "False" are objects.

Anonymous #1:

I do this on occasion so I can add debugging or breakpoints on one path or another.