|
|
|
|
|
by ComNik
3682 days ago
|
|
As a side note in his talk "Simple Made Easy" (https://www.infoq.com/presentations/Simple-Made-Easy, around minute 42)
Rich Hickey mentions, that conditional statements are complex, because they spread (business-)logic throughout the program. As a simpler (in the Hickey-sense) alternative, he lists
rule systems and logic programming. For example, keeping parts of the business logic ("What do we consider an 'active' user?", "When do we notify a user?", etc...) as datalog expressions, maybe even storing them in a database, specifies them all in a single place. This helps to ensure consistency throughout the program. One could even give access to these specifications to a client, who can then customise the application directly in logic, instead of chasing throughout the whole code base. Basically everyone involved agrees on a common language of predicates explicitly, instead of informally in database queries, UI, application code, etc... But Hickey also notes that this thinking is pretty "cutting-edge" and probably not yet terribly practical. |
|
Facebook wrote about rebuilding a similar system in Haskell that only changes memory incrementally, so it's definitely possible to do better.