* <dblack / rubypal.com> (16:48) schrieb:

>> That is true for Array#delete. delete is always destructive, there is no
>> need to flag that.
>
> And push, pop, <<, concat, replace, clear...

Which all have to be modifying. With the exception of concat. (The Unix
cat command isn't modifying.)

>> It should simply be clear from the name[0] if a method is destructive.
>> Often you need the ! for that, in some cases it's obvious without the !.
>
> I guess I take my cue from the Ruby core/standard language, where
> there's no use of !, as far as I know, except to distinguish a
> "dangerous" method from its non-dangerous partner.

That's because of the completeness of the library. Whenever there can be
a non-modifying partner, there is one.

When you just define a modifying method, is not right to name it without
a ! just because you choose not to define a non-modifying version.

What if some other developer wants to add the non-modifying version?
He would have to rename your version.

mfg,                        simon .... l