Re:Linear code is more readable
by osigurdson on Friday September 15, 2023 @01:57AM
(#37519034)
I guess all we know is there were 2K lines of code and the commenter thinks that was the right way to do it. It would be necessary to see the code to appropriately critique it.
[ Parent
| on HN ]
Not just the commenter, but his team as well. It passed code review with flying colors, apparently. The moral of the story is that there always exceptions and developers should not be ideologically committed to one approach above all else.
we know more than that: You could argue that every one of those 9 scopes could be a separate function, but then devs would be tempted to reuse them. Yet, each step had subtle assumptions about what happened before.
what we don't know is if it would have been possible to abstract those assumptions away so that functions could have been defined without them.
Re:Linear code is more readable
by osigurdson on Friday September 15, 2023 @10:08AM
(#37523173)
Even the contrived example in the post can be factored differently (and better imo). How do we know those 9 scopes are appropriate?
Re:Linear code is more readable
by PH95VuimJjqBqy on Saturday September 16, 2023 @01:52PM
(#37536981)
We do know that if we trust the poster, they said very clearly it could have been done but they didn't consider the value to outweigh the downsides.