3 ms·
Because it shields you from implementation details, making your work orders-of-magnitude simpler as time wears on. Think of how you already interact with pure
by DanielBMarkham 3y ago
Because it shields you from implementation details, making your work orders-of-magnitude simpler as time wears on.
Think of how you already interact with pure functions: bash piping, SQL statements, OS math libraries, etc. If you're expecting an int, you get an int. Now, it may be the _wrong_ int, but that's on you, not the coder. Implementation complexity goes away.
Contrast that to how you might interact with a favorite JS library or framework. You do a thing that you think is right and the wrong answer or outcome occurs. 99% of the time your'e now researching SO and digging through somebody else's code trying to figure out whether it's you or them. Most of the time it's you, the code is good, but in either case you've mentally assumed responsibility for all this _new_ complexity that, by definition, is not related to the value you want to provide; it's just supportive.
Imagine if every time we used these pure functional things if we had to grok around the web and dive into code. What would using spreadsheet by like? How would word processors help us? Can you imagine an accounting project that spent three years designing their own spreadsheet for this particular customer, or decided to use a dozen new accounting tools that had never been put together exactly like this? Yet this seems to be the most common way programmers do their work. It's completely screwed up, we're hurting both our industry and our customers by continuing to work this way, and we should be ashamed of ourselves frankly. There are plenty of examples of complex programming solutions being provided that aren't created and maintained this way. (rant continues)