Programing: the Expression Problem

By Xah Lee. Date: . Last updated: .

In programing language design, you have something called the “Expression Problem”.

The “expression problem” isn't really a problem in computer science. It is a problem as in: “Houston, we have a problem.”

Wikipedia Expression problem has a excellent description, quote:

The Expression Problem is a term used in discussing strengths and weaknesses of various programming paradigms and programming languages.

the “Expression Problem” is best explained here:

c2 expression problem 2023-04-16 b4Ssb
http://c2.com/cgi/wiki?ExpressionProblem

but, better is to understand it as the general case of “Cross Cutting Concerns”, explained here:

c2 expression problem 2023-04-16 ht5QK
http://c2.com/cgi/wiki?CrossCuttingConcern

in functional programming language, it's easy to add new operations, but hard to add cases to the datatype. While in an OO language it's the other way round.

and even more generally, it's a problem of multi-hierachy or multi-organization. The problem is that, one fixed structure (or focus/aspect) of code that assumes situation X, cannot deal well with situation Y without refactored or rewritten.

So, the specific case of “Expression Problem” is really not a problem in programing in any math or concrete sense. (That is, for example, sorting, concurrency, efficiency, are real problems that can be formalized as formal logic.) It's like saying, i want white shoes and i also want black shoes

http://stackoverflow.com/questions/3596366/what-is-the-expression-problem

expression problem Calmarius 2023-04-16 69zf7
expression problem Calmarius 2023-04-16 69zf7