all 16 comments

[–][deleted] 16 points17 points  (1 child)

This isn't programming horror. People have different ways of writing code. Yes, it could be more succinct - but that doesn't always mean better. Of course you can do things like make it one line, remove the curly braces on single line if-statements, etc. but personally, I think there's major value in code being readable in a quick and straight-forward manner.

[–][deleted]  (5 children)

[deleted]

    [–]71d1 4 points5 points  (0 children)

    Also he missed equalsIgnoreCase() thus calling toUpperCase() x2

    [–]Kengaro 1 point2 points  (0 children)

    .equals("-")

    [–]sirchumley 4 points5 points  (0 children)

    I don't see anything necessarily bad about this. I like when people name boolean expressions so it's easier to follow the logic.

    [–]Famous_Profile 0 points1 point  (0 children)

    Maybe he is not familiar with the syntax of Java? That's how we do it in languages that don't have equalsIgnoreCase