Brought to you from the 5000+ line Java file. Contained within the 1500 line method. I bring you the following pattern. Let's guess all the ways we could've done this better?
- Streams
- For loop
- Iterator
What gets really fun is when this you get this pattern doubly nested so you have a random i's and j's floating all over the place.

Note: this isn't ancient code it was developed about 3 months ago.

[Code has been lightly anonymized]

  • 5
    What triggers my OCD most is the excessive use of spaces with no proper meaning behind them.

    Normally you would space lines of code that make sense when grouped together, but this is just all over the place.
  • 0
    Try 152.4 pages of code (5.5 characters a word, 250 words per page), * 5 for old code thats since been removed. 1/3rd the length of war and peace.

    Still yours is almost as long. Welcome to the club!

    We have fancy white jackets, and padded cells.

    And the occasional electrocution...for our health of course.
  • 2
    I have honestly seen worse. It's readable, it's clear what piece of the code is supposed to do. Could it be better? Sure. Would I loose my sleep over it? No.
  • 1
    @msdsk I agree in principle. However this is part of a massive 5000 line class, that has random sections of it commented out and all of which is wrapped in a massive 27 line if else statement with hundreds of lines packed into each section.
  • 0
    To be fair, I sometimes refactor my streams to code like this. Very purposefully.

    Try and guess the WHY ;)
Add Comment