News for hackers. Stuff that matters.
Re:Notch trying jsFiddle by shocks on Sunday December 02, 2012 @06:21PM (#4863028)

    setInterval(clock, 1000 / 100);
Is there any reason for writing 1000/100 instead of 10?

edit: Thanks guys!

Re:Notch trying jsFiddle by anatoli on Sunday December 02, 2012 @06:27PM (#4863059)
It just makes it clearer that he wants it to run at 100FPS: (1000ms / desired FPS)

The usefulness is more obvious when you want 60FPS, which is not easily represented without rounding.

Re:Notch trying jsFiddle by dag11 on Sunday December 02, 2012 @06:28PM (#4863064)
It was probably for readability, i.e. "100 times per second".

Similarly, people will write (10 * 60 * 60) if the value is seconds and the programmer intends to indicate 10 hours.

Re:Notch trying jsFiddle by estel on Sunday December 02, 2012 @06:27PM (#4863058)
It's a good way to remind you the figure is in ms, and easily manipulate the interval as a fraction of a second.
Re:Notch trying jsFiddle by sisk on Sunday December 02, 2012 @06:39PM (#4863115)
I personal do this for legibility and ease of comprehension. Kinda loses its value when dealing with such nicely rounded numbers but, as an example, 1000ms / 24 is easier or me to comprehend as 24 ticks per second than 41.6666ms.
Re:Notch trying jsFiddle by Riesling on Sunday December 02, 2012 @06:37PM (#4863103)
Probably just to emphasize that clock will be called 100 times per second (which will result in 100 fps).
Re:Notch trying jsFiddle by Rygu on Sunday December 02, 2012 @06:32PM (#4863081)
100 frames per second. He probably changed that during development.