Monkey-patching Vs. S.O.L.I.D. principles?

前端 未结 8 1163
别跟我提以往
别跟我提以往 2020-12-24 03:47

I\'m slowly moving from PHP5 to Python on some personal projects, and I\'m currently loving the experience. Before choosing to go down the Python route I looked at Ruby. Wha

8条回答
  •  我在风中等你
    2020-12-24 04:14

    In my view, monkeypatching is useful to have but something that can be abused. People tend to discover it and feel like it should be used in every situation, where perhaps a mixin or other construct may be more appropriate.

    I don't think it's something that you should outlaw, it's just something that the Ruby guys like to use. You can do similar things with Python but the community has taken the stance that things should be simpler and more obvious.

提交回复
热议问题