From Five Lines of Code by Christian Clausen

Take 40% off the entire book. Just enter code slclausen into the discount code box at checkout at

Improving existing code—refactoring—is one of the most common tasks you’ll face as a programmer. Five Lines of Code teaches you clear and actionable refactoring rules that you can apply without relying on intuitive judgements such as “code smells.” It’s written for working developers, guiding you step by step through applying refactoring patterns to the codebase of a 2D puzzle game. Following the author’s expert perspective—that refactoring and code smells can be learned by following a concrete set of principles—you’ll learn when to refactor your code, what patterns to apply to what problem, and the code characteristics that indicate it’s time for a rework. Thanks to this hands-on guide, you’ll find yourself programming faster while still delivering high-quality code that your teammates will love to work with.