From: Panagiotis Atmatzidis Date: 2012-09-05T05:24:25+09:00 Subject: Re: best coding for limiting a value Hello, Since all 3 methods do the same, it's a matter of taste. In the book the "Art of readable code" by Dustin Boswell &Trevor Foucher the reader will certainly choose the (B) as it's easier to read immediately by a 3rd party. If you have many questions like this one, you should really read a book like this one. On 4 Σεπ 2012, at 23:13 , Regis d'Aubarede wrote: > A) result=value max ? max : value) > > B) > result=value > if value < min then result= min end > if value > max then result= max end > > C) > [min,max,value].sort[1] > > > (nota: i am not a student, and neither a teacher :) ps. what are you? :-) > -- > Posted via http://www.ruby-forum.com/. > Cheers [1] http://www.goodreads.com/book/show/8677004-the-art-of-readable-code Panagiotis Atmatzidis ----------------------------- Pharmacy Student at VFU email4lists: ml@convalesco.org More info: http://about.me/atmosx The wise man said: "Never argue with an idiot, he brings you down to his level and beat you with experience."