3 ms·
The author seems to make the assumption that the problem with left-pad is how small the library is. But that's just the symptom. The real problem with left-pad
by catnaroek 11y ago
The author seems to make the assumption that the problem with left-pad is how small the library is. But that's just the symptom. The real problem with left-pad is how little functionality is actually provides. A 200-LOC C library that only left-pads strings should be subject to just as much scorn as the original 11-LOC JavaScript one. Unfortunately, it's difficult to assess how much functionality a library provides just from its LOC count.
- TickleSteve 11y agoMaybe a complexity metric would be a better measure?
- catnaroek 11y agoI don't think any algorithmic analysis of the code can determine how much value it provides to the user. Some things simply require human judgment.
- TickleSteve 11y agobut we're trying to infer that things dont have value to the user based on complexity.... the lower threshold is an easier target.
- mhd 11y agoAPI surface is often misleading, too. A JSON library that basically just provides a "json_encode" and a "json_decode" could be perfectly cromulent, whereas "trimlib", providing "right_trim" and "left_trim"...