- 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
There's that
language="JavaScript"
again. I don't know what standard tells you to do that but it wasn't the one I read.Admin
IIRC my “Javascript 1.5” book (circa 1998) indicated that this was necessary for compatibility with Netscape 2, but that the recommended way for modern (for the time) browsers was
type="text/JavaScript"
.I’m pretty sure that browsers which only understand
language="JavaScript"
do not support Dojo,{...}
notation to define objects, and CSS, though...Admin
I love how a num is a string. Ain't never going to surprise anyone like that…
Admin
F6F9FC is definitely more blue than any other primary colour, so it's OK to call it 'blue'. And anyway it might just be part of a 'blue' theme, going from the name of the class...
Admin
I suspect that some people do this kind of stuff when first learning languages at U, then when they get a job are under pressure and simply reuse stuff they did as a student, because learning how to do it properly takes work. The faster a computer is, the faster it can repeat all your mistakes.
Admin
I wanted to say that nobody writes code that badly..but then I remembered that here I am helping performance tune an application written by one of folks that, after first using an O(n^2) algorithm to sort a mostly already sorted stream of data, then takes a pass through the sorted data one more time...to check to make sure it's actually sorted....
So sigh...
Admin
I especially love this part!
Admin
I'm wondering how this bit was used:
None of the other month stuff in the article uses it, so either it wasn't WTFy enough, or just never used anywhere.
Admin
Honestly, whatever they thought they were doing, it's less of a WTF than designing a system with 0 based months.
Admin
Really? I plead guilty to having done exactly that. Because, Java Calendar. You don't need to tell me the inconsistency of having January=0 but first day of month = 1. They are just conventions. The important thing is to adopt a convention and stick to it, and the way to adopt a convention is to use the most general and widely used class in the libraries. Calendar example = new GregorianCalendar(2014,0,1); //works for me
The designers of Calendar obviously weren't thinking of SQL compatibility, but really compared to complete fusterclucks like the irrational US date format MM/dd/yy which so often causes problems given the British more logical dd/MM/yy (little endian rather than mid endian) remembering to offset by a month when going from Java to SQL and vice versa is pretty straightforward. And your unit tests catch errors every time, don't they? Which you cannot do with the US/GB date format foulup.
Admin
A lot of this stuff looks to me like generated code, like the locale regex. There's probably some server-side code generating the JavaScript, so when the locale isn't "en", the regex might actually do something. Of course, then TRWTF would be why isn't the regex done in the server-side code.
Admin
google inurl:innerCHK hmmm Vietnam Airlines
Admin
Oh my.
The original page is over five thousand lines long. And half of it is just multiple copies of style definitions.
I wonder how many paste keys were worn out during the production of this monster.
Admin
Can one of you Regex-geniusses explain
var locale = 'en'.replace(/_/, '-').replace(/iw/, 'he').toLowerCase();
to me? Does this not take the,lowercase 'en', replacing the nonexistent underscore and the non existent 'iw' to make it lowercase afterwards?If so, it is only 1 problem, not two or more. The problem being that this line is completely useless.
Filed Under: Maybe I am missing something here
Admin
You are not missing something. The developers were missing something, namely a central nervous system.
Admin
You designed the Java Calendar? No, I left out "using" specifically, because we all get saddled with WTFs.
Who really cares about that? How about human compatibility? Or even compatibility with their own formatting functions?
Admin
I'm guessing Dragnslcr's explanation is correct:
Admin
Missing a few central nervous systems, even -- their HTML is just as WTFy:
Admin
Did I miss something in the anonymization? Or was the real site that easy to find?
Admin
I found another site that acts very much like the one outlined in this story. As a non-root user (or via a text browser or with NoScripts enabled -- I think this server has been pwoned), curl/grab this site, and take a look at all the WTFs:
No Dojo, but very similar coding styles.
Admin
Hint: google search for "wpfThemeBlueBackgroundPanelTable"
Admin
I did that and only got two results. One was my article, the other was some random blog that had already scraped the article and re-hosted it.
Admin
That google search turns up all of two results, so yeah -- the real site is that easy to find.
As to the server-side generated code explanation, well -- that doesn't explain the copies of Get_Cookie spewed all over, or their idiotic abuse of HTML. If I wrote a browser, I'd have it autosend a nastygram to
webmaster@
if it encountered bad HTML/CSS/JS...Admin
I don't get why people are complaining about this. These days if it works who gives a fuck how its done. OO concepts - who gives a fuck, it works. This is not how it should be done - who gives a fuck, it works. Seriously, they teach them at school that now. I miss C, really did teach me things.
Admin
If it's the first day of the year, how many months have there bean?
Admin
Lattes.
Admin
Will you please comment more in the forums?
@antiquarian, I think we've got one for you.
Admin
Because it's a sign the developers were just slinging mud all over the place until they got something that behaved in a semblance-of-working-for-them fashion. Would you trust a house that was built simply by slapping two-by-fours together quasi-randomly until it met the size constraints?
Also -- I let the W3C HTML validator have a peek at it, and it's plenty ugly. Highlights:
Filed under: and you wonder why browsers are so buggy
Admin
People who implement web functionality with SQL backends?
Admin
I'm just saying. Interfacing with people is a bit more important than that. The database people just had a better immune response to the 0 based index brain worm.
Admin
I have seen a "programmer" paste the SQL generated by SQL Studio straight into a prepared statement, without removing the large amounts of whitespace. He seemed to think that because SQL Studio presumably strips out the decoration before sending a query to the server, Java would somehow know automatically to do the same thing to text. And then decided when asked that, well, it didn't matter because after all a hundred or so extra spaces don't take much time to transmit. At this point it occurred to me that many coders nowadays do not know what it is to be parsimonious with resources. This goes some way to explain the redundancy and wheel reinvention in so much JS.
Admin
Don't they take extra time to comprehend though? Interfering with your own brain is never a good idea...
Filed under: which side of the "Ballmer Peak" was he on, anyway?
Admin
If the users are aware of how you are encoding dates, you are doing it wrong.
You keep using abusive terms for zero based months, but you haven't explained why you think it is wrong. It is just a convention, like having the zero of time on 1/1/1970. We put up with October (which means the eighth month) actually being the 10th month since the start of the year was shifted from March to January, and compared to that 1 or 0 base is trivial.
Admin
That shite is full of gems:
Admin
If my users are aware, sure. But I'm a user, too. And I call bullshit.
That's true. I thought it was too obvious to bother. But I'll let you in on the secret that everyone else has already figured out: Each month already has a number associated with it.
That's my point. And having the months start at zero is a retarded convention.
Fffffffffuuuck. Taken in by another troll. Well played.
Admin
Admin
About date, I recently said that the user-agent was one of humanities greatest WTFs but date-time handling is pretty close. I mean, from the top of any web stack (HTML/JS) all the way down to the database, you're probably going to have three or four conversions, and if you add localization, then welcome to DateTime hell.
Admin
I think he's beyond help, but could provide a fun trolling target.
Admin
http://youtu.be/aNaXdLWt17A?t=26s
Admin
That's exactly what I'm saying! I just see so much done like that lately that I'm afraid I'm becoming numb to it. That site was done by sub-sub-sub-contractors who just don't care to think a bit beyond copy/paste. Wouldn't be surprised to find some code c/p from stackoverflow or whatever tutorial site... makes me wonder now...
Admin
I get this article...
Admin
Makes me appreciate schools that teach programming based on the high-level concepts, not as a trade that you simply learn the high-level tools for. Things like this are what drives me towards the craftsmanship crowd...
Admin
Well, they didn't really need to think of SQL compatibility did they? Why would they encourage the WTF of manually building SQL strings?
JPA's
@Temporal
doesn't care, whilePreparedStatement
andCallableStatement
have setDate methods, use them!Admin
Fava Azuki Mung Garbanzo Runner Lima Pinto Kidney Black Navy Soybean ...
Admin
To the other...crimes...of this structure, I suspect we can add that the code is assembled from a database. This is suggested all the </script><script> combinations: Each individual script is pulled from a different set of database rows, so it must be complete.
Admin
SSMS does not strip the decoration.
In fact, stored procedures actually preserve decoration.
Admin
What purpose does the /./ serve? This looks like the sort of precautionary nonsense someone would write if they didn't trust the computer to do what they said. "Now remember, from the themes directory, go straight into dojo. Don't go anywhere else first."
Admin
none in a URL
not exactly. but kinda.
. is "the current directory"
so if you say ./dojo you mean "the file or folder called dojo in the current directory, not any executable called dojo in the $path"
and then cargo cult means people do ./dojo/portal_dojo/dojo/dojo.js without knowing that once you put the / in $path no longer has effect and so you don't need the leading ./
then concat that to a path ending in / and....
Admin
Why did Discurse truncate that at </script>? @discoursebot
Admin
@HardwareGeek - Days Since Last Discourse Bug: -1
<!-- Posted by SockBot 0.13.0 "Devious Daine" on Wed Dec 17 2014 23:59:54 GMT+0000 (UTC)-->