1. 2

  2. 4

    inc_pair is a really weird example to use to talk about the sins of abstraction. It doesn’t really seem all that abstract to me, I would use it purely as a mechanical way to reduce lines of code. This talk is completely missing actually valuable aspects of abstraction, such as composability. Using abstractions that are composable is great! It helps you build larger programs than you could otherwise. Maybe this is just what abstraction means if you’ve been slumming in C or C++ most of your life, but in the land of Ocaml or Haskell there is real value in abstractions when they can be used together to build newer things. That this post doesn’t even touch on this (there is a comment later on that does) makes me think the author is just on a different plane.

    1. 1

      I think the author’s points do indeed work best as a commentary on language design, though I don’t believe they were meant that way in particular.

      Perhaps this needs a c tag?

    2. 1

      Let’s look at a practical example: What if type T for our inc_pair function is “Duration”? What will the function do?

      I imagine it will do the same thing that ++ does.