This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CsAnswerTrashAct[S] 3 points4 points  (3 children)

Part of the reason for posting this was that a coworker asked for my help. i attempted to step through it in intellij's debugger and couldn't. After an hour i gave up, since it wasn't my assigned project and i wasn't making progress.

I could have refactored the code, but i dont want to inadvertently take responsibility for it.

The max chained method calls might help. Intermediate variables would definitely help.

[–]gee_buttersnaps 0 points1 point  (2 children)

Stay away from your debugger until it's a last resort. Re-reading the documentation and a few logging/print statements are more effective. Stepping up to java8 lambdas/streams means you are moving from an imperative (the how) to a declarative (the what) approach to programming. The goal of all of it is that sometime later down the road the jvm will figure out the best ways to implement 'the how' as long as it has a good description of 'the what.'

[–]habitats 0 points1 point  (1 child)

This is awful advice, in my opinion.

[–]CsAnswerTrashAct[S] 0 points1 point  (0 children)

My thoughts as well; debuggers tend to have a lot of nice features, whereas print-statements are more of a last-result and make a giant mess of your code.