- 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
No one said anything about BASIC or assembly code, this was Perl!
Admin
Sorry, I am from Finland and I have never quite understood this whole Nagesh meme thingie.
In Nagesh meme there is always this "lolcat-n00b" comment written in broken English that is sometimes companied with a picture from a third world country.
The "n00b" humor part is understandable; this is The Daily WTF. It is the third world part that is strange to me, because that is how majority of people (you could say, the middle class of this planet) lives. Where is the joke? I am unable to see it.
Is this Nagesh thingie some unconscious way for a person from an old economy to mock the new emerging markets? Or is there a conscious and real joke here, which I am unable to understand?
I am not trying to mock anybody, or pulling any racist cards, or anything like that. I am just trying to understand the joke!
Admin
Anyone can post as fake Nagesh, and most of the photos I've seen are in this group.
The joke, if there is one, is often that Nagesh (real or fake) is bragging about how advanced things are in his country, while -- apparently without realizing it -- revealing by his illiteracy or in the pictures how dismal it really is.
I would guess it is an attempt to poke fun at Indian programmers, who, for many of us, "stole our jobs" by drastically underbidding and then producing very shoddy work.
Admin
Or any kind of modern locking network file system, where the files, and locks, are cached.
Three alternativs are (1) to use an antique file system without caching, (2) to use one of the unix-style network file systems, which are 'designed' for single-user and read-only access, or (3) to properly tune your transactional file server/network system for single-user or read-only access, so that locks are not cached.
None of these alternatives are suitable for systems where you can not specify the file system.
Admin
Perl has the sleep() function to facilitate The Speed-up Loop.
Admin
Apparently, Dave was the 6th person to review Alvin's code. Classic defensive programming requires that subsequent to all code reviews, code must executes more slowly. (While some understand the term "defensive programming" to mean that the code protects itself from failure, the true meaning is that it protects its creator from failure.
Alvin should consider the base of his self-defense function though. After the previous review, sleep time was increased from 4 to 5 and code executed 20% more slowly, whereas in this one, code executed only 18% more slowly. Were he to use base 2, he would have true job security.
This is only the kind of thing that causes people that manage people like Alvin to hire more people like Dave, and indeed, at an increasing rate.
Admin
"Boom!" It's no longer funny. Never really was, I guess.
Admin
This has nothing particular to do with Perl. People have been sprinkling random sleeps everywhere since time began (i.e. Jan 1 1970 GMT).
Perl written with the modern facilities and features is beautiful.
There are some wonderful things in there now:
http://www.modernperlbooks.com/mt/2012/02/the-memoization-of-lazy-attributes.html
If anyone does need to get up to speed, and they're not stuck on Perl 5.8.8 (can RHEL5 die already?), you need to give this book a read:
http://www.onyxneon.com/books/modern_perl/index.html
(Free PDF).
Admin
That's something that points to a file with japanese content in it
Admin
My predecessor would have a directory named after a client, and sometimes the date, and/or something else resembling a version number, and then files named 'parselogs.1.pl' through 'parselogs.36.pl'. In most cases, the file a few "revisions" before the final number would be the working one. So I'd see 1 - 36 and give 32 a try. This was an iffy thing to divine, because there might be a couple files called 'logparse.pl' with a few numbers in them. And I saw a few symlinks as well here and there. Further complicating matters, file mod times were all over the map. Sometimes every file had the same ctime.
Among all this, he'd have "backups", which were like your guy's snapshots. They may or may not have been named descriptively, and may or may not have contained any actual files relating to the contents of the directory they lived in.
I actually submitted some of his code to this site. I figured since I was trashing it all anyway, at least someone could get a laugh (or a lesson).
He re-used things like $a, never checked system calls, file handles re-used the same name but never got checked on open, etc. He'd declare a variable right when he needed it, and then re-use that same name elsewhere. Indentation was in tabs and/or spaces, and varied wildly from 2 columns to 8. The most WTFy code I saw was a recursive function that modified global variables, including a hash that almost certainly grew very large. It used labels and gotos in order to stop the recursion.
The sad part was the owner of the place paid this guy for almost three years, and though the guy was somewhat slow, the owner thought that there'd at least be some value in what he had paid the coder to write, that perhaps it could all be re-used elsewhere.
After a couple weeks of "Well, I know we came across this sort of thing before. See if M has any code or scripts that might work..." I finally had to break it to him that he'd been throwing money down a hole and all the last guy was good for was keeping a chair warm.
Admin
Dunno if it applies to Perl, but in C/C++ land this sort of neurotic behavior is often caused by a new programmer's first encounters with multi-threaded programming, where faults caused by race conditions can often be "cured" (i.e. made harder to reproduce) by inserting sleep() calls at various places in the code.
Admin
It is extremely humorous when a qwerty tries to use a dvorak.
The reactions have been varied over the years, some people take it as a challenge and start mapping the keys by trial and error, but most just complain, and ask how to "fix" it.
Admin
So why is it Perl's fault if this so-called veteran is a dumbass?
Admin
At some point these people learn that copy/paste/modify isn't as fast as they think it is, that it causes more deficits than benefits. Very often it just can't be taught to someone. It has to bite them in the ass before they learn; they have to learn it the hard way.
Admin
I have my keyboard mapped as colemak, but it's a qwerty keyboard. It's close enough that people think it's just broken, rather than completely different. Much hilarity ensues.
At another job of mine, I had a blank keyboard. The IT help tried to sort out a problem on it and got very confused trying to get copy/paste to work :)
Admin
It's a file handle in japanese ;)
Admin
Admin
Mhh . so you say you write broken code for a broken OS ? Please post the root cause of the behavior you're describing, I'm pretty sure it's good quality WTF.
Admin
Admin
Well ... --n; would've done it of course (loop TO 0) .. but then as you pointed out, the guy was an idiot.
Admin
You DO realize there is an OS and drivers between you and the hard drive and you don't just write from perl into the harddrive right ?
Admin
It's a kind of dumbass force multiplier.
Admin
Mostly every language has a PCRE extension . I don't think most languages have a SED compatible RE extension ;) - might have at some point or whatever, but that's long gone.
And no, the world is not made from shell scripts.
Admin
And you must be Matt Westwood, resident troll and patented asshole.
Most outsourcers make sure their 'outsourced talent' is as cheap as it gets (i.e. get them from the street, send them to JCC (java concentration camp), sell to client) so if by mistake one of the good programmers accepted to work for them, you should help him change employers.
Admin
TRWTF though, is that TDWTF's recover password/registration thing doesn't work.
Admin
No, a Perl ass. BASIC didn't have a native sleep() command so he's use ping 127.0.0.1 - n 11 >NUL instead.
Admin
Admin
The one with the IO::Handle module. http://perldoc.perl.org/IO/Handle.html
Admin
I think that whenever an intern checks in code, Alvin adds one second of sleep to demonstrate to management how bad newbie code is and how it dangerously slows the application. Later, he can lower the sleep by one or two seconds and be praised for his expertise and optimisation hard work.
Admin
TRWTF is the article.
Admin
Facepalm.
Admin
Wow, I think I submitted that one back a couple years ago when I first started reading TDWTF! I had given up on it ever making it into an article!
For the record, we were on a SUN system, and his sleeps were in various places around the code-- but most notably always after a filehandle close. And, if it had been things like "sleep 1", I... guess... I could see some sort of bizarro explanation with NFS not writing the file or something. But... 99% of the time, it wouldn't have mattered anyway.
His program (in this case) would wake up every MINUTE, check some statuses, and then write them to the log file. And then sleep for 1-3 seconds. Always between 1 and 3. No more, no less. So... speed wasn't an issue. And parallel writes weren't an issue. It was just a log file. Or a status file, I forget which.
Anyway, his code was chock full of minor WTF's. If I knew more at the time (and if we still had it lying around), I'm sure I could have found tons of blog-worthy snippits. But alas, it's gone.
The story has a satisfying conclusion though: he had been there as a summer intern for at least one summer, and had a full year of working there full time, until I came in with just about zero Perl experience. But after I was there 6 months, I knew more Perl than he did, and was making him look bad (I learned a lot of Perl via my actual Perl guru buddy from college, often while on the job!).
Finally, he was put on probation. And then quit, giving 2 weeks notice to go work at some fancy new sure-to-be-successful internet startup company. The 2nd week of his 2 weeks, he called in "sick", while actually having already started at his new job-- at which point our boss just fired him.
Turns out he also invested a bunch of his own money in his new company, because it was SURE to be a great investment. ... BUT ... they went belly up about a year after he joined.
DaveE
Admin
It's a Job... Try one.
If the boss requests a new feature that is unethical, you can put up the penny objections on the ethics grounds, but at the end of the day you're going to either do it or find yourself looking for new work (Right to Work/At-will employment state)
Admin
Admin
I'm not saying it can't be done in Perl, everything can be done in VB I hear --
Admin
It'd be done better in Perl though.
Admin
"Modern Perl" ? Is that the one where they took the concatenation operator '.' and made it mean something completely different ?
Admin
I once read an excellent essay about similarities between modern Internet memes and early 20th century postcards. Unfortunately, I am now unable to find it.
To get the idea, here are some early "lolcats": http://www.onemoreriver.org/11267/11632.html
The 20th century "Dam" meme: http://ephemera.ning.com/photo/the-end-of-the-whole-dam
There were also series of these: http://www.rubylane.com/item/429-col6942/Black-Kids-fighting-for-Nickels Photograph postcards from exotic non-christian locations showing how different and horrible life there was.
You can probably see how those "Nagesh" pictures quite nicely match the last one.
(Also, there were series what you could call "lol-negro-babys". Cartoon postcards of black kids talking broken English and looking silly.)
Admin
In our case, it's when we already have a ton of it, and it works.
But it's also very good for text processing (a part of which you pointed out), acting as a glue language, basic networking stuff (web scraping, Nagios stuff, etc), administration scripts, etc. It's also good when you need to get a lot done fast. But I do agree that unless you're careful, that can lead to the "write-once" pejorative everyone is so fond of throwing around.
Would you use it to write a GUI desktop app? No. Grabbing the output of apache's /server-status and throwing the info into an in-house monitoring app? Sure.
Admin
Conversely, by increasing the sleep to 6, Alvin can now exact his revenge on the upstart n00b by claiming that 'The new guy' flubbed the code and it's now running 15% slower...
Admin
Funny, I remember sync;sync;sync before shutdown now
Word: appellatio verb; to suck off your phone
Admin
You mean, a place where working girls handle the firemen.
word: capio to slow down non-paying customers
Admin
And guess the name of the female singer.
Admin
+1 on the Dvorak comment. It works brilliantly and keeps people from coming to your desk distracting your flow.
But that's just a side-effect. The real reason you should use Dvorak is that typing becomes like a dance. As in, if Qwerty were the hiphop style, Dvorak would be Foxtrot:-)
Admin
+1
I can vouch for the Outsourcing recruiters attitude. cutting costs + increasing profit margins. Whatever gets that done is what gets through.
Admin
Just to add. Nagesh is also a old(think 70s) actor in Tamil(https://en.wikipedia.org/wiki/Nagesh_(actor) movies. He was famous for his comedy antics a lot.
Admin
A bad workman blames his tools, or rather, in this case, a bad workman's colleague blames the tool, and of course, Alex Papadumbass makes it public, adding his own insults, of course.
Admin
Admin
I thought it was one for sorrow, two for joy...?
Admin