The code has literally stayed the same — we simply moved the
isValidInput function to a different file and added a single line to import that function. We’ve also added
_isValidInput to the function signature for the sake of testability.
This is a perfect example of why FP is bad, not good. It does not express its computation, but instead relies on implicit knowledge. For instance, I have no idea how or why that would even work. It’s true, I could possibly find out, and I will, but terseness increases cognitive load, it does not decrease it.
A fundamental issue with functional programmers is the assumption that everyone is as smart as they are.
Obviously this is a trivial example, but FP code is densely packed with implicit behavior that requires an almost encyclopedic knowledge of obscure corners of a language and syntax. That’s fine, but the world turns on various levels of skill and knowledge. The problem we are trying to solve is not a code problem, its a people + features problem.