Every so often, I accidentally mis-spell something in Elixir.
I get a cryptic message from the bowels of a library.
And spend time, so much time, debugging a stupid spelling mistake in my own code, that gets passed into a third party library and errors.
Often you can catch this with a warning, but the errors from these types of mistakes are often so in-your-face, that you forget about looking at the warnings…
JavaScript is the other notorious ‘bad spelling’ offender.
Many others? Does it really just depend on static type checking?
Somehow I suspect not.
Are there any dynamic languages which catch spelling errors better than Elixir does right now?
One thing that some (well-written) libraries do, at least in Erlang where I have seen it, when there are more complex functions is to have an internal pass which checks the arguments and generates an explicit badarg error at the top-level call. It won’t really catch spelling errors but it will give a more understandable error than some function_clause error from deep down.