• Ozz (unregistered)

    I woulda been Fr1st but I slept on it.

  • (cs)

    Looks like Alvin substituted his own lack of sleep with Perl code...

  • (cs)

    I had the first comment, but I had to sleep five seconds before posting it.

  • Zunesize Me! (unregistered)

    Oh yeah, I remember the days when, after some handling, I would perl all over the place and have to sleep on it... mom always wanted the dry space for herself... now I do the same to my kids, so I guess balance has been brought to the force.

  • Bilbo (unregistered)

    I want to know what wtf behavior was covered up by the sleep(6)!

  • Ellen Foley (unregistered)

    WTF? I gotta know right now!

  • NickS (unregistered)

    They are important.

    Big Budget Meeting

    Beancounter: "Why do you need money for optimization?" Alvin: "If we can make our programs work faster, we can make more money." Beancounter: "Well I expect results!" Alvin: Change sleep(5) to sleep(4) "We've improved efficiency 20%!" Beancounter: "Shut up and take my money!"

  • (cs) in reply to Ellen Foley
    Ellen Foley:
    WTF? I gotta know right now!
    I am pretty sure that the guy just knows that it won't work without those sleep's, in spite of visual proof, and just has to have his way.

    Your basic ass.

  • anon (unregistered) in reply to Bilbo
    Bilbo:
    I want to know what wtf behavior was covered up by the sleep(6)!

    And why Dave's never rolled out change somehow necessitated adding an extra second? Seriously, it sounds like there was at least a mildly amusing WTF here, but it got left out of the article completely. Kinda seems like Remy knew this, since the best "Easy Reader Version" he could come up with was ALLLLVIIIIIIIN!

  • (cs)

    What's a fire handle?

  • bcs (unregistered)

    s/sleep([0-9]*)/sync()/ ??

  • Department of More Money (unregistered)

    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

  • (cs) in reply to NickS
    NickS:
    They are important.

    Big Budget Meeting

    Beancounter: "Why do you need money for optimization?" Alvin: "If we can make our programs work faster, we can make more money." Beancounter: "Well I expect results!" Alvin: Change sleep(5) to sleep(4) "We've improved efficiency 20%!" Beancounter: "Shut up and take my money!"

    We've had The Stare (TM), Remy's cornified the article (sleep there), and your efficiency code essentially makes the process flow 20% cooler.

    I feel deeply satisfied.

  • Yohann (unregistered)

    This time i know!!

    Alvin looks like to be the "perl trainer", when he gets his first trainnee, he showed him a script that, ran across the codebase could add sleep(1) after each close(HANDLE). the he gets the second padawan, who asked why there were sleep(1) and made a script to remove them to prove it was useless... and so on Dave is the fifth padawan to achieve his perl formation i guess

  • Nagesh (unregistered) in reply to Department of More Money
    Department of More Money:
    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

    How dare you admit to write code that is being immoral? http://www.gammadyne.com/ethics.htm

    You're next job will be here. [image]

  • (cs) in reply to snoofle
    snoofle:
    Ellen Foley:
    WTF? I gotta know right now!
    I am pretty sure that the guy just knows that it won't work without those sleep's, in spite of visual proof, and just has to have his way.

    Your basic ass.

    I'm guessing he's far worse than your garden-variety ass. I suspect that he added back the sleeps with an extra second to "prove" that the new guy screwed up and made all the Perl "apps" run slower. Thank goodness Alvin was there to save the day...

  • Man Mountain Dean (unregistered)

    I'd tap that Alvin every day of the week until he gave up in exhaustion, cuz I'm Man Mountain Dean!

  • (cs)

    Best to let sleep()ing dogs lie.

  • (cs) in reply to Nagesh
    Nagesh:
    Department of More Money:
    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

    How dare you admit to write code that is being immoral? http://www.gammadyne.com/ethics.htm

    You're next job will be here. [image]

    As punishment for posting "Nagesh" pictures (generally inaccurate, stupid, inane, and always not funny), I am replacing it with a picutre of Rosie O'Donnell.

  • wonko (unregistered)

    Might be my fault, but I just don't get it. What's the point of this story? The veteran is always right, even when he's wrong?

  • (cs)
    #after writing a bunch of stuff to a file
    "You have to love languages that require at least two keystrokes to make a comment." -Some VB programmer
  • dguthurts (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    snoofle:
    Ellen Foley:
    WTF? I gotta know right now!
    I am pretty sure that the guy just knows that it won't work without those sleep's, in spite of visual proof, and just has to have his way.

    Your basic ass.

    I'm guessing he's far worse than your garden-variety ass. I suspect that he added back the sleeps with an extra second to "prove" that the new guy screwed up and made all the Perl "apps" run slower. Thank goodness Alvin was there to save the day...

    And the new guy could always point to CVS to say "ALLLLLLLLLLLVIIIIIIIIIIN!"

  • Mihai Limbasan (unregistered) in reply to snoofle

    Ellen was parodying Meat Loaf's song "Paradise by the Dashboard Light", where part of the dialogue runs along the lines of

    Girl: "Will you love me forever?"

    Boy: "Oh baby, baby, let me sleep on it"

    Girl: "I gotta know right now!"

  • Mark (unregistered)

    This one really is more of a "wtf" than usual. Typically when we see bad code we can understand what the schmuck was getting at or trying to accomplish. As stated above, this guy is just your garden-variety ass, and we'll never truly understand his motivation.

  • (cs) in reply to bcs
    bcs:
    s/sleep([0-9]*)/sync()/ ??

    You need to escape your parentheses.

    Or maybe you did, and the comment system ate it.

  • Froggy (unregistered) in reply to Mark

    That's just the most frustrating DailyWTF ever...

  • (cs) in reply to Department of More Money
    Department of More Money:
    dial setting that we had on the framework that we could set from 0 to 1000.

    Brillant! Punish the customer by making them think your service is shittier than it is, while also consuming a slightly greater amount of your resources!

  • (cs) in reply to bcs
    bcs:
    s/sleep([0-9]*)/sync()/ ??
    Hint: parentheses are special characters in regular expressions.
  • McKay (unregistered) in reply to Nagesh
    Nagesh:
    Department of More Money:
    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

    How dare you admit to write code that is being immoral? http://www.gammadyne.com/ethics.htm

    You're next job will be here. { image }

    No, it's not a violation of a code of ethics to decrease performance for non-paying customers. They're not trying to be awesome by improving performance later, they're punishing customers who haven't been paying the bill. They would be fully ethical in turning off the service all together. Just making it slow is being nice.

  • Chelloveck (unregistered) in reply to Mark
    Mark:
    This one really is more of a "wtf" than usual. Typically when we see bad code we can understand what the schmuck was getting at or trying to accomplish. As stated above, this guy is just your garden-variety ass, and we'll never truly understand his motivation.

    Oh, I'm sure there was someplace where buffered file I/O was biting them, and the sleep() allowed time to finish the write. Probably once Dave went home, Alvin stumbled back upon that case and added all the sleeps back, with an extra second "just in case". Someone needs to whack him upside the head with the man page (or perldoc page) for sync().

    And "been using Perl since version 4"? Frickin' n00b.

  • Nagesh (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    Nagesh:
    Department of More Money:
    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

    How dare you admit to write code that is being immoral? http://www.gammadyne.com/ethics.htm

    You're next job will be here. [image]

    As punishment for posting "Nagesh" pictures (generally inaccurate, stupid, inane, and always not funny), I am replacing it with a picutre of Rosie O'Donnellugly photoshoped man.

    Read #6.

    Higher quality is reason India is ading job and US is losing them.

  • BOFH (unregistered)

    What version of perl do you have, that has a sync() function?

  • (cs) in reply to Chelloveck

    Man, I'm glad somebody caught that.

  • onitake (unregistered) in reply to frits
    frits:
    "You have to love languages that require at least two keystrokes to make a comment." -Some VB programmer
    Looks like someone has never worked with a non-US keyboard. :)
  • (cs) in reply to BOFH
    BOFH:
    What version of perl do you have, that has a sync() function?
    I haven't written a line of Perl in years, but can't you shell out to call sync()?
  • (cs) in reply to pjt33
    pjt33:
    What's a fire handle?
    You can't expect Remy to waste time on proofreading. He's got easter eggs to bury, dammit!
  • (cs)

    He needed the extra second of sleep() to allow time for the cargo plane to land.

  • Andy (unregistered)

    AFAIK the Linux kernel has had a 5 second period where it wrote back the whole caches. This wasn't guaranteed but usually worked. Of course this is very bad coding style and a fsync() or sync() call should be used, but it probably worked most of the time.

  • (cs) in reply to Chelloveck
    Chelloveck:
    And "been using Perl since version 4"? Frickin' n00b.
    Wait, you mean there's a newer version?
  • Captain Oblibious (unregistered) in reply to Gazzonyx

    I'm pretty sure the reason he increased the sleep from 5 to 6 was so he could say the new guy was making the script slower and to have an excuse to keep the new guy away from it and prevent the new guy from having any more opportunities to make him look bad.

  • Earl Colby Pottinger (unregistered)

    First, I am glad to see that the new guy insisted on testing his changes before assuming he knew a better way to write the code.

    Too often people try to prove they have a better way and want others to use without finding out if there is a real valid reason why the code is written the way it was.

    However, I am writing some kernel code for an OS still in alpha-state (Haiku-OS) and I find if I write a number of larger files (16MB+) in a row that the files end up corrupting each other.

    Use of SYNC() does not fix the problem. Use of SLEEP(9999) does. Use of SLEEP(999) usually does but on rare occasions the corruption still happens. Note SLEEP() is in microseconds.

    Bet the environment has changed and in the past the sleep function was needed, but now things have changed the old-timer is sticking to the "old and true" despite tests showing it is no longer needed.

  • Spider Flyer (unregistered) in reply to Gazzonyx
    Gazzonyx:
    BOFH:
    What version of perl do you have, that has a sync() function?
    I haven't written a line of Perl in years, but can't you shell out to call sync()?

    This is PERL, there's a module for anything!

    http://search.cpan.org/~brianski/File-Sync-0.11/Sync.pm

  • (cs) in reply to dguthurts
    dguthurts:
    C-Octothorpe:
    snoofle:
    Ellen Foley:
    WTF? I gotta know right now!
    I am pretty sure that the guy just knows that it won't work without those sleep's, in spite of visual proof, and just has to have his way.

    Your basic ass.

    I'm guessing he's far worse than your garden-variety ass. I suspect that he added back the sleeps with an extra second to "prove" that the new guy screwed up and made all the Perl "apps" run slower. Thank goodness Alvin was there to save the day...

    And the new guy could always point to CVS to say "ALLLLLLLLLLLVIIIIIIIIIIN!"

    That's cute. So you really think that Alvin's PHB will understand or care what CVS has to say or that he would take the word of "the new guy" over his tenured Perl "guru"?

  • josefx (unregistered)

    AFAIK there are two reasons to believe this.

    1. He mixed up socket and file handling, at least windows "locks" sockets for some time after they are closed to avoid stray packages.

    2. They use some broken maleware scanner which would check the files after they where changed (blocking access while doing so), leading to an error if the program tried to access the file again at the same time.

  • jverd (unregistered) in reply to McKay
    McKay:
    Nagesh:
    Department of More Money:
    At a previous job we had a dial setting that we had on the framework that we could set from 0 to 1000. As a client got further and further behind on their service bills we recieved change requests to the effect of "Increase IncompeTech's dis-service factor by 10 points" The disservice factor represented how many miliseconds after significant portions of code (Database query, Input Processing, Page rendering) we waited before moving on to the next step. This might not have been bad for some applications, but on some pages you were waiting upwards of 20 seconds on dissatisfaction time to get your page.

    Needless to say, no client ever hit the magic 1000 (We usually discontinued service before that point)

    How dare you admit to write code that is being immoral? http://www.gammadyne.com/ethics.htm

    You're next job will be here. { image }

    No, it's not a violation of a code of ethics to decrease performance for non-paying customers. They're not trying to be awesome by improving performance later, they're punishing customers who haven't been paying the bill. They would be fully ethical in turning off the service all together. Just making it slow is being nice.

    That depends on whether your TOS informs them that you will be decreasing their QOS in that manner for non-payment. If so, dial away. But if not, then it's nothing but pissy, immmature, passive-aggressive bullshit, and probably illegal too.

  • mystery meat (unregistered) in reply to Earl Colby Pottinger

    Try sync(); sync();

    On some systems, the sync() system call is non-blocking, but also non-reentrant, so the way to ensure that all i/o is complete is to call sync() twice.

  • SomeCoder (unregistered) in reply to Nagesh
    Nagesh:
    Read #6.

    Higher quality is reason India is ading job and US is losing them.

    Hahahahahahaha!

    As someone who deals with outsourcing in India on a daily basis, this is hilarious; thanks for the laugh :) The reason India is adding jobs and the US is losing them isn't because of quality. It is happening because you pay literally pennies on the dollar for Indian engineers to crap out some code that is brittle, hard to use, and only sort of works.

    Indian engineers that know what they are doing come to America where they can make actual money. I've worked with lots of intelligent people like this. But I've never worked with any outsourced "talent" that could pass Programming 101. The old saying "you get what you pay for" is especially true in this case.

  • Uncle Al (unregistered) in reply to mystery meat
    mystery meat:
    Try sync(); sync();

    On some systems, the sync() system call is non-blocking, but also non-reentrant, so the way to ensure that all i/o is complete is to call sync() twice.

    Look, a future Daily WTF article!

  • rfoxmich (unregistered)

    TRWTF is Perl

  • TheJonB (unregistered) in reply to Spider Flyer
    Spider Flyer:
    Gazzonyx:
    BOFH:
    What version of perl do you have, that has a sync() function?
    I haven't written a line of Perl in years, but can't you shell out to call sync()?

    This is PERL, there's a module for anything!

    http://search.cpan.org/~brianski/File-Sync-0.11/Sync.pm

    Civilised perlmongers use FileHandle anwyay, which also has sync.

Leave a comment on “Let Me Sleep on It”

Log In or post as a guest

Replying to comment #:

« Return to Article