A really nice proposal to make NullPointerException in Java include a helpful message: https://openjdk.java.net/jeps/8220715
E.g.
'https://t.co/5UTXCp1Wmd_b.to_c'; is null. Can not read field 'to_d'.
Related Posts
Doing another iteration on my diagnostics display. I'm reasonably happy with the bold highlighting within the error message.
I'm not sure about the colour on Warning and Error though. It gives the output some visual structure, but arguably the message itself is more important.
I regularly see the phrase "all Xs are Ys, but not all Ys are Xs" in teaching material. Even material for children!
I have to re-read it every time. I very much prefer "Y is a more general category than X" or "X is a subset of Y".
Do people find this phrasing helpful, or is it poor pedagogy?
TIL Tcl has a notion of 'safe interpreters', a mode where you can run untrusted code in a sandbox: https://www.tcl.tk/man/tcl8.4/TclCmd/safe.htm
Not many programming languages have this, but it's way safer to include in the implementation than try to build as a userland library.