3 ms·
Debuggers and stack traces too. Logic is not line-based. When you get a NPE on a line containing `thing.method(x.y.z, q(), w.e().rty())`, which item is it on?
by Groxx 4y ago
Debuggers and stack traces too. Logic is not line-based.
When you get a NPE on a line containing `thing.method(x.y.z, q(), w.e().rty())`, which item is it on? Type information is insufficient, there could be multiple of the same thing on the same line.
Some debuggers are smarter ("step to cursor" sometimes goes to in-line locations), but many are not, and most languages I've seen will give you precise compile-time error locations, but at runtime all you get is lines. Lines suck.
- btgeekboy 4y agoAside, I’m really excited to move to a newer JDK: https://openjdk.org/jeps/358 https://openjdk.org/jeps/358
- cratermoon 4y agoThoughtful application of the Law of Demeter would improve at least half the code examples given. Judicious use of Option<> would help, also.
- Loranubi 4y agoPython 3.11 provides this information at runtime. https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-err...