3 ms·
I don't understand the point of redirecting every number between 0 and 100 when there are only five gifs.
by mistercow 13y ago
I don't understand the point of redirecting every number between 0 and 100 when there are only five gifs.
- tdicola 13y agoI'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.
- mistercow 13y agoI guess, but then you have to scale to 0-100 (don't forget to round!), which doesn't seem any more convenient.
- ejfinneran 13y agoThat 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.
- mistercow 13y ago>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.