Re:Show HN: Doomguy as a Service
by mistercow on Saturday October 05, 2013 @03:27PM
(#6501735)
I don't understand the point of redirecting every number between 0 and 100 when there are only five gifs.
[ Parent
| on HN ]
I'm guessing his intention is that you build an app which scales its metrics to values between 0-100 and then construct a URL directly to the image--that way you don't need to worry about mapping the value to the damage inflicted.
I guess, but then you have to scale to 0-100 (don't forget to round!), which doesn't seem any more convenient.
Re:Show HN: Doomguy as a Service
by ejfinneran on Saturday October 05, 2013 @04:03PM
(#6501867)
That way the browser can download and cache 5 possible images rather than 100 and the user just has to think in terms of 0-100.
>and the user just has to think in terms of 0-100
This is the part I'm not understanding. Why would the user want to think in terms of 0-100? What benefit is there to that? One way or another, you're going to be doing Math.floor(val*N/maxVal). What difference does it make if N=5 or N=100?
The only advantage I can see is that setting N higher means that you can later add more steps without breaking backwards compatibility. But this is one case where that definitely won't happen, since the steps are a historical reference.