5 ms·
Only in JS do people seem okay with constantly mucking with built-ins.
by zamadatix 8y ago
Only in JS do people seem okay with constantly mucking with built-ins.
- mikepurvis 8y agoRuby has a culture around it too: https://www.justinweiss.com/articles/3-ways-to-monkey-patch-without-making-a-mess/ https://www.justinweiss.com/articles/3-ways-to-monkey-patch-... And you can get some of the patching effect in any language with uniform function/method calls, though typically with a little more scoping and thus less ability to inflict unexpected side effects: https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax
- badosu 8y agoFor pretty much the past decade (specially the last few years) I feel the culture has shifted to consider core monkey patches as a pretty bad practice.
- hombre_fatal 8y agoSure, but it's also a bad practice in Javascript.
- joliv 8y agoAnd Swift! https://docs.swift.org/swift-book/LanguageGuide/Extensions.html https://docs.swift.org/swift-book/LanguageGuide/Extensions.h...
- weberc2 8y agoIf people could muck with builtins in Python, they would. And worse, they'd do it with inheritance and metaclasses. I say this as a Python dev.
- tyingq 8y agoPython3 mucked with built in types...
- recursive 8y agoI don't think monkey patching is really common in any version of python. I've not seen it done anywhere.
- tyingq 8y agoTalking about the intro of bytes, bytearrays and the not quite the same types that were backported to 2.x
- kevin_thibedeau 8y agoSetuptools monkeypatches distutils. Pip always uses setuptools so pretty much everything installed via Pypi is the fruit of a monkeypatch.