Pointless Code In Your Source
- by Ali
I've heard stories of this from senior coders and I've seen some of it myself. It seems that there are more than a few instances of programmers writing pointless code. I will see things like:
Method or function calls that do nothing of value.
Redundant checks done in a separate class file, object or method.
if statements that always evaluate to true.
Threads that spin off and do nothing of note.
Just to name a few. I've been told that this is because programmers want to intentionally make the code confusing to raise their own worth to the organization or make sure of repeat business in the case of contractual or outsourced work.
My question is. Has anyone else seen code like this? What was your conclusion was to why that code was there?
If anyone has written code like this, can you share why?