Article 54R44 CodeSOD: Rings False

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.

proget-icon.png [Advertisement] ProGet supports your applications, Docker containers, and third-party packages, allowing you to enforce quality standards across all components. Download and see how! TheDailyWtf?d=yIl2AUoC8zAUrI8A_pQnl8
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments