If there was The Biggest Loser for software, legacy applications would be up there sweating on the treadmill and trying to resist the chocolate cake.
One of the characteristics of legacy code bases is bloat, fat, weight - basically stuff that we could do without.
This bloat slows us down: more scrolling, more stuff to distract us from the thing we're looking for, longer VCS operations, longer builds, more keystrokes etc.
15 Diet Tips for Overweight Apps
- Remove unused usings
- Removed DLL references that aren't needed (and delete the DLLs from source control)
- Delete commented out code (you are using a VCS right?)
- Delete pointless class or method XML comments (empty summary, params with no useful info, etc.)
- Delete unused class files
- Delete commented out tests
- Delete ignored tests (if you can't un-ignore them and get them working quickly)
- Delete bad tests (tests without asserts, etc.)
- Remove unused variables, methods, constants, etc.
- Delete unused screens, pages, custom/user controls
- Removed unused CSS styles
- Remove pointless inline comments "// the line below declares a variable for loop counter"
- Remove multiple line spaces between members (unless you like them)
- Delete unused configuration settings