From: Vincent Fourmond Date: 2006-12-30T08:35:00+09:00 Subject: Re: Methods validating their arguments: good or bad? Michael Judge wrote: > What do you think? Do you usually validate your arguments? I usually don't, first because I find it makes the code less readable, and second because of the performance loss. What I would like, however, is something Eifel-like: def method(a) entry_check a.is_a(String) begin # now do something with code exit_check # a test on exit end And the possibility to simply turn it off, that is, completely skip over the entry_check and exit_check blocks. What do you think ? I think that it would be a marvellous addition to Ruby. Of course, that doesn't stop you from writing Test::Units, that would be somehow orthogonal. Cheers, Vince -- Vincent Fourmond, PhD student http://vincent.fourmond.neuf.fr/