| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
Or other languages for that matter
|
|
MyComment = Replace(MyComment, "FRIST", "")
frist |
The spec only asked to strip the Greek and English languages. lang=FR is fine, as is LANG=fR. It really seems like there should be a regular way to express this without hardcoding all the different possibilities. Oh well. |
|
lAng=frist
this is still funny right? |
|
Better hope you never get a URL where the lang parameter is the first of several parameters.
|
|
I love how the second section of replaces will break any query string by removing the vital "?" mark.
|
No. "Frist" was never funny to begin with. It's just beating a dead horse. A very, very, very dead horse. |
|
I sense some EN-Gr in his co-worker...
|
|
Varg aurait dû être inquiets que la solution ne fonctionne pas ... Que? Je ne peux pas parler Anglais. Quelle domage!
|
Re: RePLaCeD
2010-07-07 09:20
•
by
Philip Newton
(unregistered)
|
Then it didn't do a very good job, since Greek is "el". ("gr" isn't registered as a language tag at all, at least not with IANA: http://www.iana.org/assignments/language-subtag-registry ) Also, it should have replaced the "?lang=xx" forms with "?" if a "&" followed, otherwise "bla.php?lang=en&img=true" would turn into "bla.php&img=true" which wouldn't du what it was supposed to. |
Re: RePLaCeD
2010-07-07 09:22
•
by
getofmymetriclawn
(unregistered)
|
Yes, but by also using the "reusing the WTF-pattern in the article with some meta-reference to the comment" meme, he is beating one dead horse with another dead horse, which could, in theory, still be funny. |
|
Brute force string replace - now that's a classic WTF. A bit boring, but classic nonetheless.
|
Eh, maybe. If he was beating a dead horse with a dead horse whilst riding a dead horse over a pile of dead horses, that would be funny. |
|
That looks like some perfectly normal VB to me. Yes it would be atrocious in other languages, but again, perfectly fine VB!
|
So he can beat a dead horse while he beats a dead horse? |
I dunno... I think once you have more than 3 dead horses it becomes less funny and more sad. |
Boooo... |
|
I would love to see how he would handle "Replace any 6 digit numbers with their hexadecimal equivalents."
MyPage = Replace(MyPage, "000000", "00000") MyPage = Replace(MyPage, "000001", "00001") MyPage = Replace(MyPage, "000002", "00002") MyPage = Replace(MyPage, "000003", "00003") MyPage = Replace(MyPage, "000004", "00004") ... MyPage = Replace(MyPage, "999999", "F423F") |
Avoid the common caveat of not uppercasing the strings ... because if "999999" translates to "F423F", then surely uppercase("999999") should also translate to "F423F". And just for good measure do a lowercase("999999") as well... Unless you're supposed to return "f423f" ... or "f423F" ... Hmmmm |
|
You have to love how VB.Net has its own special namespace with slightly different implementations of already available string methods.
|
|
Acarily I actually came quite close to writing this today, seeing as I can't be bothered to learn .NET regexes.
My solution is as follows, where I want to replace the value of the parameter:
|
|
It's a shame they weren't using TDD. It might be fun to keep adding an additional failing case once a day, assuming Varg's colleague had to keep fixing it. (And who knows, after a few months, the colleague might actually fix it correctly.)
|
I get asked to do this literally ALL the time. |
Re: RePLaCeD
2010-07-07 09:56
•
by
anonymous coward
(unregistered)
|
Why? Didn't you do it right the first time? |
No, GR is greek and SP is Spanish! You might think that because they suck at regular expressions, they are resourceful enough to get the correct language abbreviations. It seems the incompetence is uniform throughout all facets though. |
Kind of grotesque image, that - beating a dead horse with another dead horse. I guess one dead horse would have to be very small so it could be wielded as an instrument to beat the other dead horse. Like one of those miniature horses, which is still classified as a horse and not a pony. It would have to be quite fresh too, and not too decomposed, otherwise it would fall apart early during the beating process. The other horse can be any size and level of decomposition, so there's a bit of leeway there. Even then, typically in the IT industry one doesn't find that many dead horses lying around. In my career, the closest I could have ever gotten to this is beating a dead pigeon with a dead fish, or vice versa. |
|
TRWTF is being called Varg and no varg jokes yet
|
Using the brute force method he could still be doing it for the first time. I hope your boss is relaxed about deadlines, Bobbo1 |
The source of many a good WTF. Looking forwards to seeing yours! |
Re: RePLaCeD
2010-07-07 10:12
•
by
Also Anonymous
(unregistered)
|
FTFY |
What? Beating dead animals with other dead animals? |
QFTFY |
|
"We've just added 3 more languages to our webpage and we need you to tidy up a bit the code your predecessor left. Huh, what's a front controller? Why would we do that, we just copy-paste the code to every page, it's simple. Anyway, get started, this shouldn't take you more than an hour"
|
|
A bonus meta-WTF:
Can't wait to hear that... "My page equals replace open bracket my page comma double quote and lang equals E N double quote comma double quote double quote close bracket" "My page equals replace open bracket my page comma double quote and lang equals G R double quote comma double quote double quote close bracket" ... |
|
FFS.
This is the 21st Century. We're even a decade in. Are there really any sensible languages that DON'T have regular expression support? Oh wait. You said VB, right? :P |
on an embedded system with no file-system, only Irish Girl can mix metaphors with memes |
|
Hmm... I see your point in here, people. Correct me if I'm wrong here, but TRWTF here is that, instead of manually generating all possible cases for the replaces... he should have used a CASE tool to generate all that code, that automatically considers all poosible cases for him... right?
|
To be fair, learning regexes is also a source of many good WTFs. |
HTML 4 is speced (and carries over, in essence, to XHTML and HTML5) to use RFC 1766 for languages, however. RFC1766 specifies using ISO 639 two letter codes which, indeed, are "el" for Greek and "es" for Spanish.
This is carried over in RFC 3066, which specifies the ISO 639-1 interpretation for two letter codes and ISO 639-2 for three letter codes. This adds "gre" and "ell" for modern Greek (for bibliographic and terminology purposes) and "SPA" for Spanish. |
No, TRWTF is that he didn't write a .bat (batch?) file to generate the different cases automatically from an Excel spreadshit. |
|
Bah. I'm not impressed. Lyle could have come up with twice as many Replace permutations, in the same amount of time!
|
+1 sir |
Something, something, dead horse. |
Why are we beating a dead horse with another dead horse? Let's start beating the guy beating the dead horse with another dead horse. |
|
Why not just convert the query string to all lower (or upper) case and then just remove the "lang=el" part of it?
|
Re: VB.NET
2010-07-07 11:26
•
by
RandomUser423692
(unregistered)
|
No, this is pathetic VB, also. Err...wait. You're a troll, aren't you? Blast! |
Not relaly, lAng=Fritz is funnier. Only though if you're in Metropolis. CAPTCHA=enim : Not quite a rap star. Yet. |
How would you put it back to its previous capitalization? ;) |
Perhaps you didn't notice the name of the poster? |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |