Latest Posts
Theory tells us to build applications out of small, interchangeable objects but reality often supplies the exact opposite. Many apps contain huge classes of long methods and hair-raising conditionals; they’re hard to understand, difficult to reuse and costly to change.
Object-oriented languages have opinions about how best to arrange code. These opinions lead OO to naturally offer certain affordances. Just as round doorknobs expect to be grasped and rotated, OO expects messages, polymorphism, loose-coupling, and factories. The key to creating intuitive and maintainable OO applications is to understand and embrace these built-in affordances.
Often we know that our code needs refactoring, but we have no idea where to start. Maybe we studied some common code smells and learned about the things that we should be avoiding, but memorizing the rules doesn’t automatically lead to fixing all problems.
In this Rails tutorial, we’ll add reactive user interface elements to our project management app with Stimulus Reflex. Stimulus Reflex makes use of real-time, web socket communication in Rails over Action Cable and Cable Ready to make it extremely easy to add reactivity with just a few simple lines of code.
Let’s roll up our sleeves and clean up some smelly code. In this session, we’ll dig in to Primitive Obsession - what happens when our domain logic is all wrapped up in primitive data types? And most importantly, how do we untangle it?