Skip to main content
added 127 characters in body
Source Link
Basilevs
  • 4.5k
  • 1
  • 20
  • 32

In my limited experience (desktop IDEs, script interpreters), attempts to extract a functional core are usually detrimental:

  • the imperative shell requires much more testing in the first place and has more bugs (because of concurrency and event model which maps poorly to functional core), so the "testability" argument does not hold
  • the functional core has to be exposed to testing code, violating the natural unit bounds (requires testing implementation instead of interface)

Benefits:

  • significantly improved readability - is subjective
  • lots of fun

are subjective and usually not worth it.

On the other hand functional utilities are fine (but are usually provided by standard library).

Conclusion

The functional core - imperative shell approach requires a matching domain to be effective. Something where "mutation" is not the main objective.

In my limited experience (desktop IDEs, script interpreters), attempts to extract a functional core are usually detrimental:

  • the imperative shell requires much more testing in the first place and has more bugs (because of concurrency and event model which maps poorly to functional core), so the "testability" argument does not hold
  • the functional core has to be exposed to testing code, violating the natural unit bounds (requires testing implementation instead of interface)

Benefits:

  • significantly improved readability - is subjective
  • lots of fun

are usually not worth it.

On the other hand functional utilities are fine (but are usually provided by standard library)

In my limited experience (desktop IDEs, script interpreters), attempts to extract a functional core are usually detrimental:

  • the imperative shell requires much more testing in the first place and has more bugs (because of concurrency and event model which maps poorly to functional core), so the "testability" argument does not hold
  • the functional core has to be exposed to testing code, violating the natural unit bounds (requires testing implementation instead of interface)

Benefits:

  • significantly improved readability
  • lots of fun

are subjective and usually not worth it.

On the other hand functional utilities are fine (but are usually provided by standard library).

Conclusion

The functional core - imperative shell approach requires a matching domain to be effective. Something where "mutation" is not the main objective.

Source Link
Basilevs
  • 4.5k
  • 1
  • 20
  • 32

In my limited experience (desktop IDEs, script interpreters), attempts to extract a functional core are usually detrimental:

  • the imperative shell requires much more testing in the first place and has more bugs (because of concurrency and event model which maps poorly to functional core), so the "testability" argument does not hold
  • the functional core has to be exposed to testing code, violating the natural unit bounds (requires testing implementation instead of interface)

Benefits:

  • significantly improved readability - is subjective
  • lots of fun

are usually not worth it.

On the other hand functional utilities are fine (but are usually provided by standard library)