Common error: providing an Integer when a Float is expected

This actually speaks to an issue that is deserves more visibility in the Julia world. We’ve made a significant correction to JuMP development practices to implement what I call the “MethodError principle”: Style Guide · JuMP. Basically, error messages at library boundaries should explain to users what they did wrong and not which internal assumptions were violated deep in the code. For the specific case of MethodErrors this implies that “A user should see a MethodError only for methods that they called directly.

This is a goal that’s not always possible with generic code; however, there are small changes that could go a long way once we recognize this as a priority. I don’t have time to write an essay on this right now, but maybe I will later.

10 Likes