Three rules applied in a loop until duplicated branches converge into one: select the most similar pieces, locate the smallest difference, make the simplest change that removes it. A plain Ruby example worked through in one-line steps.
https://t.co/J4b2S5dLuY
Duplicated branches that build almost the same thing survive for years because unifying them looks like one big change. The convergence rules turn it into a series of one-line steps, with the tests green throughout.
https://t.co/J4b2S5dLuY
Object creation is a responsibility too.
A look at the factory patterns in plain Ruby: the Simple Factory, the hash-of-classes approach, the Gang of Four's Factory Method, and when injecting a dependency is the simpler choice.
https://t.co/5NBN3oIk3x
New post: Start With Ugly Code.
For a new problem, the simple code that passes the tests beats the clever one and the "extensible" one. A small Ruby example, real metrics, and TDD that keeps tests decoupled from the code.
https://t.co/pkN3A7UYYd
Your test suite breaking on every refactor isn't a coverage problem, it's a coupling problem.
New post: what to test, what to ignore, and how to stop doubles from going stale.
Ruby + RSpec
https://t.co/qBbAs5nx9v
Composition: Building with Parts.
Modules as roles, method lookup, composition over inheritance, and how to choose between them in Ruby.
https://t.co/qYOLqpSS38
Polymorphism in Ruby: Duck Typing and Inheritance.
Case-on-class as a hidden duck, Template Method with hook messages, and when each form of polymorphism applies.
https://t.co/yBx1iZJlOp
New on DevelClan: Messages Before Objects
Why object-oriented design starts with conversations, not classes. Sequence diagrams as discovery tools, the Law of Demeter, and concrete decoupling techniques in Ruby.
https://t.co/nhbtj0xJCS
New on DevelClan: The Singleton Pattern in Ruby
Built-in module, manual implementation, thread safety, the class variable trap, and why dependency injection is the key to using singletons without the pain.
https://t.co/OYjafBIlbb
Design isn't about making code pretty. It's about making change cheap.
Wrote about code friction, technical debt vs. over-engineering, and when your code is telling you it needs a redesign.
Full article with Ruby examples ↓
https://t.co/6uVVlrbixL
The Dependency Inversion Principle was born from static language limitations. Ruby doesn't have those constraints, so when does DIP actually matter?
I wrote about what it really means for Ruby devs 👇
https://t.co/JKJzwPn422
The Dependency Inversion Principle in Ruby: what it really means, when to use dependency injection, and when to keep your code simple.
https://t.co/CLmQkyhnVU
Merry Xmas! 🎄 New post: Interface Segregation Principle in Ruby 🔷
When does splitting interfaces reduce coupling, and when does it destroy cohesion? Practical examples with Forwardable and modules.
https://t.co/RToc04hAy5
How to apply the Interface Segregation Principle in Ruby, and why taking it too far can hurt your design. Practical examples and trade-offs.
https://t.co/fJgag2VQQ8
New on DevelClan: The Liskov Substitution Principle in Ruby.
What LSP really means with duck typing, structural vs behavioral violations, and when it's OK to break the rules.
https://t.co/wmpiGuYwSc
Applying OCP in your Rails app? 🤔
New article on when the Open-Closed Principle helps vs. when it adds unnecessary complexity.
https://t.co/7s390SFlQz
#RubyOnRails#Ruby
Explore the Open-Closed Principle in Ruby through practical examples using inheritance and the Strategy pattern. Learn how to balance strict SOLID adherence with pragmatic design decisions.
https://t.co/kbboRIk0lM
💎 Still passing Hashes around? It's time to refactor.
Ruby 3.2+ Data.define gives you proper Value Objects:
✅ Immutable
✅ Value equality
✅ Pattern Matching ready
Ditch the boilerplate and write safer domain code.
https://t.co/KAdLAC3yU6
#Ruby#Rails#CleanCode
Master Value Objects in Ruby using the modern Data.define class. Learn about immutability, value equality, and how to eliminate boilerplate code for cleaner, safer domain modeling.
https://t.co/DBlYC3tka1
Should a Ruby class do just one thing?
New article exploring SRP:
→ When to split classes
→ When to keep them together
→ Cohesion vs. responsibilities
Practical examples included 👇
https://t.co/zSHhrtnteU
#Ruby#SOLID
Should a Ruby class do just one thing? Explore the Single Responsibility Principle, cohesion, and when to split classes through practical examples.
https://t.co/KycfOZur18
🔥 The N+1 problem in Rails explained
Your code looks fine. No errors. But 1,000 authors = 1,001 queries.
I break down why `joins` doesn't fix it, how `includes` does, and when to combine them.
From 10,001 queries → 1 query 🚀
https://t.co/PtYPwniSNk
Master the N+1 problem in Active Record. Understand when to use joins, includes, or both to optimize Rails database queries and boost performance.
https://t.co/WYbKkGAvnS
What if you built RSpec from scratch before learning RSpec?
That's the approach in my new Ruby testing guide.
Build your own framework ➜ Understand the principles ➜ Explore the popular tools
https://t.co/BlP1blJIo6
The complete Ruby testing tutorial: understand fundamentals by building a test framework, then explore Minitest, RSpec, and Rack::Test with practical examples.
https://t.co/HWZvmBdQbU
🎩 “Fly me to the code…” 🎶
Building web apps the Sinatra way. Light, elegant, minimal.
In my new tutorial:
✨ Routes & params
✨ ERB + layouts
✨ Forms + PRG
✨ Sessions + flash
✨ File-based CRUD
📖 https://t.co/gpzT7IYU84
#Sinatra#Ruby#WebDev