2 ms·
> Because it’s always about other programmers when the value of sharp knives is contested. I’ve yet to hear a single programmer put up their hand and say “I can
by geofft 10y ago
> Because it’s always about other programmers when the value of sharp knives is contested. I’ve yet to hear a single programmer put up their hand and say “I can’t trust myself with this power, please take it away from me!”. It’s always “I think other programmers would abuse this”. That line of paternalism has never appealed to me.
Well, then, I will put up my hand and say "I can't trust myself with this power." It is why I prefer languages with rich and static type systems and languages with a compilation phase (but it isn't just about type systems or compilation). I often want to trust myself in the present, but I know that trust is often misplaced; I don't trust myself in the past to have written stuff I continue to understand and be able to make changes to, the more that I've used sharp knives.
(Perhaps this is a sample bias, in that people who don't trust themselves with this power are unlikely to use Ruby unless forced to. I will admit that I am not a Ruby programmer and don't see myself ever choosing to start a new project in Ruby, though I'm not opposed to working with an existing project in Ruby.)
I deeply understand the value of monkey-patching. I worked for many years on a product that relied on IAT patching/LD_PRELOAD/DYLD_INSERT_LIBRARIES to intercept all reads and writes. My personal domain is ldpreload.com, and I've written an LD_PRELOAD/DYLD_INSERT_LIBRARIES library for Rust. But using a preload library is being very explicit about opting in to monkey patching. The option of spooky action at a distance is great; having it without any clear opt-in to what spooky action is happening and at what distance is an entirely different matter.
Similarly, I have sharp knives in my kitchen drawer, but they're all in blade guards/sheaths. I know how to use them safely, but when I don't want to use them, I want no risk of them cutting anything.
On another note, dismissing this as "paternalism" is sort of wrong when the objection, as I hear it, is generally "I have tried to maintain codebases from other people, and they should not have been trusted with that power, it turns out."