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

"in any project that's meant to grow and last"

I specified what I am talking about. Weekend projects are not even a contention point. People code them in Brainfuck and we all have a laugh about it. It's the stuff that end up at the job that frustrate us where you end up assigned to a 100k (or even just 10k) lines of javascript inferno hell. Because some dev thought he can develop "faster" in Javascript.



Adequate testing goes a long way in dealing with that.

If you don't have tests you're screwed either way.


This is wrong; tests and type systems have different purposes. One helps prevent logical bugs and regressions in your code, while the other enforces the correct use of code and data structures. They overlap a bit, but all the unit tests in the world can’t give you the guarantees that a type system does. And that’s without even mentioning the benefits to discoverability and documentation that a static type system gives you.


> This is wrong; tests and type systems have different purposes.

For decades, companies have prospered without a strong type system and using tests for type assurance ad hoc. Usually when it's worrisome or has been problematic. You can say it's wrong (conceptually, theoretically, etc) and yet it people continue to do it. That's interesting to think about.


don't think it matters since the upthread discussion is more about understanding and refactoring code, not ensuring correctness.


Tests are a great way of explaining how a system works. Arguably better than types in some instances.

In any case I would refrain from using absolutes like "wrong" for something that clearly works for some people in certain circumstances.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: