3 ms·
I agree, to an extent. Just there is basically no world where splitting a forty line function into five files is less code. And sometimes, having less to hold
by taeric 5y ago
I agree, to an extent. Just there is basically no world where splitting a forty line function into five files is less code. And sometimes, having less to hold in your head helps compartmentalize it. So you may make the specific function easier, at the expense of the entire project. :(
- pkolaczk 5y agoOf course it is not less code, but that additional code is mostly declarative documentation in the form of function signatures. You'd have to hold it in your head anyways to understand the original code, but now it is stated explicitly. The alternative to provide that information in a single big code blob would have to be code comments. And there are chances you wouldn't have to keep the function implementaions in your head, if they were extracted reasonably. Do you need to keep the details of how `sort` is implemented to be able to understand what it does?