3 ms·
!-suffixed being dangerous is a rails convention (throws exception). !-suffixed methods are a ruby convention for instance mutation. Calling mutation dangerous
by chucke 2y ago
!-suffixed being dangerous is a rails convention (throws exception). !-suffixed methods are a ruby convention for instance mutation. Calling mutation dangerous isn't a justification for your argument, as there are intrinsic benefits to using those where justified and contained, such as memory savings.
- regularfry 2y agoThat's simply not true. matz has said this explicitly in the past: > The bang (!) does not mean “destructive” nor lack of it mean non destructive either. The bang sign means “the bang version is more dangerous than its non bang counterpart; handle with care”. Since Ruby has a lot of “destructive” methods, if bang signs follow your opinion, every Ruby program would be full of bangs, thus ugly. (from https://www.ruby-forum.com/t/conventions-in-ruby-and-the-principle-of-least-surprise/158706/2 https://www.ruby-forum.com/t/conventions-in-ruby-and-the-pri..., a quote from 2009)