Goodbye, Clean Code — overreacted
My colleague has just checked in the code that they’ve been writing all week. We were working on a graphics editor canvas, and they implemented the ability to resize shapes like rectangles and ovals by dragging small handles at their edges. The code worked. But it was repetitive. Each shape (such as a rectangle or an oval) had a different set of handles, and dragging each handle in different directions affected the shape’s position and size in a different way. If the user held Shift, we’d also need to preserve proportions while resizing. There was a bunch of math. The code looked something like this: That repetitive math was really bothering me. It wasn’t clean. Most of the repetition was between similar directions. For example, Oval.resizeLeft() had similarities with Header.resizeLeft(). This was because they both dealt with dragging the handle on the left side. The other similarity was between the methods for the same shape. For example, Oval.resizeLeft() had similarities with the ot
Goodbye, Clean Code January 11, 2020 Pay what you like It was a late evening. My colleague has just checked in the code that they’ve been writing all week. We were working on a graphics editor canvas, and they implemented the ability to resize shapes like rectangles and ovals by dragging small handles at their edges. The code worked. But it was repetitive. Each shape (such as a rectangle or an oval) had a different set of handles, and dragging each handle in different directions affected the shape’s position and size in a different way. If the user held Shift, we’d also need to preserve propor
Explore this link on the map →related reading
- Repeat yourself, do more than one thing, and... — programming is terribleprogrammingisterrible.com
- Things You Should Never Do, Part I – Joel on Softwarejoelonsoftware.com
- AHA Programming 💡kentcdodds.com
- The Wrong Abstraction - Sandi Metzsandimetz.com
- programming practices - How to comprehend abstraction in code? - Software Engineering Stack Exchangesoftwareengineering.stackexchange.com
- Mistakes engineers make in large established codebasesseangoedecke.com
- 6 Weeks of Claude Code - Puzzmo Blogblog.puzzmo.com
- GitHub - johnousterhout/aposd-vs-clean-code: A discussion between John Ousterhout and Robert Martin about differences between John's book "A Philosophy of Software Design" and Bob's book "Clean Code". · GitHubgithub.com
- The Joel Test: 12 Steps to Better Code – Joel on Softwarejoelonsoftware.com
- Refactoring Techniquesrefactoring.guru
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com