Re: [Pharo-users] Defensive programming or not

2019-09-23 Thread Richard O'Keefe
This is perhaps the biggest question I've faced working on my own Smalltalk, and it is connected to an annoyance. My answer is that when I am *using* library code, I want my mistakes to be detected at "interface" level. If, for example, I do ((1 to: 5) asOrderedCollection) at: 2.5 put: #fred; you

Re: [Pharo-users] Defensive programming or not

2019-09-23 Thread Sven Van Caekenberghe
Hi Kasper, > On 23 Sep 2019, at 10:18, Kasper Osterbye wrote: > > Cheers all, > > In trying to fix one of the issues in Pharo, I came to wonder about the > prefered style in in dealing with preconditions to methods in Pharo. > > In the method Random>>nextInt: anInteger > • There is a ch

[Pharo-users] Defensive programming or not

2019-09-23 Thread Kasper Osterbye
Cheers all, In trying to fix one of the issues in Pharo, I came to wonder about the prefered style in in dealing with preconditions to methods in Pharo. In the method Random>>nextInt: anInteger - There is a check if anInteger is negative - There is no check that anInteger is anInteger Whe