What is the ‘expression problem’?

Watch this lecture.

The idea is that your program is a combination of a datatype and operations over it. The problem asks for an implementation that allows to add new cases of the type and new operations without the need for recompilation of the old modules and keeping static type safety(no casts or runtime type checks).

It’s interesting to notice that in functional programming languages 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. This is one of the big conceptual differences between the two programming paradigms.

Leave a Comment