- 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
Haha, it's for an Access database.
Admin
protected static final FALSE = true; protected static final I_WANT_TO_DIE_JUST_FROM_READING_THAT = FALSE;
Admin
Have you herd of password hash? Also this will not work in Sql Server machine.
Admin
no one will ever need more than 1024 characters of columns
Admin
Admin
I take it the two large groups you refer to are: 1. those who have only one suit of clothes; and 2. those who cannot get a job.
Admin
Roll your own ORM? Oh hells naw! At least this performs better than Doctrine.
Admin
Admin
Admin
Admin
Admin
Sadly, I think the ONE_DAY_MINUS_ONE_MILLISEC is one of the few constants that makes sense. I don't know why they want it, but a numeric constant for the number of milliseconds in a day, or larger time unit, is useful.
Admin
Yeah, I'm naked, and that pissed me off. I don't change clothes. I don't even wear clothes.
What an insensitive jerk!
CAPTCHA: uxor -- I wouldn't have put in the captcha except that it is relevant to the troll I'm currently feeding, and I usually do it anyway.
Admin
If this were C, you could take advantage of the fact that the compiler (or preprocessor?) concatenates adjacent string literals:
A great way to write code that looks fine at first glance to someone who doesn't know the language, but makes future maintainers scream WTF!?
Admin
Admin
So we need to change all those other constants so they are looked up in a web service running on the Cloud. With no caching, since the Cloud is obviously scalable and who knows when the “constants” might have to change…
Admin
If true, that'd be a whole different WTF. I didn't even think of that being possible, since it should just be " BETWEEN @value1 AND @value2", which is what I've always used.
Admin
Still cleaner than any Oracle SQL date statement.
Admin
Admin
Admin
Not so much autocompletion, and more about compile-time checking, I think. If you mistype INSERT_INTO, the IDE will tell you about it immediately. If you mistype "insert into", you don't find your mistake until someone tries to run it.
Now, I'm certainly not suggesting that this is a good idea. But I suspect the practice has evolved to protect against less competent coders... I know we have things like functions for testing if a string is null or empty - not for brevity of code, but because developers couldn't be trusted not to screw it up...
Admin
I believe this is enough for year 2013 (as well as for year 2000) to declare the author a pathetic idiot and stop reading further.
Admin
Even better, put the definitions in another database
Admin
The 'braces' will not match: sql.append(MIN).append(colums[0]).append(BRACE_END );
And a STAR will always be "*", but the symbol used for ALL_COLUMNS might change.
And in what universe is an outer join represented by "(+)="?
Is colums the slimy creature from Lord of the Rings?
Admin
Not nearly generic enough with only SPACE and DOT, should be more like :
public abstract class DAOJDBCBase { protected static final String A = "A"; protected static final String B = "B";
or for extra points on your future c.v. you could use Spring dependency injection to read these values in from an XML configuration file, in case these values differ in your development or production environments.
Admin
SPACE MAKES IT GO FASTER!
Admin
It's not about being "easily offended". It's about not forever portraying programming as a male-only field. Statements like "and sometimes even wives" just add tiny grain of support to a massive historical bias against females coders. Tiny in itself, but the overall effect is not good and not one we should perpetuate.
Admin
As is often the case, a good idea poorly executed. It is not about the literals changing, it is about getting compile errors for a "typo" in building a statement rather than a runtime error. I have done similar (but different) items, such as declaring types for the various clauses, and doing simple (not robust) validations (such as delete taking a from clause and a where clause - no where, no delete!)
Admin
It's not about being "easily offended". It's about not forever portraying programming as a male-only field. Statements like "and sometimes even wives" just add tiny grain of support to a massive historical bias against females coders. Tiny in itself, but the overall effect is not good and not one we should perpetuate.
Admin
Whoooaaaa, looks EXACTLY like one of the projects I worked on. Even though my job was to GET RID OF THIS CRAP back in 2004, right, that's almost 10 years ago, and replace the most of it with Hibernate, it appears they still have that dark legacy.
Russian hosting provider slash news agency, amirite?
Admin
Let's work out what he means. The MILLISEC looks like a unit to me, so we'll take that off, so it's ONE_DAY_MINUS_ONE in milliseconds. Yup, looks like it should be 0 to me.....
Admin
As for the gay community, everyone knows that since Alan Turing we haven't had any gay computer experts. but seriously, I don't see that they'd be any more offended than the unemployed person reading it thinking that he doesn't get to change jobs - or the nudist offended that they never get the chance to change clothes.
Clearly you have just incited WWVII on this site....
Admin
Admin
It's interesting that the quest for gender-equality seems to be skewed toward feminism, rather than toward gender-equality.
Admin
Admin
Admin
This is more secure than concatenating raw SQL because we're concatenating constants! Constants don't change, so users can't hack them!
Admin
This style is good for localization:
And let's not forget:Admin
This is not extendable enough. The alphabet should be stored in a char array and referenced. In fact, an ArrayList would make more sense, in case another letter(s) is added to the alphabet later.
Admin
if the millisecond is under the resolution of given data, it would be legal to use it for defining non-overlaping intervals. but undertanding the difference between < > and <= >= also helps ;-)
Admin
Then that's the real WTF. What about the end of year (31.12) that doesn't have exactly 24 hours, but maybe a second less? What about days with 23 or 25 hours when daylight-saving is on?
Admin
Fun fact: In most languages something like this (growable collections, whatever-builders) and certainly StringBuilder in Java, the number is not a limit but a hint concerning initial allocation. Respective classes also know how to grow efficiently (wrt allocations, copying and freeing memory).
Next time you feel like you know something, you might point it out in different style, so you won't look like pathetic idiot even in the case you are right ...
Admin
Admin
This is horrible horrible horrible.
But I guess that the original author had some thought that it might make things easier by giving him some warped kind of syntax completion/highlighting of SQL code in his IDE.
That doesn't make it any better, but maybe, just perhaps, its a clue as to how these sorts of things happen.
Admin
No, I can't imagine that day. Because it will never, ever happen. It is a terrible, terrible way of approaching a rather easy problem.
Is it THAT hard to extend PDO to run queries through a string-modifying function instead, with the extending MySQL class returning the initial string, and the SQLITE replacing "<=>" with "IS", and other basic syntax changes?
If you find yourself completely mashing up a process just to add a little bit of flexibility, you should consider closing your IDE for good, and getting a job in government instead.
Admin
Don't be so sure about that.
Admin
This is why I laugh at people who's against ORMs. At the end you'll implement your own crappy, bug infested ORM which will handle like crap and become unsustainable.
The good thing is that we'll probably keep getting more and more WTFs like this one.
Admin
private static final boolean IS_ENTERPRISEY = true;
private static final boolean IS_FRIST_DOUCHE = true;
private static final String CAPTCHA = "validus";
Admin
Admin
PARENTHESIS: () BRACES: {} BRACKETS: [] ANGLE BRACKETS: <>