What is the purpose of “!” and “?” at the end of method names?
It’s “just sugarcoating” for readability, but they do have common meanings: Methods ending in ! perform some permanent or potentially dangerous change; for example: Enumerable#sort returns a sorted version of the object while Enumerable#sort! sorts it in place. In Rails, ActiveRecord::Base#save returns false if saving failed, while ActiveRecord::Base#save! raises an exception. Kernel::exit causes a script … Read more