6 ms·
A function is dedicated if it is well-suited for a use case. It does not require it to be ill-suited for other use cases. Either you arguing that `left-pad` is
by rdancer 11y ago
A function is dedicated if it is well-suited for a use case. It does not require it to be ill-suited for other use cases.
Either you arguing that `left-pad` is not a "dedicated" function for padding by 42 characters, because it can also pad for 43 or 41, or I don't understand you at all?
- afandian 11y agoThe point is that it's easy to pad a string in C and easy to pad a string in JS but there's no specific function called 'padstring' in either. The examples were really secondary to the point of my argument, which was about packaging functions into modules, not about the C language.