News for hackers. Stuff that matters.
Re:Functor-Oriented Programming by Bromskloss on Wednesday October 11, 2017 @07:19PM (#15454403)
> application code or library code

Do the two call for different styles?

Re:Functor-Oriented Programming by runeks on Thursday October 12, 2017 @01:31AM (#15455876)
I’d argue that they do to some extent.

With application code you’re interfacing with some real-life system, and need to adapt to all the corner cases of this, whereas with library code you might be implementing something entirely theoretical, where everything fits together perfectly in some abstraction because there are no corner cases to consider (it’s just a clean math concept).

With a math concept, the elegant concept already exists beforehand, and you just implement it. With application code, there might be 27 different but-ifs, and-also-remembers that you need to consider, where developing an elegant, coherent concept of the entire app is very challenging, or even impossible.

With some application code, I find I’m often the first one to make sense of it all, taking all the corner cases and creating a coherent model out of it, i.e. making it all fit into some well-defined abstraction. And then a new corner case appears and my model falls on the floor, and needs to be redesigned.

The definition of exact real arithmetic doesn’t change over time. There’s no customer who calls you up and asks you to add a feature that doesn’t fit into your existing model/abstraction.