From: Jonan Scheffler Date: 2012-08-16T22:38:25+09:00 Subject: Re: case vs if-else --20cf302efd124aa2a804c7622847 Content-Type: text/plain; charset=ISO-8859-1 Could have been stated a little more politely but he's right. If you find you're looking to optimize that intensely you probably don't want an interpreted language. I generally try to avoid case statements simply because it makes it easy for me or another programmer to come along in the future and add another case, increasing the branching in a bit of code that should probably have only done one thing in the first place. Best of luck On Thu, Aug 16, 2012 at 9:25 AM, Jan E. wrote: > Dude, does it really matter if one variant is some microseconds faster > than the other? Ruby is so slow by itself that this kind of > nanobenchmarking is just insane. > > If you want speed, use C (or even assembler). Ruby is the completely > wrong language for this. > > -- > Posted via http://www.ruby-forum.com/. > > -- Jonan Scheffler @1337807 jonanscheffler@gmail.com (503) 985-6626 --20cf302efd124aa2a804c7622847 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Could have been stated a little more politely but he's right. If you fi= nd you're looking to optimize that intensely you probably don't wan= t an interpreted language.

I generally try to avoid case= statements simply because it makes it easy for me or another programmer to= come along in the future and add another case, increasing the branching in= a bit of code that should probably have only done one thing in the first p= lace.

Best of luck

O= n Thu, Aug 16, 2012 at 9:25 AM, Jan E. <lists@ruby-forum.com> wrote:
Dude, does it really matter if one variant i= s some microseconds faster
than the other? Ruby is so slow by itself that this kind of
nanobenchmarking is just insane.

If you want speed, use C (or even assembler). Ruby is the completely
wrong language for this.



--
=
Jonan Scheffler
@1337807
jonanscheffler@gmail.com
(503) 985-6626

--20cf302efd124aa2a804c7622847--