11
luaq
6y

java.lang.StackOverflowError

Well, I've been betrayed... Now what?

Comments
  • 6
    That's why I don't like recursion. It makes a clever and nice algo, I give you that. But it's too easy to break the dragons loose
  • 3
    @netikras That’s why I don’t like recursion
  • 0
    @xalys In the 4th comment of this rant I explain what's wrong with careless use of recursion
  • 0
    @netikras You can also easily make a while(true) loop. recursion will at least hard crash with facts where it hung, instead of just silently idling till eternity without debug info..
  • 0
    @gitreflog jstack -l <pid>

    in case of an exc the user will simply refresh the page as if it were a simple glitch. As for an inf while loop - there's no way your infra monitoring is gonna miss that :) it'll make sure you're aware of a bug in your code
  • 0
    @netikras And how in the world are they gonna miss an exception? Now let's imagine a desktop application. An infinite loop might be noticeabld ot the user, but there is no way in the world the user will use jstack or any tool at all to diagnose it if he reports it at all. An exception how ever can be very well catched and auto reported via some tool like raven or sentry.io.
  • 0
    Why would a user care abt an exc or an inf loop? It's not users' matter. The developer should care abt it. Sysadmin. App-admin. Devops. Anything but the user
Add Comment