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

One thing I've learned, is that unit testing seems much much more painful than it has to be when you are using too many classes.

When you are writing code as pure functions (i.e. stateless), it's actually much less painful. In the provided example, I would never write a class to curl a website and parse json.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: