Davy Jones@lemmy.dbzer0.com to Programming@programming.dev · 2 days agoWhich software design principles do you rely on most?message-squaremessage-square28fedilinkarrow-up147file-text
arrow-up147message-squareWhich software design principles do you rely on most?Davy Jones@lemmy.dbzer0.com to Programming@programming.dev · 2 days agomessage-square28fedilinkfile-text
I’m curious which software design principles you find most valuable in real projects. Two concise summaries I’ve found: Clean Code by Robert C. Martin A Philosophy of Software Design by John Ousterhout
minus-squarebradboimler@lemmy.worldlinkfedilinkEnglisharrow-up12·edit-22 days agoI write my code for future maintainers. I optimize for clarity, testability, and readability. I’ve become a huge fan of dependency injection. That does not mean I like DI frameworks (Guice). I tend to do it manually with regular code. When I maintain code and I sit there wondering what it actually does, I write a unit test for it right then and there And so on
minus-squarebufalo1973@piefed.sociallinkfedilinkEnglisharrow-up1·edit-29 hours agoAnd that future maintainer happens to be yourself most of the time.
minus-squaresip@programming.devlinkfedilinkarrow-up3·edit-22 days agoDI without a tool/injector is just composition. just saying
minus-squarenebeker@programming.devlinkfedilinkEnglisharrow-up2·2 days agoA good reminder that composition is a useful concept.
minus-squaresip@programming.devlinkfedilinkarrow-up1·11 hours agoit’s my fav and it’s easy. allows containing details of a lower lever gizmo in a higher level thingamabob and basically free strategy pattern, especially if you use DI… and allows mock/spy testing!
I write my code for future maintainers. I optimize for clarity, testability, and readability.
I’ve become a huge fan of dependency injection. That does not mean I like DI frameworks (Guice). I tend to do it manually with regular code.
When I maintain code and I sit there wondering what it actually does, I write a unit test for it right then and there
And so on
And that future maintainer happens to be yourself most of the time.
DI without a tool/injector is just composition. just saying
A good reminder that composition is a useful concept.
it’s my fav and it’s easy. allows containing details of a lower lever gizmo in a higher level thingamabob and basically free strategy pattern, especially if you use DI… and allows mock/spy testing!