- 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
best part is about vacation
Admin
Next Friday is my last day - no today is your last day
Admin
Bad: You inherit the crap code.
Good: Whatever created the crap code is gone, and if most of the team banded together to tell it to get out faster (and it worked), the crap code shouldn't have any major obstacles to being replaced with better code.
Admin
Also his brace style sucks.
Admin
And it looks like the query is complaining (perhaps to the compiler), in some languages the @ means to suppress errors, so they're also suppressing it from letting them know that what they are doing is wrong
Admin
What gets to me isn't the code or brace style, but the indentation (assuming it's not a byproduct of putting the code on display for us here).
A 4-space-indented "if" followed by a 6-space-indented "else" is truly the sign of a sick mind.
Admin
Had one of them on our team once. Last thing he did before he left was to commit some code with an appalling bug that completely compromised our ability to access a certain in-house tool, the lack of which necessitated a cumbersome workround. As a result of that, when I took over the task of maintaining his sh1t, I was unable to actually do anything about it -- because the process that was put in place to prevent dodgy code like that being committed actually prevented me being able to put in place a test harness to allow the fix for that bug to be tested. So it never got fixed.
Our manager, on whose watch this all happened? "Oh, you can't really blame (Rockstar) for what happened -- he was just a bit demob-happy."
When I left for pastures new some short time later, this but had still had not been fixed, and there were no future plans for doing so, despite my best efforts.
Admin
We had a RockStar™ who left some time ago. Every project he did is in a different language, apparently because he wanted to learn them, and WTFs like this are everywhere.
He works for Google now. Pretty sure we all know what projects they have him working.
Admin
Not in this case.
Java has @SuppressWarnings for suppressing warnings, all other "@" are annotations, that can be used to give hints to the compiler to generate MORE warnings or used by a tool (like Spring) to inject code. In this case, the @Query is used by Spring (and probably Hibernate) to inject code that runs the query.
Admin
That's nice, but the code isn't written in "some languages", it's written in Java.
That reminds me of people who used to post inane comments like "I don't know [language of the WTF], but in [some other language] this wouldn't even compile!!!11!1!". Yeah, so? If you don't have anything meaningful to say, STFU, or you are TRWTF.
Admin
To be fair, Spring Security also sucks and I would recommend anyone not to use it. This, however, is probably much worse.
Admin
It's all the formatting... The use of spaces is all over the map. A space between the function name and the left parentheses? What kind of sicko does that!?
Admin
I don't see anything in the submitted code that implies it is responsible for checking whether a user is logged in.
Admin
Another WTF is using yet another language. Spring? Really?
Admin
Spring isn't a language, it's a Java framework.
Admin
jesus that sucks and... I'm heading home.
Admin
I'm surprised there's no webservice out there specifically for providing blank pages. Then they could have just used its API and saved having to code it themselves.
Admin
Whatever you replace it with, the next guy who comes along will say it's crap :-)
Admin
“He works for Google now. Pretty sure we all know what projects they have him working.”
Google + ?
Admin
TRWTF is obviously that there's no caching layer around the database query. This is probably a common request, so the empty result set should be cached (it won't even take up much room).