Re:Ask HN: Where do I find good code to read?
by shortrounddev2 on Thursday August 24, 2023 @12:39PM
(#37251059)
"maintainable" code is disposable. Modern web stacks are built on the idea that you can delete a file and re-implement its interface with a different service behind it later on. Instead of writing code which will be easy to modify, write a good interface which solves your problems in a way that's easy to reason about, and feel free to write garbage implementations that will get "refactored" (thrown away) every year or so
[ Parent
| on HN ]
Re:Ask HN: Where do I find good code to read?
by boredtofears on Thursday August 24, 2023 @04:11PM
(#37253938)
You can write good code behind well defined interfaces, too. There's no reason you have to pick one or the other. Bad implementations are still bad.
Re:Ask HN: Where do I find good code to read?
by vendiddy on Friday August 25, 2023 @08:41AM
(#37261053)
I usually find it faster to define a good interface, hack together and implementation, then rewrite it.
A good interface limits the blast radius of my refactor.
Re:Ask HN: Where do I find good code to read?
by johnnyanmac on Friday August 25, 2023 @12:54AM
(#37258232)
>Modern web stacks are built on the idea that you can delete a file and re-implement its interface with a different service behind it later on.
and that paradigm is exactly why my domain is the start opposite of front end web development. Code I write may be used by thousands of other engineers over decades. I can't take into account every edge case, but I do try to write with the assumption that one day some archeologists will uncover that code as some Rosetta Stone. Of course, modern demands never let me reach that ideal, but it teaches care and good documentation.