4 ms·
> Secondly, naming a function "json" requires the user read the code or the comments to figure out what it does, and blocks the user of the name for anything el
by MadcapJake 11y ago
> Secondly, naming a function "json" requires the user read the code or the comments to figure out what it does, and blocks the user of the name for anything else that returns json. Suppose rather than a string you have a list that you need translated to json... what do you name the function?
This is exactly what functional programming seeks to solve. This should be the same function. Every language that has the power to do FP has the ability to do multi-functions or pattern matching just for this kind of situation.