3 ms·
Whenever you have to modify code elsewhere because of a side effect in the current function/file - it should be cross-referenced commented (in both places) beca
by bombcar 4y ago
Whenever you have to modify code elsewhere because of a side effect in the current function/file - it should be cross-referenced commented (in both places) because of things like this.
Just because Chesterton’s Fence is a thing doesn’t mean you have to build new ones without signs on them.
- eyelidlessness 4y agoI agree completely, unfortunately some APIs (DOM events being a good example) make this unknowable or at least impractical on a timeline one or more commits forward. At least as far as I’m aware, there are no static analysis tools which can find “events which might reference this”. Which isn’t to say your point is hopeless, just that a better strategy is to comment regardless of known cross cutting concerns and get ready to hope.
- derefr 4y agoNice to say, but the other side in this case would likely be the inside of a third-party library. If it was in-repo code, it could have just been fixed to not require a stopPropagation workaround!