From: Simon Krahnke Date: 2007-08-17T09:35:00+09:00 Subject: Re: ! semantics * (04:19) schrieb: >> Most methods flagged with a ! are dangerous because they modify their >> receiver. > > Many of them are, but there's no cause-and-effect between modifying > and !. You are hitting a strawman. >> Array#pop is modifying but not dangerous, because everyone expects it to >> be modifying. > > If the name doesn't connote destructiveness, then you should change > the name. Obviously the many examples of pairs with and without ! don't follow that guideline. >>>> What if some other developer wants to add the non-modifying version? >>>> He would have to rename your version. >>> >>> I think that's a solution in search of a problem. >> >> No, that's a problem. > > Not really. If I have a "pop" method, We have an "apply" method. > In other words, m/m! is not the only possible ratio between methods. Who said it was? > There's also m/n, which can be just as close as m/m!. pop/last is an > example; so is concat/+ (also for arrays). And there is m/m!. If you write m!, name it m!, not m. > I don't think I can quite follow all the convolutions we're getting > into :-) I've posted something about the ! on my blog, if anyone's > interested: > > http://dablog.rubypal.com/2007/8/15/bang-methods-or-danger-will-rubyist You write "create the traditional pair of methods", that's right. But now I'm too lazy to write the simple non-modifying wrapper. That's not a good reason to omit the !. BTW: Is there any reason you don't mention your whole name in your posts? mfg, simon .... someone wrote a blog because of my posts