OnErrorResumeNext never before have more terrible words been spoken.
Every time Iβm reading a PowerShell script at work and see -ErrorAction SilentlyContinue I want to scream into a pillow and forcefully revert their commit.
Iβve actually done it a few times, but I want to do it every time.
but you can follow any exception down to the exact line of code (or JNI call, I guess) where the problem occurs.
But, itβs not really where the problem occurred. How often do you get a stack trace and the bug fix is at the line referenced by the stack trace? Almost never. Itβs more that it takes you down to the exact line of code where the effects of the problem are bad enough to affect the running of the program. But, the actual problem happened earlier, sometimes much earlier.
For example, NullPointerException isnβt actually the problem, itβs a symptom of the problem. Something didnβt get initialized properly, and nobody noticed for a while, until we tried to use it, and got a null pointer. Sometimes itβs easy to go from the effect (null pointer) to the cause (uninitialized thing). But, other times that βthingβ was passed in, so you have to work backwards to try to figure out where that thing comes from, and why itβs in that broken state.
Sure, itβs better than nothing, but itβs still frustrating.
I think itβs pretty useful, be interested to hear your hangups with it though because itβs definitely not perfect.
If something goes wrong and I have a stack trace, that plus the type of exception will almost always be enough for me to figure out whatβs wrong at least as a starting point. Iβve worked mostly with JVM languages in my career though so maybe I just donβt know how bad it actually is.
letβs not act like Javaβs error log is useful
deleted by creator
Super-advanced java devs like me do it like
try{} catch (Exception e) { System.out.println("something went wrong"); e.printStackTrace(); }deleted by creator
On Error Resume Nextnever before have more terrible words been spoken.Every time Iβm reading a PowerShell script at work and see
-ErrorAction SilentlyContinueI want to scream into a pillow and forcefully revert their commit.Iβve actually done it a few times, but I want to do it every time.
And thatβs why youβre a hero.
Yeah cos everyone knows other languages are impossible to write bad code with
Which is usually not a piece of code written by us and is caused by another piece of code not written by us either
Does your IDE not highlight the lines written by you in a different colour? Of course that doesnβt help when itβs an error in production!
Is it possible to make intelliJ do this?
I thought it highlighted the line number in blue when it was your code. I use eclipse so canβt properly remember
deleted by creator
But, itβs not really where the problem occurred. How often do you get a stack trace and the bug fix is at the line referenced by the stack trace? Almost never. Itβs more that it takes you down to the exact line of code where the effects of the problem are bad enough to affect the running of the program. But, the actual problem happened earlier, sometimes much earlier.
For example, NullPointerException isnβt actually the problem, itβs a symptom of the problem. Something didnβt get initialized properly, and nobody noticed for a while, until we tried to use it, and got a null pointer. Sometimes itβs easy to go from the effect (null pointer) to the cause (uninitialized thing). But, other times that βthingβ was passed in, so you have to work backwards to try to figure out where that thing comes from, and why itβs in that broken state.
Sure, itβs better than nothing, but itβs still frustrating.
deleted by creator
I think itβs pretty useful, be interested to hear your hangups with it though because itβs definitely not perfect.
If something goes wrong and I have a stack trace, that plus the type of exception will almost always be enough for me to figure out whatβs wrong at least as a starting point. Iβve worked mostly with JVM languages in my career though so maybe I just donβt know how bad it actually is.
Itβs not bad. Itβs better than what most languages give you
skill issue
The same applies to using the core dump.
In fact, the Python one is the lest useful of the trio.
When the day comes that you need
gdbyou will indeed be amazed at how fucking powerful it is. If your server crashes grab that core dump!Itβs extraordinarily useful
Implying you canβt consistently go to the same line every time and it always has what you need.