←back to thread

466 points 0x63_Problems | 2 comments | | HN request time: 0.429s | source
Show context
vander_elst ◴[] No.42138032[source]
"Companies with relatively young, high-quality codebases"

I thought that at the beginning the code might be a bit messy because there is the need to iterate fast and quality comes with time, what's the experience of the crowd on this?

replies(9): >>42138075 #>>42138094 #>>42138186 #>>42138274 #>>42138314 #>>42138387 #>>42138735 #>>42139575 #>>42144797 #
1. AnotherGoodName ◴[] No.42138274[source]
I find messiness often comes from capturing every possible edge case that a young codebase probably doesn’t do tbh.

A user deleted their account and there’s now a request to register that account with that username? We didn’t think of that (concerns from ux on imposter and abuse to be handled). Better code in a catch and handle this. Do this 100x times and you code has 100x custom branching logic that potentially interacts n^2 ways since each exceptional event could probably occur in conjunction with other exceptional events.

It’s why I caution strongly against rewrites. It’s easy to look at code and say it’s too complex for what it does but is the complexity actually needless? Can you think of a way to refactor the complexity out? If so do that refactor if not a rewrite won't solve it.

replies(1): >>42141613 #
2. unregistereddev ◴[] No.42141613[source]
I agree. New codebases are clean because they don't have all the warts of accumulated edge cases.

If the new codebase is messy because the team is moving fast as parent describes, that means the dev team is doing sloppy work in order to move fast. That type of speed is very short lived, because it's a lot harder to add 100 bugfixes to an already-messy codebase.