4 ms·
> Have you found ways to make the extended engineering of Rails easier to understand for those used to limiting themselves to the out-of-box conventions? Rails
by joshmn 3y ago
> Have you found ways to make the extended engineering of Rails easier to understand for those used to limiting themselves to the out-of-box conventions?
Rails comes with a lot of the patterns I implement out of the box. Forms are just ActiveModel objects. Services are just POROs, as are queries. A decorator pattern can be done in 25 lines of code (https://gist.github.com/joshmn/87f14dc7d6b45a72bd4e3f4fb8d82259); https://gist.github.com/joshmn/87f14dc7d6b45a72bd4e3f4fb8d82... Commands are a bit more difficult but anything that can respond to context with flow control handling is easy to grep.
There's a fine line between implementing patterns and implementing patterns that behave as Rails expects them to. Thankfully, as mentioned in Eileen's talk, Rails makes it really easy to do this. While the underlying logic may not be documented on the Rails Getting Started guides, peaking under the hood isn't as intimidating as one would think.
- 1123581321 3y agoI agree; I just wondered if you’d found good ways to help developers understand that since it sounds like you’ve been able to augment multiple code bases that way. I was thinking a good first place to start, etc. If that’s your answer, though, to just show them that it’s all already there to help them flip their perspective on Rails, I like the approach. Certainly easy to communicate once you’ve done it a few times, as Eileen shows.
- ornornor 3y agoYour link got mangled, here is the working one: https://gist.github.com/joshmn/87f14dc7d6b45a72bd4e3f4fb8d82259 https://gist.github.com/joshmn/87f14dc7d6b45a72bd4e3f4fb8d82...