4 ms·
When i learned Ruby, it wasn't really a WTF for me - I just learned that '!' methods are destructive, while non-'!' aren't. However, the destructiveness semant
by pizza234 4y ago
When i learned Ruby, it wasn't really a WTF for me - I just learned that '!' methods are destructive, while non-'!' aren't.
However, the destructiveness semantic has been significantly overloaded over the time, so each Ruby (Rails) project probably interprets them in a different way, and it ends up having arbitrary semantics.
I'm used to it, but I personally think that for the reason above, it's not a good syntax/semantic to have in a language.
- michaelteter 4y ago> arbitrary semantics I wouldn't go so far to say it is arbitrary (unless someone uses it wrongly :) ). As far as I know, a bang name only exists if a non-bang name exists as well. And the one with ! indicates an unexpected or comparatively dangerous outcome, such as a mutation, raising an exception, bypassing some normal check, etc.