- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Arrays.asList(frist)
Admin
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.Admin
Maybe they had multiple enum options originally, then removed all but one. Still creating the list inside the loop is stupid
Admin
(coughequalsmethodcough)
Admin
I'll rationalise whatever I want to rationalise, dammit!
Admin
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...
Admin
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.
Admin
all good but enums are comparable with simple == so this could have been .filter(i -> i == payment method)
Admin
If you know cSharp, then java is butter!
Admin
Filtering on equality isn't enterprise-y enough. I mean, what's next? WHERE clauses in an SQL query? That is soooo bourgeois.
Admin
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.
Admin
No; WHERE clauses in a method name.
Admin
They won't need WHERE clauses where they're going.
Admin
He's a real No; WHERE man Sitting in his No; WHERE land Making all his No; WHERE names for methods
Admin
Is Frenk now working with Jacqueline? I can see his code pattern. Frankenlambda
Admin
TRWTF is that
Arrays.asList(SRN.Type.PAYMENTMETHOD)
compiles.Admin
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.)