Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a weighed average with, presumably, hand-chosen coefficients to make a nice visual effect. I fail to see how these numbers are "magic." How would you produce this effect without numbers?


> How would you produce this effect without numbers?

That's not what 'magic numbers' means.

The idea is that you factor out the number into named variables so they don't appear unnamed in the body of expressions.


Ok, sure. Even so, this is about the least compelling example of "magic number" that I've seen. They're used once, the intent is clear, and you don't have to go hunting for the definition.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: