3 ms·
> For reasons I still don’t understand, we teach them that somehow, attr_reader, extend, private, has_many, and so many others have special statuses; they’re n
by joelbluminator 5y ago
> For reasons I still don’t understand, we teach them that somehow, attr_reader, extend, private, has_many, and so many others have special statuses; they’re not just regular methods. Yet they are. We’re actively hurting their learning experience, for legacy reasons.
Hmm I never taught anyone that has_many isn't a regular method call, I do hear some people calling them macros but thats fine; It might be a bit unusual for Ruby to be able to call class methods outside any method (can java/python/javascript do this?), so giving it a special name works I think (as long as we explain that they ARE just class method calls).
The second thing I'm wondering about is whether the team was using Rubocop, some of these examples are just bad Ruby that I don't think Rubocop would allow. Since almost no one does Ruby without Rubocop it mitigates these problems by a lot.