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

前端 未结 8 1162
别跟我提以往
别跟我提以往 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 03:52

    You may find enlightening this discussion about Ruby's open classes and the Open-Closed Principle.

    Even though I like Ruby, I feel monkey-patching is a tool of last resort to get things done. All things being equal, I prefer using traditional OO techniques with a sprinkle of functional programming goodness.

提交回复
热议问题