- 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
Now, tell me which editor (except using Word to open HTML as text files) will insert smart quotes there.
Also, this case sounds awfully familiar.
Admin
Admin
TRWTF is Wordpress plugin developers.
I've never looked at Wordpress (or Joomla) plugin code without saying “WTF?”
Admin
A more smarter developer would have checked out the strange noise at the ends of the inner url.
An even more smart developer would have used a profiler to detect the load and that it was taking too long.
Admin
Admin
THEN
Admin
Doesn't explain why wget segfaulted tho...
Admin
Sometimes it seems the author of the copied code uses this effect to punish or tease the copying user... A colleage of mine copied a C# code fragment that contained an integer counter named "i". But it was the Unicode Character 'cyrillic small letter byelorussian-ukrainian i' (U+0456), which is really mean, because C# accepts unicode as source code encoding, so no compiler message points you to it. Only the helter-skelter at runtime (which looked like a brick got thrown into a washing machine) was a slight hint... ;)
Admin
Even just looking in Firebug (or the equivalents in (almost?) all modern browsers) Network tab and investigating the red links would have uncovered this.
FWIW Our system's 404 page is completely cached, which is only refreshed once per day by default.
Admin
I have edited for readability. Apostrophes in the wrong places, tense and number not agreeing, too many commas, and sentence fragments all made this harder to read than it should have been. Play a game of spot the differences:
A client of Jim's had a WordPress site with performance issues that were off-the-scale bad. Slower than a snail on Valium. Slower than a herd of turtles rampaging through a molasses factory. Worse than that, the actual in-browser rendering was taking significantly longer than any benchmarking tests would lead you to believe. Even massively loaded benchmark tests had better rendering times. And the client's browsers weren't massively loaded.
Jim decided to migrate the site to newer, faster infrastructure after investigating a number of avenues. The older machines were due for a refresh anyway and the newer infrastructure would be on Ubuntu Precise, whereas the older was Lucid. So, as a bonus, the client got a free upgrade! Free as in beer.
Jim ran into a segfault error while using wget to pre-populate the caching system on the new infrastructure. Huh? Segfault from wget? Why would a really, really old and stable CLI utility throw a segfault while reading the site? The logs seem like a logical place to start the search and, as expected, an odd entry was found.
GET /[redacted]/[redacted]/%E2%80%9Dhttp:/ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js%E2%80%9D HTTP/1.1 404
Oddness abounded because, as far as Jim knew, there shouldn't be a reference that looked like that in the code. He began to grep through the source and did not find a reference to the Google API URL. Next, he dumped the database and grepped the contents. Still no Google API URL to be found, but he noticed there were references to seven different versions of jQuery by various plugins, theme snippets and templates. So the search was narrowed to look for calls that included version 1.5.
It turned out there was only one, in a header file. And it appeared to be perfectly normal.
[script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”][/script]
Staring at a line of code is not traditionally taught as a debugging technique. However, in this case, it was effective. Close scrutiny revealed that the src attribute's value was surrounded by smart quotes.
As a result of these so-called "smart" quotes, all modern browsers (including, thankfully, wget) would attempt to grab the source code from http://[currentURL]/%E2%80%9Dhttp:/ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js%E2%80%9D.
In most instances this would merely be annoying, but the client site used mod_redirect to parse incoming URLs. As a result, a quick, simple HTTP status 404 was not returned. It was a full, completely uncachable page, which ultimately resulted in a 404. Since the request was bypassing the proxy tier's caching, the page cache and, effectively, the object cache, it was adding between 800-4000ms to each request. Every. Single. Request.
The correction greatly improved the overall speed of the site as you might imagine.
When many of us go searching for the solution to the most recent problem that we're trying to solve, our first, last and only resource is frequently teh Interwebs. And when we find that elusive example that does exactly what we need it to do, we cut and paste with blind abandon. Emphasis on 'blind'. Yes, the collective wisdom of the ages is available online, easily within our grasp. But applying that wisdom without understanding is dangerous. Even if 'understanding' consists of little more that recognizing certain types of quotes.
Admin
I think the 404 page contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which returned the 404 page again, which contained the same broken tag, which Segmentation Fault
Admin
So much fail: *Wordpress *non-LTS Ubuntu on a production web server *An IDE that does Smart quotes *A dev not noticing the crazy character codes in the errors logs *A developer not using a profiler to identify performance issues *A code change system that doesn't require profiling in the first place
Admin
So the real WTF is WordPress's "smartquote" inserter amirite?
I actually quite like WordPress, apart from that obnoxious "feature" that does "smart" things.
captcha venio. I drank the venio, and then vidi, vici, veni.
Admin
TRWTF is so-called "smart quotes"anywhere except text meant for reading by humans, especially by default. And even then you can run into trouble, such as when you have an encoding mismatch, or with forum software like Slashdot that tries its hardest to fuck up anything outside of U0020-U007E. So I'm going to change that to "anywhere except for printing on paper". (or printing to PDF)
I didn't like it when this smart quotes by default crap started back in the '90s. I still don't like it now.
Admin
believe me; you can fuck this up in PDF just as easily as anywhere else where you use fonts. I'd reserve the use to printout and printscreen
oppeto
Admin
Admin
TRWTF is not even looking in the browser's network console for slow requests when debugging long response time.
Admin
things that start with "smart" are usually pretty retarded.
Admin
Admin
I've always thought the lack of smart quotes in our language and on our keyboards was a WTF. Other delimiters have corresponding open and close characters: () {} [] <>. Why do " and ' act as delimiters but reuse the same character on both ends?
Of course, once a standard is established, you're usually stuck with it even if you don't like it. I'm just lamenting the original design is all.
Admin
Has anyone ever used strange fonts in PDF files with ROT13-like obfuscation to intentionally mess up those who does copy-and-paste? Or sometimes like substituting "1" (one) with "l" (lowercase L).
Admin
TRWTF is that those so-called "smart" quotes aren't even smart, since they're both pointing in the same direction.
Admin
Originated with typewriters, I believe. When you have a practically limited number of keys to which you can assign values, you cut corners everywhere you can. So there was one key whose shift value had ' on it, and another which had " on it. When keyboards for computers were designed, the same basic convention was followed, with a few essential additions: three more shapes of brackets (angle, square and curly), backslash, pipe, etc., and before you know it, all the codes from 0 to 127 were used up. So your fancy quote-marks (unnecessary as they are) were relegated to the "non-standard" section.
Mind, I love the idea of developers deliberately sabotaging their on-line examples by using sneaky non-standard characters.
I have encountered situations in which my IDE itself throws warnings that the characters I'm using are non-standard (I have vague memories of an Eclipse/CVS environment which corrupted non-standard characters messily); perhaps it's time for such IDEs to offer this option de rigueur.
Admin
TRWTF are smart quotes in web software that isn't online word processor and even then easily turnable off. I know what type of quote mark I want to type, thank you very much.
Admin
Anyone else notice that "http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js" should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
Admin
Admin
Been there, done that & found the above reason.
I do not know who thought that specific shorthening (of just 5 chars) would be a good idea. :-\
Admin
Admin
Admin
Smart quotes are a bane!
Admin
Another (of the seemingly many) TRWTF is changing your entire hosting platform on a whim because you couldn't work out how to do a bit of code debugging.
Admin
That's it. My new coding standard is to use the
as my standard loop index variable in all code.Admin
I have written xUnit tests that scan our source code and report all non-ASCII characters. Mostly, I find them in comments. They're annoying in comments. They can be darned annoying and sometimes problematic in string constants. In code, they're usually compile errors.
Admin
I am so smart. I am so smart. S M R T I am so smart.
Admin
It's a good idea if you may need to use either http or https (protocol independent). It avoids getting those crappy mixed security messages when you are developing without SSL internally before deploying to a production site with SSL.
Admin
Because it's being propped up.
Admin
Simple, they wrote that part of the URI spec based on what someone could do if they dropped random parts of the URI.
As with so many hopelessly backwards web standards, it's an interface being driven by implementation.
Admin
I. Hate. Smart. Quotes.
I hate them with a passion that burns brighter than a thousand suns, for in my mind they serve absolutely no function other than looking pretty, and the programs that "helpfully" insert them generally do so automatically and are extremely difficult to persuade not to do this.
My fury also rages at the plethora of things that hyphens get turned into and the vast array of whitespace that looks exactly the same on the screen but really isn't. I'm sure it has a point somewhere, but the average user won't know that, so why make it an option? Worse, why make it the default?
Admin
On windows, at least, it's backslashes that indicate a network location. I've never had the issue you've had, and I'm a bit baffled any web browser would behave in the manner you suggest.
Admin
When part of my job was configuring IIS, I said that to myself EVERY TIME I had to click the "Advanced" button ... for "Advanced" configuration ... of an "Advanced" web server.
Admin
800 ms to 4000 ms to do mod_rewrite and to load the 404 page? That's quite a WTF there as well...
Admin
Though I must confess that the IE browser which has that problem is quite old, and that a quick test with a bit more recent (but still also quite old) FF browser shows it doesn't have it.
Admin
OSX does this to me on any copy/paste operation into a rich text editor. If you use the notes app it will convert your quote characters. If you paste into an e-mail it converts your quote characters. It's pretty annoying.
Admin
Look, if God wanted smart quotes, he would have made them work in the 'vi' editor.
Since they don't, smart quotes don't belong in programs.
Of course, there will be a discussion about EMACS, but God doesn't bother.
Admin
Admin
Nice closing paragraph, but you forgot to add "in... the WTF Zone"
Admin
When we interview candidates, I always take their resume and highlight any instances of the word "complex."
Admin
It's a pity that it's not easier to type non-straight quote marks without relying on heuristics (aka guessing) as to what you mean.
Admin
Admin
If it's over http, it uses http. If https, then https. And if the page's URL happens to start with "file:" (remember Guestimate said a saved HTML page), then IE (and probably any other Windows-based browser) is happy to interpret the URL as "file://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js", which maps to the UNC pathname "\ajax.googleapis.com\ajax\libs\jquery\1.5\jquery.min.js" tries to connect to a CIFS server on ajax.googleapis.com, with all the slowness that entails.