3 ms·
Yes -- on personal projects I manage to solve this by including comments like: /* IF YOU CHANGE THIS see if you also need to change bar() in otherfile.js
by crazygringo 4y ago
Yes -- on personal projects I manage to solve this by including comments like:
/* IF YOU CHANGE THIS see if you also need to change bar() in otherfile.js
with comment code OSIJDF */
function foo() { ...
I try to put a comment like this in front of every instance, and smash the keyboard for a single random character sequence like `OSIJDF` above that I put in each instance and can do a quick find-all for, in case my original bar() got renamed or moved to a different file, or there's a third function I forgot to add in later but I copy-pasted the comment.
However this is very much a personal practice for cross-referencing that I'm not sure would be received very well as a mandatory practice for code reviews etc.
It does make me very much wish for a best-practices way to essentially provide hyperlinks or cross-references between functions, to indicate that a code should always be interpreted in context of other bits of code that are not in a nearby obvious/contiguous spot. I've never seen anything like that though.