From: Peter Hickman Date: 2012-09-05T19:28:44+09:00 Subject: Re: best coding for limiting a value Well they all work and return the same result so from that point of view they are as good as each other but.... 1) You can work out what it is doing, but you have to stop and think a bit which breaks the flow when reading code 2) Verbose but clear, anyone should be able to read this without breaking a sweat 3) Huh? Well it works but to be honest I had to write some tests to make sure that it would work So in conclusion 1 and 2 just need a good method name and you are good to go. I would not want to see 3 inline, its neat but not explicit. It is almost magical in its behaviour. But perhaps that is more a reflection of my level of skill but I would not want to inherit code that contained stuff like this. Performance wise? Probably nothing significant. 1 feels like it would be the fastest but not by any margin worth worrying about.