- 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
That's Roger's Profanisaurus. A bit different from Roget's work.
Admin
So... Joey was well acquainted with Kevin Bloody Wilson's work?
Admin
The second to last paragraph has "amateur" misspelled as "amatuer".
Admin
Is it April already? If not, someone has to fill in the blanks for me. How do you get from "transfering his music collection ... onto his computer" to Perl scripts with meaningless variable names?
Admin
BTW, Roger's Profanisaurus (a dirty dino?) is of course available online, and has nothing on "dirk". It does mention Charlie, Donald, and Eric, but dirk/Dirk is sadly missing.
Admin
Ernest encountered problems with digitizing his music collection. So he had to bring in help. And this help (Joey) got to see his desktop with the collection of nicely named scripts.
Admin
Re: dirk and profanity.
I always thought of it as being just a specific sort of dagger, but ... no. It's also a verb, meaning to stab someone with a dirk-form dagger.
And a slightly obscure and geographically specific term for the "male member"... https://en.wiktionary.org/wiki/dirk#Etymology_3
Admin
Not the worst variable naming we've seen on this site.
Bonus challenge: write a series of regexes that constitutes a piece of obscene ASCII art.
Admin
Trick question: all regexs are obscene ASCII art.
Admin
It would be truly dirty if they threw in Hungarian notation.
Admin
I will confess that when I'm having an awful time getting some script to work I have named a temporary variable "$f*ck" out of frustration. But once I get things working I clean it up because why subject myself to that when I read the code later?
(I don't put an asterisk in variable names. I just thought the spam filter might get triggered by fully-spelled out profanity.)
Admin
As far as I fucking know, it doesn't.
(Let's see...)
Admin
Can't claim that today's story does not live up to the web site's title.
(No it isn't "worse than failure", that was just a backronym)
Admin
Imagine if that was a real dinosaur name. It taunts its preys by throwing dirty words at them...?
As we say in French:
Les archéologistes ont des fouilles curieuses.
(I'll see myself out now)
Admin
I feel like there might be some England English vs. US English going on here with how some words are profanity. While I speak US English, I know some of these are from England.
Admin
Dirk seems to be just alt spelling for di c k.
Admin
TRWTF is Perl
Admin
Only if you evaluate it by someone writing code like it's the late 90s. Perl has progressed so tremendously since then, that it is truly unfair to gauge it like that. It's like comparing a modern GPU to an original Voodoo card; a lot has advanced since then.
For example, the modern equivalent of
could be something like:
You just can't judge from a book and style clear from over 20 years ago. Perl today is a thriving language, with the CPAN repository being a, frankly, unmatched wealth of community works available for anyone to use.
Admin
A dirk is a long bladed Scottish dagger, and like most types of swords & dagger, is also slang for a penis
Admin
Point me to the github repo, this looks fun.
Admin
And you think that's better? It's just as hard to read, but now all one one line!
Admin
Also, "spew" sounds more like it belongs in that list of profane variable names not an actual serious function name :O
Admin
Dirk could be connected with Dirk Diggler, initially the subject of a mockumentary but later became a character in Boogie Nights.
Admin
"Worse than failure" may have been a backronym, but it's also the only official expansion ever given for "WTF" in this context and it's never been rescinded.
Admin
This is how all Perl code should be written.
Admin
It wouldn't be a Perl article without gordonfish in the comments running his usual gimmick, "I can write this ugly Perl code in a different way (that is also ugly)."
Admin
Or perhaps a fan of Dragon's Lair
Admin
The main point that I was showing was that all that old school boilerplate, just to open and read the contents of a file, is quite unnecessary in modern Perl. There are many options for accomplishing this available in a nice clean fashion and without getting bogged down.
It could just as well be split to multiple lines/phases for more readability:
Though given that this is an
.htmfile, suggesting that it contains HTML, in more real world practice, I would use a proper HTML/XML parsing tool, likeMojo::DOM(though the way the original author was splitting it suggests it contains something else, or in some unusual/obscure/custom encoding perhaps) as using regex to parse such markup is normally heavily discouraged.Lets be honest, this type of criticism could be made of any language or function that one doesn't recognize and can't be bothered to look at the documentation for.
Admin
I don't speak up often at all about that, so there is no "usual gimmick", nor have I been the only one. Perl absolutely doesn't not need to be written as tight and short as possible. It can and often is written in an elegant, readable manner. Like with any language, once you know it better, you can find more efficient ways to write things, which can indeed sometimes come at the expense of readability to the less experienced, since there are things that have yet to be learned.
Admin
I’ve watched you do it on literally every Perl article. Sometimes I wonder if it’s a “bit,” especially when you bring up indented /x substitutions.
The other WTF is, why does the loop stop at $#penis-1? $#arr in Perl has the -1 built in. It could be intentional but I’m not bettin’.
Admin
I have commented on maybe a handful of articles in the past, but I am at a complete loss as to how to arrived at "every" when that simply isn't true by any stretch; I haven't even been commenting on this site for very long.
And why, should I ask, wanting to correct people operating on woefully out of date ideas be considered a negative, instead of a net positive when it's pointed out that what you thought you knew was not accurate? I don't judge other languages that I'm less familiar with (and I have and do use a lot) and I have in the past even admitted that Perl code can get rather wild in the right hands (especially golfers), though this site alone has shown how atrocious code can be written in any language.
Admin
I agree that looks like a mistake unless they really meant to stop one element short.
Admin
Maybe it's circumcised.
Admin
To be honest, I'm kind of surprised this story actually included KBW, if I was to ask any of the people I know who don't live here in Australia, none of them would know who he is, Americans are the worst for not knowing anything Aussie.
Admin
A cunning linguist indeed!