• Tod (unregistered)

    Is TRWTF that the code for the popup text and the popup text don't match?

  • Ouch! (unregistered)

    I tied to think of something witty, but all I could think was "Why?".

  • Gary (unregistered)

    No. I was not here.

  • Simon Buchan (unregistered)

    TRWTF is DialogBox(), and event-driven programming in the first place (Am I doing it right? Oh yeah, Frist!).

  • An Old Hacker (unregistered) in reply to Tod
    Tod:
    Is TRWTF that the code for the popup text and the popup text don't match?

    No, it's that, after realizing that their first guess was wrong, that it was replaced with a second guess.

  • Paul (unregistered)

    MessageBoxEx allows you to put a timeout on the messagebox, yes?

    After that time passes, zap and the default button is pressed.

    Sorted.

  • SR (unregistered)

    I like it. The "No" button provides interraction for the sarcastic.

  • (cs)

    *** on feel the noize.

    Addendum (2010-10-11 11:36): (That might not make sense outside of the UK...)

  • Son of the Dancing Pigeon (unregistered)

    Why haven't they provided a 'File Not Found' button on the popup?

  • tom103 (unregistered) in reply to Paul

    C# with Java-like naming conventions, yuck...

    Paul:
    MessageBoxEx allows you to put a timeout on the messagebox, yes?
    No it doesn't...
  • Mr Gangreen (unregistered)

    I don't really see another option except for creating a non-modal dialog with built-in timeout since there is no easy way of doing this.

    Right?

  • Anon (unregistered)

    It would be handy if the .NET libraries included a timing out MessageBox as well as a "don't show this again" variant. They are not hard to implement yourself, but it can be a pain to get it look and behave exactly like the regular MessageBox (except for the timeout). Never understood why MessageBox is sealed.

  • (cs)

    No related, but it reminds me of the AmigaDOS command 'why'.

    If you typed in a command and you got an error message, you could ask AmigaDOS why it failed. It was like an expression of desperation that you get when working with computers, although I don't believe the syntax 'Why? Why? WHY?!' was supported.

  • (cs)

    Slade's colleague ...

    Great, now I've got visions of a development team staffed by members of a 1970's glam rock outfit.

    http://en.wikipedia.org/wiki/Slade_%28band%29

    Oh, and Akismet sucks donkey balls.

  • (cs)

    Dear sir,

    I am writing to express that I do not wish to post a comment.

    Thank you.

  • Vlbuttic Pickles (unregistered)

    TRWTF is use of var.

  • Anonymous (unregistered)

    I hate it when this happens. The first revision comes along and you think to yourself "maybe he's just a having a slow morning" or "the requirements could have been clearer". So you explain it again nice and slowly, make a few simplistic analogies and set them on their way again. Then the second revision comes around and it finally hits home; you're working with a dribbling simpleton. Talking slowly is not going to cut it - in fact, you may start to wonder if verbal communication is even a viable option.

    I would be disappointed with the first revision, especially since the original coder seems to have no concept of proper thread handling (I have no doubt that While loop was on the main GUI thread - so say goodbye to message pumping, since he didn't bother to call Application.DoEvents()). But after the second revision I'd start packing up the desk - either his or mine, whatever it takes.

  • (cs) in reply to Severity One
    Severity One:
    No related, but it reminds me of the AmigaDOS command 'why'.

    If you typed in a command and you got an error message, you could ask AmigaDOS why it failed. It was like an expression of desperation that you get when working with computers, although I don't believe the syntax 'Why? Why? WHY?!' was supported.

    I never used it, but I read a review of an early version of Mathematica, and it apparently would beep if something went wrong, with no further explanation; you needed to go to a menu option (I think it was called "Why the beep?") to find out.

    If some other application had beeped, it would smugly say "Mathematica hasn't beeped".

  • Anonymous (unregistered) in reply to Vlbuttic Pickles
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
  • uuang (unregistered)

    I got stuck on the 2 minutes part.

  • airdrik (unregistered)

    I tried posting a comment, but since it took longer than 2 minutes to type, it erased it anyway.

  • (cs)

    At least he was smart enough not to put the lastMouseActivity check after the dialog, which is what I expected he'd do.

    But I suppose he's not done yet; there's always the next version.

  • Brazen (unregistered)

    What if the user is still at the computer but are done with the application? They could hit "No" to get rid of the prompt and go ahead and log them out.

    If it only had a 'Yes' button, they could just ignore the prompt for 30 seconds, but if they are OCD like me, I'd have to hit yes, then log myself out manually so it didn't keep bugging me.

  • (cs) in reply to Anonymous
    Anonymous:
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
    VB's equivalent of var is identical to C#'s and it is strongly typed. You are thinking of the old VB6 Variant data type that was removed from VB.Net ten years ago.

    http://stackoverflow.com/questions/1946693/what-is-the-vb-net-equivalent-of-the-c-var-keyword

    It bothers me that people keep using VB6 as a strawman to talk down VB.Net.

  • Brazen (unregistered)

    Maybe to make you all feel better, the prompt could say "You will be logged out in 30 seconds. | Logout Now | Stay Logged In |"

    TRWTF is that the submitter needs to ask WHY the prompt was coded that way.

  • (cs)

    TRWTF is that "30 seconds" in the code somehow becomes "2 minutes" in the dialogue box.

    This data's been tampered with!

  • Em Bedded (unregistered)

    No, TRWTF is that this wouldn't work on embedded systems because there is no room for a file system.

    (BTW, where's the original story for this meme?)

  • (cs) in reply to Em Bedded
    Em Bedded:
    BTW, where's the original story for this meme?

    You probably mean http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

  • The Nerve (unregistered)

    Fixed?

    //while(true)
    //{
    //    if (DateTime.Now > lastMouseActivity.AddMinutes(5))
    //    {
    //        doLogoff();
    //        showTimeout();
    //    }
    //    Thread.Sleep(100);
    //}

    Seriously...why does this even need to be implemented when you can lock your terminal automatically via screensaver?

  • Anonymous (unregistered) in reply to Jaime
    Jaime:
    Anonymous:
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
    VB's equivalent of var is identical to C#'s and it is strongly typed. You are thinking of the old VB6 Variant data type that was removed from VB.Net ten years ago.

    http://stackoverflow.com/questions/1946693/what-is-the-vb-net-equivalent-of-the-c-var-keyword

    It bothers me that people keep using VB6 as a strawman to talk down VB.Net.

    What the hell are you talking about? I never said "VB.NET", I said "VB". If I meant "VB.NET" I would have said "VB.NET". You have the cheek to talk about a straw man argument when you're doing exactly that - completely misrepresenting my original point. Learn to read or better yet just shut up since we all know your comments are usually complete rubbish.

  • Steve (unregistered) in reply to Em Bedded
    Em Bedded:
    No, TRWTF is that this wouldn't work on embedded systems because there is no room for a file system.

    (BTW, where's the original story for this meme?)

    The original story that started the "embedded system" nonsense is this one: http://thedailywtf.com/articles/The-cbitmap.aspx. Read the comments.

  • Mood WestWatt (unregistered) in reply to Shortjob
    Shortjob:
    Em Bedded:
    BTW, where's the original story for this meme?

    You probably mean http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

    Does he? IS that true, false or FileNotFound?

    http://thedailywtf.com/Comments/Stoned!.aspx#319693 is the first mention to what would soon become another TDWTF meme. Incidentally, this is the one the OP was asking for.

  • Mood WestWatt (unregistered) in reply to Steve
    Steve:
    Em Bedded:
    No, TRWTF is that this wouldn't work on embedded systems because there is no room for a file system.

    (BTW, where's the original story for this meme?)

    The original story that started the "embedded system" nonsense is this one: http://thedailywtf.com/articles/The-cbitmap.aspx. Read the comments.
    Whooops, I stand corrected.

  • (cs)

    The other day a friend of mine came into work and heard a very strange thrubbity-drumming sort of noise coming from one of the offices. He went to investigate, and found a desk fan, case removed, head-down in a plastic waste-paper bin, along with a mouse attached to a laptop on the desk next to it. Every time the fan rotated, it was smacking the shit out of the (optical) mouse and sending it ricocheting round the bucket, causing the noise. The laptop was displaying the end-screen from a full virus scan.

    Turned out, on interrogation of the user responsible, that they wanted to run a full virus scan, but noticed that their laptop powered itself off if inactive for more than 20 minutes. Solution: make sure the mouse moves plenty.

    The real WTF here is that the user's IT support contract is set up in such a way that having an IT tech change the power-saving settings would have 'cost' more than the new mouse that was required. Amazingly enough, the mouse still worked, but it was retired with full honours due to extensive scarring.

  • (cs) in reply to Shortjob
    Shortjob:
    Em Bedded:
    BTW, where's the original story for this meme?

    You probably mean http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

    I don't think so. How is that related to embedded systems?

  • (cs) in reply to The Nerve
    The Nerve:
    Fixed?
    //while(true)
    //{
    //    if (DateTime.Now > lastMouseActivity.AddMinutes(5))
    //    {
    //        doLogoff();
    //        showTimeout();
    //    }
    //    Thread.Sleep(100);
    //}
    Seriously...why does this even need to be implemented when you can lock your terminal automatically via screensaver?

    -1 for reading comprehension

    "This was an important feature, as the application was responsible for divvying up time-sensitive data analysis work."

  • DC (unregistered) in reply to davedavenotdavemaybedave
    davedavenotdavemaybedave:
    Turned out, on interrogation of the user responsible, that they wanted to run a full virus scan, but noticed that their laptop powered itself off if inactive for more than 20 minutes. Solution: make sure the mouse moves plenty.

    I saw a cute solution for this on a tech site the other day - place the mouse on an analogue watch The movement of the hands causes the cursor to move slightly.

    Of course the downside is someone would pinch the watch, and who wears a watch these days anyway?

  • airdrik (unregistered) in reply to The Nerve
    The Nerve:
    Fixed?
    //while(true)
    //{
    //    if (DateTime.Now > lastMouseActivity.AddMinutes(5))
    //    {
    //        doLogoff();
    //        showTimeout();
    //    }
    //    Thread.Sleep(100);
    //}
    Seriously...why does this even need to be implemented when you can lock your terminal automatically via screensaver?

    Because it isn't just about locking your screen, it's about redistributing the work - when one user leaves, their unfinished work is passed on to another user.

    The problem with the messagebox-based solution is that if a user leaves for 3 hours without logging out (not-as-short-as-anticipated meeting before lunch, followed by another long meeting), the message box sits there for the 3 hours until the user comes back to click on it, and only then (when that user expects to be logging back in) does it finally log the user out and send their work to another user (which may be a big issue if that particular analysis was due by noon and is now 2 hours late).

  • Martin (unregistered)

    What is the problem with this code?

    It might not be elegant, but it says that MessageBox.Show halts the program (that is, this code probably exists in the UI thread of the main window) and so the user cannot do anything while the MessageBox is shown? Unless, of course, not logging off immediately causes problems on the server, I don't see the WTF?

  • (cs) in reply to The Enterpriser
    The Enterpriser:
    Shortjob:
    Em Bedded:
    BTW, where's the original story for this meme?

    You probably mean http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

    I don't think so. How is that related to embedded systems?

    Reading on, neither do I. I thought he was referring to the file-not-found jokes earlier on.

  • (cs) in reply to Anon
    Anon:
    Never understood why MessageBox is sealed.

    Because it's a Microsoft product. Why is anyone still surprised when they get the details wrong?

  • (cs) in reply to Anonymous
    Anonymous:
    Jaime:
    Anonymous:
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
    VB's equivalent of var is identical to C#'s and it is strongly typed. You are thinking of the old VB6 Variant data type that was removed from VB.Net ten years ago.

    http://stackoverflow.com/questions/1946693/what-is-the-vb-net-equivalent-of-the-c-var-keyword

    It bothers me that people keep using VB6 as a strawman to talk down VB.Net.

    What the hell are you talking about? I never said "VB.NET", I said "VB". If I meant "VB.NET" I would have said "VB.NET". You have the cheek to talk about a straw man argument when you're doing exactly that - completely misrepresenting my original point. Learn to read or better yet just shut up since we all know your comments are usually complete rubbish.

    VB.NET is essentially a newer version of VB. Also, you compared it to C#, which has VB.NET as its contemporary (not VB).

    In other words, the context implied you were talking about VB.NET.

  • PS (unregistered)

    And I never understood why anyone would consider interrupting the user with a completely pointless, modal dialog box every 5 minutes good UI design.

    I think this story clearly shows why programmers should be kept away from the UI at all costs. Even if it involves bodily harm.

  • (cs) in reply to Anonymous
    Anonymous:
    Jaime:
    Anonymous:
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
    VB's equivalent of var is identical to C#'s and it is strongly typed. You are thinking of the old VB6 Variant data type that was removed from VB.Net ten years ago.

    http://stackoverflow.com/questions/1946693/what-is-the-vb-net-equivalent-of-the-c-var-keyword

    It bothers me that people keep using VB6 as a strawman to talk down VB.Net.

    What the hell are you talking about? I never said "VB.NET", I said "VB". If I meant "VB.NET" I would have said "VB.NET". You have the cheek to talk about a straw man argument when you're doing exactly that - completely misrepresenting my original point. Learn to read or better yet just shut up since we all know your comments are usually complete rubbish.
    VB.Net is the current version of VB. If you want to talk smack about VB6 without getting VB.Net involved, it's up to you to clarify that your comment is only directed at older versions of the language by referring to it as VB6 instead of VB. Since you didn't, I made sure it was pointed out.

    BTW, if you want to say the my comments are usually complete rubbish, do it while logged in. I stand by most of what I said in the linked post, even though I made a technical error. The person I was responding to made a bold claim that any command prompt access on a workstation on a NetWare network would automatically lead to system compromise. He backed up that claim with an anecdote that he had accidentally NET SENDed a message to the wrong person. That deserved a harsh response.

  • (cs) in reply to davedavenotdavemaybedave
    davedavenotdavemaybedave:
    The real WTF here is that the user's IT support contract is set up in such a way that having an IT tech change the power-saving settings would have 'cost' more than the new mouse that was required. Amazingly enough, the mouse still worked, but it was retired with full honours due to extensive scarring.
    TRWTF is an antivirus that doesn't know to call SetThreadExecutionState(ES_SYSTEM_REQUIRED) every now and then (or with ES_CONTINUOUS).
  • (cs) in reply to Martin
    Martin:
    What is the problem with this code?

    It might not be elegant, but it says that MessageBox.Show halts the program (that is, this code probably exists in the UI thread of the main window) and so the user cannot do anything while the MessageBox is shown? Unless, of course, not logging off immediately causes problems on the server, I don't see the WTF?

    Srsly?

    Intent: if user clicks 'No', they're logged off immediately, if user clicks 'Yes', they're left logged in, and if user does not click anything within 30 seconds, they're logged off at that time.

    Actual: if user clicks 'No', they're logged off immediately, if user clicks 'Yes' within 30 seconds, they're left logged in, if user clicks 'Yes' after 30 seconds, they're immediately logged off (gotcha!!), and if user does not click anything, the program leaves them logged in indefinitely waiting for a click. Neither of the last two options meets the requirements for this module, obviously ...

    And evidently, the situation of the user being logged in indefinitely does cause problems with this particular program--that's why the module was being written in the first place. It's possible that TRWTF is that the main process can't cope with idle users, I don't know. But that doesn't excuse incompetent execution of the requested workaround.

  • Anonymous (unregistered) in reply to Jaime
    Jaime:
    Anonymous:
    Jaime:
    Anonymous:
    Vlbuttic Pickles:
    TRWTF is use of var.
    I agree that it's pointless to use an implicitly typed local variable for a type that is known but I hardly think it is "TRWTF"; if that's what you want to use there are no strong arguments to say you shouldn't. Remember that the var keyword is perfectly legitimate in C# since the variable that it wraps is still strongly typed - unlike languages such as VB where "var" represents a weakly typed variable. We all know that weak typing is bad but there is no such argument against implicit strong typing. As long as you know the type at compile time it really doesn't matter whether you explicitly declared it or implicitly declared it.
    VB's equivalent of var is identical to C#'s and it is strongly typed. You are thinking of the old VB6 Variant data type that was removed from VB.Net ten years ago.

    http://stackoverflow.com/questions/1946693/what-is-the-vb-net-equivalent-of-the-c-var-keyword

    It bothers me that people keep using VB6 as a strawman to talk down VB.Net.

    What the hell are you talking about? I never said "VB.NET", I said "VB". If I meant "VB.NET" I would have said "VB.NET". You have the cheek to talk about a straw man argument when you're doing exactly that - completely misrepresenting my original point. Learn to read or better yet just shut up since we all know your comments are usually complete rubbish.
    VB.Net is the current version of VB. If you want to talk smack about VB6 without getting VB.Net involved, it's up to you to clarify that your comment is only directed at older versions of the language by referring to it as VB6 instead of VB. Since you didn't, I made sure it was pointed out.

    BTW, if you want to say the my comments are usually complete rubbish, do it while logged in. I stand by most of what I said in the linked post, even though I made a technical error. The person I was responding to made a bold claim that any command prompt access on a workstation on a NetWare network would automatically lead to system compromise. He backed up that claim with an anecdote that he had accidentally NET SENDed a message to the wrong person. That deserved a harsh response.

    Honestly I don't care, it's nothing to do with me, it was just a recent example of you spouting bullshit about something you don't understand (complete with a citation that doesn't even support your argument). Another thing you don't seem to understand is that VB.NET != VB. I'm not debating this with you, it's a plain fact.

  • (cs) in reply to airdrik
    airdrik:
    The Nerve:
    Fixed?
    //while(true)
    //{
    //    if (DateTime.Now > lastMouseActivity.AddMinutes(5))
    //    {
    //        doLogoff();
    //        showTimeout();
    //    }
    //    Thread.Sleep(100);
    //}
    Seriously...why does this even need to be implemented when you can lock your terminal automatically via screensaver?

    Because it isn't just about locking your screen, it's about redistributing the work - when one user leaves, their unfinished work is passed on to another user. ...

    There is an event fired when the screensaver kicks in. I use it to set the away status of the user in the phone system in one of the application I maintain.

  • I R Weasel (unregistered) in reply to Jaime
    Jaime:
    VB.Net is the current version of VB. If you want to talk smack about VB6 without getting VB.Net involved, it's up to you to clarify that your comment is only directed at older versions of the language by referring to it as VB6 instead of VB. Since you didn't, I made sure it was pointed out.

    BTW, if you want to say the my comments are usually complete rubbish, do it while logged in. I stand by most of what I said in the linked post, even though I made a technical error. The person I was responding to made a bold claim that any command prompt access on a workstation on a NetWare network would automatically lead to system compromise. He backed up that claim with an anecdote that he had accidentally NET SENDed a message to the wrong person. That deserved a harsh response.

    MPS, is that you?

  • Franz Kafka (unregistered) in reply to powerlord
    powerlord:
    VB.NET is essentially a newer version of VB. Also, you compared it to C#, which has VB.NET as its contemporary (not VB).

    In other words, the context implied you were talking about VB.NET.

    No, VB.Net is essentially a completely different product with similar syntax. VB generally means VB6, especially when paired with screeds about its insanity, while VB.Net is simply another CLR language with uglier syntax.

Leave a comment on “The Why Timeout”

Log In or post as a guest

Replying to comment #:

« Return to Article