On Monday, September 28, 2015 at 12:34:01 PM UTC-4, Tom Breloff wrote: > > A question regarding the use of `!` came up a few days ago ( > https://github.com/tbreloff/Plots.jl/issues/30#issuecomment-142995667), > and I wanted to quickly poll the users to get opinions. > > When a module maintains some sort of global state, and a method mutates > that global state, is it appropriate to add `!` to the end of the method > name? > > The example referenced asks why I named the method `immerse!()` instead of > `immerse()`, even though it doesn't have any arguments to mutate (it > changes the default plotting backend, which is part of the module state). > Which method name should it be? (and is it better or worse to provide both > options which would do the same thing?) >
See the discussion in https://github.com/JuliaLang/julia/issues/9262 ... and in particular the discussion about rand(), which modifies global state, but that is an implementation detail rather than a part of the definition of the function.