A method pair consists of similarly named Ruby methods whose bang and nonbang forms perform substantially the same operation but differ in side effects, return value, or another behavior. The exclamation point communicates a contrast; it has no useful meaning in isolation. section 7.3.2
Use bang notation when:
- A same-named method without ! already exists. section 7.3.2
- Both methods do substantially the same thing. section 7.3.2
- The bang form changes side effects, return value, or another behavior. section 7.3.2
Naming a save operation
Name a file-writing method save when it backs up the original file, and reserve save! for a paired variant that writes without making that backup. Do not add ! merely because writing a file feels dangerous. section 7.3.2
