Skip to content

Comment on Show HN: zodiac, a new approach to monkey patching in pythonparent

Comments

While true, this can hardly be considered good engineering. The more complexity in your system, the more likely it is to break. The question is: do you want to take the productivity hit today and fix the socket libraries, or do you want to fix it at some time in the future when you finally realize your code/test/release cycle is twice as slow as your competitors'?

(I've worked on a lot of code that took the second trade-off. The result is almost always a full rewrite. Maintain your codebase or it goes out of control really fast.)

I agree that before monkeypatching, a team should weigh their options. But for many projects, "fixing the socket libraries" could be a lot of work, or not an option at all.

In the example I gave, you'd have to rewrite whatever database drivers you're using, or at least hack them to work in a non-blocking fashion. That could have just as much development cost as monkeypatching.

zodiac is an attempt to address the problems that make monkeypatching such a risky, unpredictable option, by making patches smaller and therefore using more system code. Hopefully, for situations where monkeypatching is necessary, I can make it cleaner and more maintainable.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.