• bvs23bkv33 (unregistered)

    Arrays.asList(frist)

  • someone (unregistered)

    Looks to me like the original programmer wasn't too sure whether == would work properly as an anonymous function-type thing (I don't know what specific language this is), and so used the return value of a single function call as the body instead.

  • (nodebb)

    Maybe they had multiple enum options originally, then removed all but one. Still creating the list inside the loop is stupid

  • Little Bobby Tables (unregistered)

    (coughequalsmethodcough)

  • someone (unregistered) in reply to Little Bobby Tables

    I'll rationalise whatever I want to rationalise, dammit!

  • Tom (unregistered)

    Equals just does not look complicated enough... before you know it non-programmers start to understand what we are doing. So in future just add some complex looking code (that actually does not really do anything) to make your work look difficult. It will serve your paycheck well...

  • (nodebb)

    And that is how Jacqueline removed The Speed-up Loop and got promptly removed from the project and fired, because performance of the program was now good enough.

  • dombar (unregistered)

    all good but enums are comparable with simple == so this could have been .filter(i -> i == payment method)

  • (nodebb)

    If you know cSharp, then java is butter!

  • Steven Don (unregistered)

    Filtering on equality isn't enterprise-y enough. I mean, what's next? WHERE clauses in an SQL query? That is soooo bourgeois.

  • Anon (unregistered)

    This is obviously job security. Whoever wrote this obviously (hopefully) planned to come back at some point later, make a one-liner, and claim a large bonus for his work.

  • (nodebb) in reply to Steven Don

    No; WHERE clauses in a method name.

  • linepro (unregistered) in reply to Watson

    They won't need WHERE clauses where they're going.

  • Little Bobby Tables (unregistered) in reply to Watson

    He's a real No; WHERE man Sitting in his No; WHERE land Making all his No; WHERE names for methods

  • Frenk's buddy (unregistered)

    Is Frenk now working with Jacqueline? I can see his code pattern. Frankenlambda

  • (nodebb)

    TRWTF is that Arrays.asList(SRN.Type.PAYMENTMETHOD) compiles.

  • Naomi (unregistered) in reply to urkerab

    What's wtf-y about that? Sometimes you just need to build a list out of a few specific elements. Think of it like a "list literal" if it helps.

    (Of course, nowadays we have List.of. Same idea, just a little clearer, and overloaded to dodge varardic array creation with small numbers of elements.)

Leave a comment on “Created Equal”

Log In or post as a guest

Replying to comment #:

« Return to Article