Hacker News new | ask | show | jobs
by stock_toaster 2531 days ago
> 4) design patterns (learn as many as you can)

Sure, learn them, but make sure you don't apply them blindly. Let the problem/solution lead you to familiar designs, not the other way around. I have seen some truly hideous code done in the name of cargo-culting "design patterns".

1 comments

This is why I actually prefer it if people don't learn them. Where people apply them directly I've seen them misused more often than not and where they were used correctly, more often that not they emerged naturally without anybody ever really thinking "hey, we should use [design pattern] here".

Another bonus of that is that the user wouldn't be tempted to, for example, use the word "factory" in method/class names, which bugs the hell out of me.

I think I've been asked to implement singleton in python in at least three interviews and when I pointed out that a module was a natural singleton and that you didn't really need to "implement" it per se, I got blank stares each time. Sometimes no knowledge is better than learning by the book.