Stop Writing Classes
Next Day Video · 8 则 HN 推荐
视频问答
可以让 AI 解释当前片段,或总结整部视频。如果回答附有时间戳,点击即可跳到对应片段。
试着问:这里讲的是什么意思?
需要用 Google 登录。确认前可查看最多会扣除多少积分。
Jack Diederich's PyCon 2012 talk argues that classes are overused in Python and walks through real code, refactoring away unnecessary classes, exceptions and modules. It popularized the heuristic that a class with two methods, one being __init__, should be a function.
HN 推荐的原因: HN returns to it repeatedly as the canonical argument for simplicity and against premature abstraction, and several commenters say it changed how they write code.
“Jack Diederich has a great video called Stop Writing Classes: It's about Python, but the observation can apply to several languages.” 阅读 HN 讨论 ↗