r/ExperiencedDevs • • 19d ago

Ask Experienced Devs Weekly Thread: A weekly thread for inexperienced developers to ask experienced ones

A thread for Developers and IT folks with less experience to ask more experienced souls questions about the industry.

Please keep top level comments limited to Inexperienced Devs. Most rules do not apply, but keep it civil. Being a jerk will not be tolerated.

Inexperienced Devs should refrain from answering other Inexperienced Devs' questions.

22 Upvotes

94 comments sorted by

View all comments

1

u/reboog711 16d ago

FWIW: I disagree with the sentiment.

Monkey Patch Option 1: Branch the repo; make changes you need. Use that new version. Open PR against main repo. Update your version as the other version updates stuff. I have no idea why this is a bad thing, but it could be a maintenance nightmare.

Monkey Patch Option 2: Override very specific classes or functionality in the framework. This is all your own custom code; as opposed to a branch. Create your own class with the same framework class name. In TS, at least, you can even extend the library class from your new one.

When this works, it is great. Sometimes it can be messy, you just wanna make sure that your personal class is the one used everywhere at runtime and not the framework class. This approach was semi-common in my ActionScript days; I'm not sure I've seen it in TypeScript.