I'm back after 5 years 🙂 Should errors be discovered at compile time or run time? False dilemma! This video demos a prototype IDE which gives us the best of both worlds.
https://youtu.be/zY8DlABDp58▾
Features:
• The prototype will tell you about static type checking errors at compile time, but still let you run the program = less friction.
• You can set a start line and run the code from that line forward.
• Then as you inevitably encounter undefined variables, you can define their values live in the debugger.
• Variable values from your previous run are saved for easy re-use.
You can play with the prototype at https://emilprogviz.com/ but better watch the video first.
Yeah, while I referenced the talk mostly because of his great overview of the various dimensions of typing, that particular data point is very interesting and thought provoking, isn't it. Now, we could interpret this data point to mean that AOT type checking isn't worth it - that it has huge downsides for only a 2% upside. I think that's the interpretation Robert believes and his main message in the talk. But I find it too radical to believe without further study. I like the use of actual scientific studies here, but millions of programmers feel that AOT type checking gives them value - are they all wrong? Are their feelings really that detached from reality?
Maybe we just haven't designed the right study yet to notice the upsides. For example, maybe we should measure the time spent fixing type errors before uploading to Github. Or measure the ease of doing large refactoring work. Maybe developers in the dynamic languages feel that large refactors are riskier in their languages and thus avoid such refactors, which has other downsides on long-term maintainability. And so on.
My hope is finding "best of both worlds" solutions that have all the upsides and none of the downsides. Then even 2% is valuable, but of course my priorities certainly change depending on whether it's 90% or 2%. A tool that gives a 2% improvement is worth building only after one has built all the higher-priority tooling that give more bang for the buck.