- 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
So the WTF is linking to cache urls? or is there something else going on?
Admin
last 6 are the same image
Admin
...authored by "the other junior dev."
Admin
The Real WTF is the write up of this article not pointing out the real WTF.
Admin
If his first app was using bootstrap CSS, then he's still a junior as we speak.
Admin
Right, because when I see "col-sm-6" I always search for "randomClass". :-?
Because "make-short" contained a random display: hidden? Because $("img...") replaced the image? Dumb this down for a non jQuery guy.
Admin
What this post doesn't clearly explain;
We can see amazon caching going on and could reasonably hypothesize that the cache IDs are temporary. We're also assuming that we know what the class "make-short" does. Possibly "display: none"? The article doesn't explain...and I am a CSS guy.
@Author, there's some clean up to be done...
Admin
TRWTF is this article.
Admin
I don’t understand this WTF.
Admin
Last six are also the same image as the first one!
I still have no idea what the point was, but deep-linking to arbitrary image URLs in an Amazon AWS cache is definitely a WTF.
Admin
I tried one of the image. Received a 403 response code.
The website declined to show this webpage
HTTP 403
Admin
No, it doesn't explain why.
Admin
This doesn't explain anything, we don't know what the 'make-short' class is, the 'randomClass' and 'otherRandomClass' are set up only for small screens (hence the "col-sm" class) which means they'll show just fine on screens larger than 570px, and there's a stack of images which seem to be very similar and are pointing to links that may or may not exist.
I would say the article itself is the WTF, not the contents of it.
Admin
If you cant explain why something is a WTF, please don't bother posting it.
For the benefit of all those who feel their lack of jQuery knowledge is preventing them understand this post, ill attempt to describe the code: When the page (DOM) finishes loading (this will probably run on any page on the site)
That is all.
While this code certainly has a smell, I fail to see the WTF. for the 10+ years that ive been a daily WTF-er, this is the first time that a post has let me down. I feel like I wont get back the 5 minutes of my life I have wasted trying to find the missing WTF in this post.
I feel pretty empty and let down.
Admin
Yes, without further explanation the WTF remains very unclear. I mean, of course it's pretty WTF-y to include the same image 7 times and link to a cache directory on amazonaws. But this doesn't explain why "new images on the site had randomly not worked", nor does it explain, why someone would run a project wide search for "randomClass" when trying to figure out how "col-sm-6" is defined.
Admin
I am not sure how I'm gasping at the WTF and coming to the comments and seeing a bunch of unimpressed commenters. I mean, for starters instead of setting 'col-sm-6' as a class, a pretty typical Bootstrap 3 layout class for a div, the page uses 'randomClass' as a class, and then the JavaScript... adds 'col-sm-6'? Instead of just putting that as a class on the div where it'd be meaningful for layout?
And then it starts giving a bunch of img tags the 'make-short' class, which doesn't appear to be part of a framework, but it's inexplicably doing it by image location instead of a normal choice like 'class', or 'images contained in a div with a particular class'. Presumably it's doing it for every image the author knew existed on the site at the time this script was written. Like the previous lines, it's modifying the HTML on the client side after it's been rendered, with classes that... could very easily have been added when the HTML was generated on the server side.
So this JavaScript, in its entirety, adds meaningful layout classes on the client side, using very poorly chosen selectors, when it didn't need to be done client side. That's spectacular.
Admin
There are a few obvious WTF bits here. And yeah "the other dev did this" .. Yep. Sure. Sure they did.
Admin
Yeah, this article is truly TRWTF. The submitter and/or Mrs. 'Editor' leapt from one fact to another and left the reader out to dry. One's level of jQuery familiarity is irrelevant because the meat just isn't there. The definition of make-short would help. There's a legit WTF as Merus explained, but it's easily dwarfed by a more forceful WTF from reading this so-called article.
And I did check the page for hidden elements of randomClass and make-short. It's no surprise that the gaps are born of ineptitude rather than sophistication.
Admin
I too am confused by this "article".
Admin
I think what's odd about this code is that (visually styled) classes are being added to elements, based either on classes they already have or on the fact that they're images from a particular URL. This means that if you add a class (e.g. "randomClass") to an element then it will have styling that isn't obvious from the CSS. Worse, if you add an image with a particular URL, then that element will have unexpected styling. And if you add a new image expecting it to have that styling then you'll be unpleasantly surprised.
It's spooky action at a distance is what it is.
Admin
First, does "randomClass" have some special meaning in JS, or is it just a WTF-y way of naming a class?
Second, why would the programmer have found this by searching for "randomClass", but not by searching for "col-sm-6"? Is there some omitted step in the article where he noticed that the images affected belonged to "randomClass"? But even so, wouldn't a search for the actual offending text have been more effective?
Admin
TRWTF is as follows:
jQuery is (still) a core frontend technology and the basis of many DOM-fuckery frameworks (e.g. React and the now-dying AngularJS). It's good for runtime DOM manipulation. It is not good for development time DOM manipulation.
IM(not-so)HO this is representative of the other bad decisions in the code.