- 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
does it compare users with three names?
Admin
Is there a conscious Hofstadter reference in the evolution of "Frenk" --> "Grenk"?
Admin
Frenk's code was bad, and Grenk's code is worse… I shudder to think how terrible Henk's code is.
Admin
This is a Sort function. It seems to do what is requested:
All this sounds good and reasonable. TRWTF is reimplementing the wheel (in a funny looking way), but other than that... it seems to work.
Admin
C# code written by lesser programmers is full of this kind of stuff but using LINQ instead. I particularly dislike ForEach extension method certain people love to use instead of the foreach language construct.
Admin
@Mr.TA: AsParallel().Foreach( ...) is sweet sugar though.
Admin
"AsParallel().ForAll( x=> doSomething(x) )", actually.
Admin
Perhaps, but the people I'm talking about don't get parallel anyway, they're very intersectional and even perpendicular.
Admin
Mr. TA (nodebb) wrote Perhaps, but the people I'm talking about don't get parallel anyway, they're very intersectional and even perpendicular.
Are they obtuse as well?
Admin
Try rereading the article. The requirement was to sort by "lastname,firstname". So ignoring the first name not only doesn't meet the requirement, it also results in an indeterminate sort order in the case of matching last names, which (at least in C++, not so sure about Java) is a big no-no.
Admin
I am just wondering how Aenks code quality is? Super duper marvellous?
Admin
What me drives crazy is the waste of cycles. Every compare (multiple times per entry!) will do 4 splits. Every time throwing away the arrays and strings, just to have something for the GC ...
Admin
Yeah I noticed that too right away. Very poor quality code, to put it mildly. The fact that underlying first and last names fields aren't readily available is the TRWTF.
Admin
Somewhere, there's a John Smith that's not getting his TPS reports.
Admin
But... but... the poor GC needs to feel needed, and the only way for that to happen is for programmers to leave huge quantities of little droppings for it to continuously collect.
PIty the poor GC.
Admin
The articles says the underlying first and last name fields are available, Grenk just decided not to use them, he saw a "comparingByKey" function and used that, without bothering to figure out how to compare by fields in the entry value.
Admin
It’s probably a fair assumption that you’re talking here of https://en.wikipedia.org/wiki/Prince_(musician) ? If so, maybe you should have picked another artist to use as an example, like, say, https://en.wikipedia.org/wiki/Madonna_(entertainer) — wait, hang on …
Admin
All these clevar coders getting things done in one line and to hell with the performance. Programmers raised on Java, C#, and RoR think RAM and CPU are infinite. Which they seem to be but then your query that should take 2 seconds takes half an hour.
I was going to snark about assuming lastname and firstname, which is always wrong, but Remy covered that.
Admin
If a name only has one component then clearly it's the last one as there aren't any components after it. It's also the first one as there aren't any components before it. So if you want to put a one-component name into "firstname.lastname" form then the code does just that.
Admin
The problem is that although it's just one line, it's a hell of a lot of method calls and complexity. You can cram any amount of code into one line, so I don't understand why people measure it that way.
Admin
Look at it in a positive way. When management finds out that this code runs so slow that it costs money, you can make it ten times faster easily and become the hero. Even better, when your amount of data grows tenfold over team, and management finds out again that this code runs so slow that it costs money, you can make it ten times faster again quite easily and be the hero again. And even even better, you can do it another time. The third time, that will be actual work, but you will be the hero once more.
Admin
They're paid by the line, but selflessly trying to save their company money
Admin
FWIW, various government TLAs , which of course couldn't possiblly have bad forms for us to fill in, will replace a blank with a default. For example, if you have no middle initial, you will become Dave NMI Jones. So Grenk at the very least should have replaced empty splitX with either "NFN" or "NLN" .
Guess we better hope there's only one Prince, one Madonna, one Midori, one Slash, ...
Admin
Plus: every split is done with a String parameter, so will require compiling a split pattern :(
Admin
Yeah my code is bad but you could at least spell my name right.
Admin
Zrenk's code would not make it to TDWTF because it is such complex that you cannot figure out what it is supposed to do in the frist place.
Admin
Zrenk's code would not make it to TDWTF because it is such complex that you cannot figure out what it is supposed to do in the frist place.
Admin
"You want to display those users in order by "lastname, firstname". Your usernames happen to be in the form "firstname.lastname"."
Yep, see... there's your WTF.
Admin
Buy Qvir Kit Online falls under a class of antiviral drugs known as reverse transcriptase inhibitor. It is used in combination with other medications to treat HIV infection. It is also used to treat long-term HBV infection. It treats HIV infection by blocking the growth of the virus and its ability to infect the other liver cells