Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OK but if you have large amounts of unused code throughout the codebase, mistakes are more likely to be "missed, blindly trusted, or just misunderstood".


> but if you have large amounts of unused code throughout the codebase

Delete it? Version control is your backup


You have to find it, first. I have a PHP codebase where symfony and doctrine are using strings to connect distant parts of the code. Just trying to find what calls what is hard. I am in the process of replacing as much strings with real calls and adding as much typing as possible, and have thrown away 1/3, but the code base fights back.


I think when the OP says concise they mean using several lines to make some logic clear, rather than a tricky little one liners. (like many of the mistakes in the article)


One example of this I HATE is ruby’s obsession with

return X unless [complex logic]

I sometimes see this stacked inside other complex logic and it’s a nightmare sometimes to figure out the actual control flow.


Which desugars to: if (!complex logic) return X;


If you put OR between two ANDs without a paren I think you have bigger issues than unused code.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: