Nicolas Cellier wrote:
The reason why I don't like the explicit "copy", is because this is the default behaviour. In place mutation is an (evil) exception. I'm personnally fine with current conventions: - sort, shuffle, reverse, replace: are imperative, thus you are telling collection, sort yourself ! - sorted clearly sounds as a sorted copy for me. If ever a change was to be made, I would much prefer this to happen on opposite naming, sort -> inPlaceSort, or sortYourself :) It's like telling the programmer, hey - a stateful mutation is really what you want, is it? Conventions should encourage good programming practice. Although it makes perfect sense on hearing it, I was explicitly not aware of the convention between 'sort' and 'sorted'. For me, the small difference in letters used between the two doesn't provide a wide enough distinction. Also, regarding not mutating state, I guess I knew that in the back of my head, but it has not generally been an explicit concern of mine while programming. Convention should encourage good programming. So I like the suggestion of inPlaceSort & sortYourself. As well as being more intention revealing, the less desirable methods are made less attractive by using a longer name. Perhaps another naming convention could be mutatedSort, or mutSort as a hint that the programmer should consider using these in conjunction with mutexes, or at own risk. cheers -ben 2013/9/23 Stéphane Ducasse <[email protected]>+1 Now I understand the point of max with the name sort/sorted because this is not explicit to me too :) I laways have to think. On Sep 23, 2013, at 6:28 PM, Nicolas Cellier < [email protected]> wrote: 100% agree. Do it right > do it fast. We must not turn usage of the library into something fragile for the sake of speed. We already make the code itself fragile more often than not in term of complexity (harder to understand/test/change). Especially, introduction of shared mutable states (global, class vars, singleton or any other form) should ring an alarm in reviewers head (This is some very old Squeak code in this case, so Squeakers are to blame, but we're all in same bath). 2013/9/23 Henrik Johansen <[email protected]>On Sep 23, 2013, at 3:33 , Max Leske <[email protected]> wrote: |
- Re: [Pharo-dev] 11635: Race condition in SequenceableCol... Nicolas Cellier
- Re: [Pharo-dev] 11635: Race condition in Sequenceab... Frank Shearar
- Re: [Pharo-dev] 11635: Race condition in Sequen... Max Leske
- Re: [Pharo-dev] 11635: Race condition in Se... Frank Shearar
- Re: [Pharo-dev] 11635: Race condition in Sequenceab... Max Leske
- Re: [Pharo-dev] 11635: Race condition in Sequen... Henrik Johansen
- Re: [Pharo-dev] 11635: Race condition in Se... Nicolas Cellier
- Re: [Pharo-dev] 11635: Race condition i... Stéphane Ducasse
- Re: [Pharo-dev] 11635: Race condit... Nicolas Cellier
- Re: [Pharo-dev] 11635: Race co... btc
- Re: [Pharo-dev] 11635: Race co... Max Leske
- Re: [Pharo-dev] 11635: Race co... Henrik Johansen
- Re: [Pharo-dev] 11635: Race co... Max Leske
- Re: [Pharo-dev] 11635: Race co... Max Leske
- Re: [Pharo-dev] 11635: Race condition i... btc
- Re: [Pharo-dev] 11635: Race condition in Sequenceab... Stéphane Ducasse
