TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Patterns in Python

63 点作者 limist大约 15 年前

5 条评论

tptacek大约 15 年前
If you're a Python (or Ruby) dev, and this stuff is interesting to you, that's a symptom of a problem. The problem is that you haven't read this:<p><a href="http://norvig.com/design-patterns/" rel="nofollow">http://norvig.com/design-patterns/</a>
评论 #1328217 未加载
评论 #1328050 未加载
评论 #1328400 未加载
cubes大约 15 年前
I'm really glad the article includes a warning against trying not to overuse design patterns. I sometimes wonder if teaching design patterns causes people to rely on pattern matching as a crutch, and hampers the development of creative thinking skills required to solve new engineering problems.
评论 #1328340 未加载
torial大约 15 年前
At the very bottom:<p>View document source. Generated on: 2003-02-28 11:59 UTC.<p>I was thinking I'd seen this before -- a long time ago. How much still applies?
评论 #1327706 未加载
评论 #1328354 未加载
dkarl大约 15 年前
These are patterns from the GoF book. Learning to use these patterns in Python is like learning Esperanto so you can pray. Python doesn't need these patterns any more than God needs you to speak Esperanto.
评论 #1328386 未加载
SlyShy大约 15 年前
Interesting. I sort of assumed Python had singletons natively, because I'm so used to using them in Ruby.<p>This guy doesn't do it here, but you can make singletons relatively painless in Python by using decorators.
评论 #1327718 未加载
评论 #1327936 未加载