TBH, regarding the "final straw" - function calls without parentheses are not the reason your team is writing tests that don't work right. Fixing that is harder than issuing blanket edicts "THOU SHALT NOT USE THIS SYNTAX", but otherwise you'll just get crappy tests for a _different_ reason in the future.
> 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.
3 comments
[ 3.8 ms ] story [ 20.4 ms ] threadHmm 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.