Great talk about API design by Casey Muratori

  • Great talk about API design by Casey Muratori:

    It's about writing C libs for games, but you can apply it to Lua as well.

    [little rant: To me this talk shows the many ways in which C is bad at modularity. Many C programmers complain that it's much harder to write libs than apps in C (not to say that it's impossible but people blame the programmers when the language also creates many bad incentives). Just a quick example: many C libs are callback-based because they're much easier to write that way than stateless-pull-style. Lua's coroutines combined with closures can make it easy to provide a better API where the control is not inverted, without constraining the lib programmer, that is, neither the lib code nor the user code has to be callback-based-spaghetti code. And if you think I'm comparing apples to oranges, these features could've been added to C 20 years ago without incurring any runtime overhead.]

  • 1
    Log in to reply

Internal error.

Oops! Looks like something went wrong!