Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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.
-
@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.
-
@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.
-
sljux7217yAll 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.
Related Rants
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.
undefined
design patterns
software architecture