65

To all the design pattern nazis..

Don't you ever tell me that something is impossible because it violates some design pattern! Those design principles are there to make your life easier, not something you have to obey by law.
Don't get me wrong, you should where ever possible respect those best practices, because it keeps your software maintainable.
But your software should foremost solve real world problems and real world problems can be far more complex than any design pattern could address. So there are cases where you can consciously decide to disregard a best practice in order to provide value to the world.

Thanks for reading if you got this far.

Comments
  • 12
    Agreed, although I tell people in my team to add a comment above the nasty code, explaining why you "broke the rules", why the ugly/dangerous stuff was necessary, and be sure to isolate it as much as possible so you can write good unit tests for it.
  • 5
    @bittersweet couldn't agree more! E.g. every time I need to use !important in css because of nasty inline styles of a library, I feel the urge to explain in a comment why it has to be like that.
  • 3
    @bitfucker I am so with you with this! 💯%
  • 2
    I need to remind myself of this more often cause I can be a design purist
  • 2
    @brettmoan I just feel like software should not just be written to be nicely designed, but to solve a real problem and be useful as a first priority.
  • 1
    All design patterns have their respectful pros and cons, and you should always weigh them when desiding to use one. Sticking to a pattern just for the sake of the pattern is dumb. Once you conclude a pattern is well suited, breaking it should have a massive reason.
Add Comment