DEV Community

Discussion on: Clean up your code by removing unneeded indentation ๐Ÿงน

Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ • Edited

These are quite poor examples TBH. The refactoring of the first one has added error logging, which confuses matters as the new code actually does something different to the original.

In both refactoring cases (particularly in the 2nd, but also in the 1st if the logging were not added) it probably would have been easier (and possibly more efficient) to simply combine the if statements