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

The point of the OP is that you don't need dedicated functions for most of these utilities, let alone hundreds of lines of code.

0 lines of code is preferable to battle-tested code.

10 lines of code is preferable to 1000 if you don't need them.



The point of the OP was that _.chunk is 140 lines, which is apparently too much. But `just` doesn't even support chunk(), so it's unclear what the advantage is. Sure, you can theoretically spend your time crafting your own implementation, but why? For the self-satisfaction? I'd rather just get on with my work.


I would probably just copy the implementation from lodash or stackoverflow and fix it up.


A chunk replacement is only 6 lines according to:

https://youmightnotneed.com/lodash#chunk




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

Search: