Re: case vs if-else

2012-08-19 Thread Robert Klemme
On Mon, Aug 20, 2012 at 6:57 AM, Charles Hixson wrote: > The point was that because it's hard to tell what is fast and what is slow, > bad decisions are often made. The situation is not that bad. For example, we know that - from a certain number of entries on - it is much faster to use hash loo

Re: case vs if-else

2012-08-19 Thread Robert Klemme
On Sun, Aug 19, 2012 at 8:53 AM, Charles Hixson wrote: > FWIW, I would prefer to be using a faster language, but I also prefer a > language that's rapid to develop in. And "premature optimization" is a > problem that is endemic to programmers that are concerned about execution > speed. +2 > Qui

Re: case vs if-else

2012-08-16 Thread Robert Klemme
On Thu, Aug 16, 2012 at 4:46 PM, Jan E. wrote: > It looks like you're made for each other. :-D Hey, don't uncover our little secret! Darn... robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- You received this message because you are subscrib

Re: case vs if-else

2012-08-16 Thread Robert Klemme
On Thu, Aug 16, 2012 at 4:23 PM, ajay paswan wrote: > Robert Klemme wrote in post #1072532: >> On Thu, Aug 16, 2012 at 1:43 PM, ajay paswan >> wrote: >>> Which one is faster? >> >> Measure it. There is Benchmark. >> > means? what measure? and who'll measure? You want to know which one is faster

Re: case vs if-else

2012-08-16 Thread Robert Klemme
On Thu, Aug 16, 2012 at 1:43 PM, ajay paswan wrote: > Which one is faster? Measure it. There is Benchmark. > for example: > > if grade=="A" > puts("you are smart") > elsif grade=="F" > puts("you are dumb") > end > ###Vs > case grade > when "A" > puts("you are smart