/dev/reading

Five Lines of Code

How and when to refactor
by Christian Clausen
The cover of Five Lines of Code
4.05/5 on Goodreads
ISBN 9781617298318
Published in 2021
336 pages

Description

In Five Lines of Code you will learn:

  • The signs of bad code
  • Improving code safely, even when you don’t understand it
  • Balancing optimization and code generality
  • Proper compiler practices
  • The Extract method, Introducing Strategy pattern, and many other refactoring patterns
  • Writing stable code that enables change-by-addition
  • Writing code that needs no comments
  • Real-world practices for great refactoring

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.” 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.