Refactoring, Part Two: In Defense of Magic
19-Aug-2021 1199
In my last post, I refactored the status field for cards in my project tracker to a more object-oriented representation that used value objects and classes to replace conditionals throughout the code.I was apprehensive about posting it, because it seems like that kind of OO code is out of fashion. What feedback I got, though, was positive. So I’m going to go a little farther into metaprogramming with this example. The code here works for this project, but eventually goes beyond what I’d be likely to recommend for most projects.
Refactoring, Part Two: In Defense of Magic #ruby #rubydeveloper #rubyonrails #Refactoring, #Defense #Magic #refactoring, https://rubyonrails.ba/link/refactoring-part-two-in-defense-of-magic