4 ms·
Yes! I really like "99 Bottles of OOP" by Sandi Metz. I feel like it's a version of "Clean Code" that my brain actually aligns with. In a chapter, talking abou
by graypegg 2y ago
Yes! I really like "99 Bottles of OOP" by Sandi Metz. I feel like it's a version of "Clean Code" that my brain actually aligns with.
In a chapter, talking about different ways you could write a class that generates verses for the song 99 bottles of beer, we end up at:
https://sandimetz.com/99bottles-sample-ruby#_shameless_green https://sandimetz.com/99bottles-sample-ruby#_shameless_green
The Shameless Green solution is disturbing because, although the code is easy to understand, it makes no provision for change. In this particular case, the song is so unlikely to change that betting that the code is "good enough" should pay off. However, if you pretend that this problem is a proxy for a real, production application, the proper course of action is not so clear.
When you DRY out duplication or create a method to name a bit of code, you add levels of indirection that make it more abstract. In theory these abstractions make code easier to understand and change, but in practice they often achieve the opposite. One of the biggest challenges of design is knowing when to stop, and deciding well requires making judgments about code.
- vsuperpower2020 2y agoThis book is beyond parody. I send it to people I hate and want to sabotage, along with clean code.
- celdon25 2y agoSo you’re actually sabotaging the people who have to maintain their code, not them.
- graypegg 2y ago...ok? Noted, you do not like the book I like.
- Joker_vD 2y agoWhich means that in the future not only can you two ignore each other's book recommendations, you can also note each other's book disrecommendations to find stuff you'd actually enjoy! It's a win-win!
- graypegg 2y agoHAH! I kind of like the idea of a site where you can post recommendations for books, and subscribe to other people's recommendations, OR the inverse of other people's recommendations
- vsuperpower2020 2y agoGood idea. Other books I hate for you: Game programming patterns, Crafting Interpreters, the C# player's guide.
- em-bee 2y agoyou mean like this place? https://www.goodreads.com/book/show/31183020-99-bottles-of-oop https://www.goodreads.com/book/show/31183020-99-bottles-of-o...