Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why isn't it considered a syntax error for dead code to exist?
1 point by staticfish on Feb 25, 2014 | hide | past | favorite | 1 comment
Could somebody school me on this, because from my limited understand it would seem like this simple step would have avoided the latest TSL bug (as well as potentially millions of other uncaught issues).



Dead code certainly could be removed, why it's not is a matter of speculation. It's not trivial to detect unused code, but it IS generally done by compilers during optimizations or semantic analysis (http://en.wikipedia.org/wiki/Control_flow_graph). For example, as part of it's optimizations, a compiler my remove unused code.

I'd guess there simply hasn't been a large enough issue to warrant it. There maybe strict/secure academic languages that do what you suggest, I'm not familiar with any though.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: