TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Patterns in Python

63 pointsby limistabout 15 years ago

5 comments

tptacekabout 15 years ago
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 未加载
cubesabout 15 years ago
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 未加载
torialabout 15 years ago
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 未加载
dkarlabout 15 years ago
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 未加载
SlyShyabout 15 years ago
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 未加载