You are viewing a single thread.
View all comments View context
131 points
*
Deleted by creator
permalink
report
parent
reply
52 points
*

Super-advanced java devs like me do it like try{} catch (Exception e) { System.out.println("something went wrong"); e.printStackTrace(); }

permalink
report
parent
reply
52 points
*
Deleted by creator
permalink
report
parent
reply
11 points

On Error Resume Next never before have more terrible words been spoken.

permalink
report
parent
reply
4 points

Yeah cos everyone knows other languages are impossible to write bad code with

permalink
report
parent
reply
7 points

you can follow any exception down to the exact line of code

Which is usually not a piece of code written by us and is caused by another piece of code not written by us either

permalink
report
parent
reply
10 points
*

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!

permalink
report
parent
reply
1 point

Is it possible to make intelliJ do this?

permalink
report
parent
reply
5 points
*
Deleted by creator
permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
13 points
*
Deleted by creator
permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 5.3K

    Monthly active users

  • 1.5K

    Posts

  • 33K

    Comments