5 ms·
While this is technically the same thing as the rampant monkeypatching that happens in ruby, there is a difference in practice, in that polyfills tend to be wri
by hamburglar 5y ago
While this is technically the same thing as the rampant monkeypatching that happens in ruby, there is a difference in practice, in that polyfills tend to be written to emulate well defined interfaces that simply aren’t there, whereas monkeypatching adds random magic like the aforementioned “weeks” method on numbers.
This is personal preference, but I find it utterly absurd to adorn numbers with these time dimensioning methods. Why not volume or length too? Should I be able to say 2.miles? Why would an integer be innately bound to time, as opposed to a unitless mathematical abstraction? Ruby folks like to add these gimmicks that make code “read like English” and I find it very cutesy, for lack of a better word. When I see stuff like this, I’m distracted by pondering what the hell the magic actually means. Can I say 6.from_now? Yes, actually, I can. Does it make any sense that what I call “from_now” on is technically a unitless number? No, not at all. It is a pretense that it’s a dimensioned number for the sake of cuteness.