Davy Jones@lemmy.dbzer0.com to Programming@programming.dev · 5 days agoWhich software design principles do you rely on most?message-squaremessage-square33fedilinkarrow-up150arrow-down10file-text
arrow-up150arrow-down1message-squareWhich software design principles do you rely on most?Davy Jones@lemmy.dbzer0.com to Programming@programming.dev · 5 days agomessage-square33fedilinkfile-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-25 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-23 days agoAnd that future maintainer happens to be yourself most of the time.
minus-squaresip@programming.devlinkfedilinkarrow-up3·edit-25 days agoDI without a tool/injector is just composition. just saying
minus-squarenebeker@programming.devlinkfedilinkEnglisharrow-up2·5 days agoA good reminder that composition is a useful concept.
minus-squaresip@programming.devlinkfedilinkarrow-up1·3 days 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!