• Anonymous (unregistered)

    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.

  • (cs) in reply to Anonymous
    Anonymous:
    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.

    I find myself often removing non-ASCII characters from commit messages that a certain control version system mails. Yes, it actually replaces quotes with smart quotes and hyphens with en characters. Quite annoying.

  • Anon Y. Mouse (unregistered)

    TRWTF is Wordpress plugin developers.

    I've never looked at Wordpress (or Joomla) plugin code without saying “WTF?”

  • (cs)

    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.

  • Anonymous (unregistered) in reply to Anon Y. Mouse
    Anon Y. Mouse:
    TRWTF is Wordpress plugin developers.

    I've never looked at Wordpress (or Joomla) plugin code without saying “WTF?”

    Because PHP itself is already more than a WTF?

  • Daniel (unregistered)

    THEN

  • zerazerazerzerzaer (unregistered)

    Doesn't explain why wget segfaulted tho...

  • NinjaSquirrel (unregistered)

    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... ;)

  • (cs) in reply to henke37
    henke37:
    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.

    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.

  • Grammar Nazi (unregistered)

    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.

  • (cs) in reply to zerazerazerzerzaer
    zerazerazerzerzaer:
    Doesn't explain why wget segfaulted tho...

    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

  • That admin guy (unregistered)

    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

  • Jim the Tool (unregistered)

    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.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    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.

  • someone (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL

    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

  • P (unregistered) in reply to That admin guy
    That admin guy:
    *non-LTS Ubuntu on a production web server
    I think that both Lucid (10.04) and Precise (12.04) are LTS releases.
  • Adhominem (unregistered)

    TRWTF is not even looking in the browser's network console for slow requests when debugging long response time.

  • (cs)

    things that start with "smart" are usually pretty retarded.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to FrankyBoy
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.
    It's not stupid, its advaaaaaaanced!
  • (cs) in reply to FrankyBoy
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.

    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.

  • Anonymous (unregistered) in reply to someone
    someone:
    believe me; you can fuck this up in PDF just as easily as anywhere else where you use fonts.

    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).

  • Doodpants (unregistered)

    TRWTF is that those so-called "smart" quotes aren't even smart, since they're both pointing in the same direction.

  • QJo (unregistered) in reply to vt_mruhlin
    vt_mruhlin:
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.

    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.

    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.

  • Tux "Tuxedo" Penguin (unregistered)

    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.

  • hobbes (unregistered)

    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"?

  • v (unregistered) in reply to Zemm
    Zemm:
    zerazerazerzerzaer:
    Doesn't explain why wget segfaulted tho...

    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 .... Segmentation Fault

    No, wget is not that stupid, it can handle infinite recursion just fine by filling your hard drive completely if you did not give it a depth limit.
  • Guestimate (unregistered) in reply to hobbes
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    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. :-\

  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.
    It's not stupid, its advaaaaaaanced!
    But what does the "G" stand for?
  • anonymous (unregistered) in reply to Anonymous
    Anonymous:
    Now, tell me which editor (except using Word to open HTML as text files) will insert smart quotes there.
    I'd not point my finger at the IDE... I'd blame the dev, which probably and blindly copy-pasted some "Learn JQuery in 5 minutes" code from the interwebs which, for some reason, contained smart quotes. I already found code like that, except that I replaced the quotes.
  • (cs)

    Smart quotes are a bane!

  • BuildMeMoreServers (unregistered)

    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.

  • Jeff Grigg (unregistered) in reply to NinjaSquirrel

    That's it. My new coding standard is to use the

    NinjaSquirrel:
    as my standard loop index variable in all code.

    ;->

  • Jeff Grigg (unregistered)

    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.

  • Homer Simpson (unregistered)

    I am so smart. I am so smart. S M R T I am so smart.

  • bigbob (unregistered) in reply to Guestimate
    Guestimate:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    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. :-\

    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.

  • QJo (unregistered) in reply to Zylon
    Zylon:
    ¯\(°_o)/¯ I DUNNO LOL:
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.
    It's not stupid, its advaaaaaaanced!
    But what does the "G" stand for?

    Because it's being propped up.

  • Meep (unregistered) in reply to Guestimate
    Guestimate:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    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. :-\

    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.

  • Calli Arcale (unregistered)

    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?

  • grasshoppa (unregistered) in reply to Guestimate
    Guestimate:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    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. :-\

    As has already been mentioned, the reasoning was to allow for protocol independence. If the page is loaded over http, it will use http. If https, then https.

    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.

  • ih8u (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.
    It's not stupid, its advaaaaaaanced!

    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.

  • (cs)

    800 ms to 4000 ms to do mod_rewrite and to load the 404 page? That's quite a WTF there as well...

  • Guestimate (unregistered) in reply to grasshoppa
    grasshoppa:
    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.
    To make absolutily sure I did not mis-remember I monitored port UDP:137 (nbname). A image-link starting with a double forward slash did show name-resolving activity there.

    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.

  • Steven W (unregistered) in reply to Anonymous

    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.

  • (cs)

    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.

  • anonymous (unregistered) in reply to Guestimate
    Guestimate:
    grasshoppa:
    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.
    To make absolutily sure I did not mis-remember I monitored port UDP:137 (nbname). A image-link starting with a double forward slash did show name-resolving activity there.

    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.

    Realise that you're talking about Internet/Windows Explorer. Forward- and backslashes were basically interchangeable at that point in its history.
  • Dominic (unregistered)

    Nice closing paragraph, but you forgot to add "in... the WTF Zone"

  • (cs) in reply to ih8u
    ih8u:
    ¯\(°_o)/¯ I DUNNO LOL:
    FrankyBoy:
    things that start with "smart" are usually pretty retarded.
    It's not stupid, its advaaaaaaanced!

    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.

    When we interview candidates, I always take their resume and highlight any instances of the word "complex."

  • Evan (unregistered)
    Close scrutiny reveals that the src attribute's value is surrounded in smart quotes.
    Or, as they were known for hundreds of years, "quotes."

    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.

  • (cs) in reply to Calli Arcale
    Calli Arcale:
    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?

    In MS Word, typing ctl-Z immediately after it smartifies a quote will return the quote to its original dumb state. Similarly for smart apostrophes and m-dashes. This will be especially useful if you need feet/inches or minutes/seconds.

  • (cs) in reply to grasshoppa
    grasshoppa:
    Guestimate:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    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. :-\

    As has already been mentioned, the reasoning was to allow for protocol independence. If the page is loaded over http, it will use http. If https, then https.

    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.

    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.

Leave a comment on “Code Abuse”

Log In or post as a guest

Replying to comment #436141:

« Return to Article