r/AskProgramming • u/Yelebear • Mar 04 '25
Other Why do some people hate "Clean Code"
It just means making readable and consistent coding practices, right?
What's so bad about that
155
Upvotes
r/AskProgramming • u/Yelebear • Mar 04 '25
It just means making readable and consistent coding practices, right?
What's so bad about that
View all comments
Show parent comment
1
u/TimMensch Mar 08 '25
I made my own discoveries about the value of static types when working solo on a project with ~20000 lines of code. I'd say they're even more important on solo projects, since when you're not beholden to anyone, you're more likely to compromise on design to make things work.
Previous similar projects based on static typed languages stayed well organized and clean throughout. The dynamic typed project became increasingly difficult to extend until it was a disaster.
My memory isn't perfect. Refactoring with static types is trivial; keep making changes until it compiles, at which point you're done. Refactoring with dynamic types is risky and slow, typically requiring a ton of debugging. Test coverage needs to be much more detailed since you need to write tests to validate types.
You can start a project more quickly by just throwing crap together and making it work with dynamic types, but by the second week you're already going to see an advantage to having static types.
Static types aren't a bandaid. They are guard rails that can, when used appropriately, accelerate development. When you're on a well designed road with guard rails, the safe speed is faster than when you're on a road without guard rails.
No, you're making up excuses as to why you shouldn't need to learn to use static types. It's pretty obvious.