|
|
|
|
|
by alinajaf
4747 days ago
|
|
> But programs in languages which enable, if not encourage, developers to add new methods to the integer '5' can quickly become very difficult to reason about. Can you give me an example of a single ruby developer who thinks this is a good idea when writing new code/a library? |
|
It only takes one, but here are a few thousand to start with: https://github.com/search?l=Ruby&q=%22class+Integer%22&ref=a...
Do your projects use any Gems that are pulling in any of this code?
Could they change to do so in the future?
Most importantly: how much effort is it for you to definitively answer this question?
Our task is that of proving a negative (which as we all know is very difficult). Namely that there is no other code that is relying upon the behavior that you are changing. When there are reasonably well-defined interfaces between components it dramatically reduces the possibility space for implicit dependencies and interactions. So this is a slam-dunk case where tools can make our job much easier.
Without tools, we're basically reduced to "verbal lore" and "honor system". Programmers have to rely upon the shared understanding and behavior of other humans in order to reason about their own code.