The following message is a courtesy copy of an article that has been posted to comp.lang.misc as well. "Conrad Schneiker" <schneiker / jump.net> writes: > From: Dave Thomas <Dave / thomases.com> > > > "Conrad Schneiker" <schneiker / jump.net> writes: > > > > > Is there any reason that all mutator methods should not be denoted by > having > > > a '!'? > > > > arr[1]=! 1 > > > > is a little ugly! > > Good point. > > But what I actually had in mind was names of mutator methods with predefined > English names or (more or less) alphanumeric user-defined names. I know - I was being a little silly. The real problem I see with the change is that it may lead to confusion over existing methods. Right now, if there's a 'chop' and a 'chop!', you know that the chop! variant is a mutator. However, if we rename all mutators to end in !, then for a while we'll have (say) Array.filter and Array.filter!. Based on the chop example, people might reasonably expect 'filter' to return a copy, and 'filter!' to be a mutator. They'd be surprised the first time 'filter' altered an array they thought was safe. I think if the convention had been adopted from the start, it would have been good. I think for new classes, it's a good convention to adopt. For the existing stuff, I'm not so sure the change doesn't bring more confusion than it saves. But... I'm happy to be convinced the other way. Regards Dave