Fear, trust and JavaScript: When types and functional programming fail

Could you tell what you mean by this in practical terms? If your data is really that gradual and fuzzy, then you can't realistically write programs that operate on it.

Say you write software for a warehouse system and the warehouse has an inventory, and storage facilities or whatever, and all of that is transmitted to your program in some format. You can build a type for that specific incoming data but what if the warehouse changes and they update their protocols? What if someone messes up the forms, or even semantically enters something that conforms to your type, but still is nonsensical?

All of this happens in real-world software all the time. Data changes shape, it's incomplete, wrong in some way you didn't anticipate and so forth. Your type system can be super restrictive and make you jump on the smallest change, but that hurts your capacity to operate. You can update your type system all the time, but that incurs a lot of coding you actually wanted to avoid.

Rich Hickey in a talk compared this once to having the DHL truck arrive at your door and checking the entire truck for its content, even if you only want one thing. Take what you want by name, send the rest of the data on it's way.

/r/programming Thread Parent Link - reaktor.com