From: Panagiotis Atmatzidis Date: 2012-09-05T05:30:22+09:00 Subject: Re: best coding for limiting a value Hello, On 4 Σεπ 2012, at 23:27 , Ryan Davis wrote: > > On Sep 4, 2012, at 13:24 , Panagiotis Atmatzidis wrote: > >> 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. > > I disagree. I have to look at the code in B and reason about it. With C, I don't. It becomes obvious what it wants. In ruby, I generally find the shortest solution (with the least amount of syntax and normal whitespace--not golfing) is the clearest and therefore the best. Well to tell you the truth I didn't pay too much attention, but yes you're right. The third solutions is the most easily readable, although I never used it it was absolutely clear what it does. I was arguing about the principle mostly :-) regards 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."