Stop Writing Classes
推荐理由
Jack Diederich has a great video called Stop Writing Classes: It's about Python, but the observation can apply to several languages.
强烈推荐michelpp · 原文
说明
这是2012年由Next Day Video发布的一部演讲,主题归在Python, Ruby & scripting languages。它讲的是python class overuse这一支里的具体问题,而不是把整个领域扫一遍。适合已经能看懂基本术语、想继续往下走的人。内容上可以概括成: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 returns to it repeatedly as the canonical argument for simplicity and against premature abstraction, and several commenters say it changed how they write code.讲法不绑某一条新闻,过几年仍然可以当材料看。从2012年到2025年,有8位不同的读者在8个不同月份把它推荐出来,其中明确叫别人去看的有4次。适合一次性看完。讲者把一个判断讲透,演示是在给这个判断配例子。如果已经会了基本定义,就把注意力放在它怎么把python class overuse变成能跟着复述的例子。
视频信息
- 频道
- Next Day Video
- 时长
- 27 分 29 秒
- 发布年份
- 2012
同主题更多
- Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
- The spelled-out intro to neural networks and backpropagation: building micrograd
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework
- RailsConf 2014 - All the Little Things by Sandi Metz
- What the heck is the event loop anyway? | Philip Roberts | JSConf EU
- How To Design A Good API and Why it Matters