CodeSOD: Rings False
by Remy Porter from The Daily WTF on (#54R44)
There are times when a code block needs a lot of setup, and there are some where it mostly speaks for itself. Today's anonymous submitter found this JavaScript in a React application, coded by one of the senior team-members.
if (false === false){ startSingleBasedApp();} else { startTabNavigation();}
Look, I know how this code got there. At some point, they planned to check a configuration or a feature flag, but during development, it was just faster to do it this way. Then they forgot, and then it got released to production.
Had our submitter not gone poking, it would have sat there in production until someone tried to flip the flag and nothing happened.
This is why you do code reviews.
[Advertisement] ProGet supports your applications, Docker containers, and third-party packages, allowing you to enforce quality standards across all components. Download and see how!