• Invevitably (unregistered)

    In all the efforts I've seen to intentionally mangle code to secure your position as the "only developer who knows how to handle this program", the developer in particular who mangled the code is shown the way out eventually and the new coders manage to un-mangle things over time without issue.

    Bottom line, don't do it do you really want to be known as "that guy who could have only intentionally mangled that code."

  • Wonko_The_Sane (unregistered)

    shook his frist?

    ...

    Sorry

  • Frist Boy (unregistered)

    Why can't I be Frist?

  • roffles (unregistered)

    i lost it at hunter2

    captcha: duis you duis for me, you be a made man

  • Kanthos (unregistered)

    Love the reference to this in the password box.

  • (cs)

    Lyin', instantiatin', overloadin' that's all you seem to do.
    Messin' around every function in town...

    C'MON EVERYBODY!

    Your time is gonna come.

  • (cs)

    Uh, Mark, you forgot to include the line where it actually says he got fired.

  • mo (unregistered)

    hunter2? I think Gary had help form the IRC to write the code.

  • (cs)
    First being…pointing out how much of a genius he is! ... Second...he was irreplaceable.

    Management, on the other hand, disagreed...

    Really? You mean the system worked?

    I've seen people do this before, but usually management buys into the bullshit. Every 6 months they claim to be getting offers elsewhere so that management will give them a pay increase to stay.

    Semi-off-topic: I actually had to game the system like this once. My boss wanted to increase my pay to match that of same-titled developers on another team, but the budget office refused to budge (no pun intended... well, maybe some). The other team had new hires and open positions at 20% more than my salary.

    So my boss ordered me to apply for a job with them. When I got an offer he complained to the budget office about losing me, that I was irreplaceable, and it was enough to secure a pay increase. The other team wasn't very happy with him after that.

    Aren't office politics fun?

  • (cs) in reply to boog
    boog:
    First being…pointing out how much of a genius he is! ... Second...he was irreplaceable.

    Management, on the other hand, disagreed...

    Really? You mean the system worked?

    I've seen people do this before, but usually management buys into the bullshit. Every 6 months they claim to be getting offers elsewhere so that management will give them a pay increase to stay.

    Semi-off-topic: I actually had to game the system like this once. My boss wanted to increase my pay to match that of same-titled developers on another team, but the budget office refused to budge (no pun intended... well, maybe some). The other team had new hires and open positions at 20% more than my salary.

    So my boss ordered me to apply for a job with them. When I got an offer he complained to the budget office about losing me, that I was irreplaceable, and it was enough to secure a pay increase. The other team wasn't very happy with him after that.

    Aren't office politics fun?

    You win the Internet today. :D

  • aepryus (unregistered)

    I really don't understand the WTF. Obviously, posting the same method every where is a WTF, but the method itself appears to be just boot strapping a configuration file.

  • Larry (unregistered)

    TRWTF is headless environments.

  • (cs) in reply to aepryus

    Yeah, maybe I'm being stupid, but doesn't this just write the string "https://initech-global.com/scripts/mc.exe/scrip.w\masvr8b\share\scrip,adiamond,hunter2,False" to some file?

    Is the WTF that he put a backdoor on their webserver?

  • (cs) in reply to aepryus
    aepryus:
    I really don't understand the WTF. Obviously, posting the same method every where is a WTF, but the method itself appears to be just boot strapping a configuration file.
    I'm wondering if the problem is anything like this. Since the failing jobs just hang, with nothing in the logs.

    This line in particular might be relevant:

    Alex Papadimoulis:
    ...modal dialogs aren't a very good way to convey error messages.
  • (cs)

    I'm not quite following the story or the WTF here. I mean, I see the obvious ones -- code replication, open password everywhere, communicating login info through writing and reading a file in the same process, VB -- but the failure itself is unexplained. Was the failure due to the missing file being needed by one of the classes which hadn't been coded with the file write? Was the failure due to the duplicated code being executed more than once at the same time, causing a write exception? Or did the process hang because it popped up a message box on a server with no terminal? Maybe that's why "unattended" is used in the title and final sentence with no other context.

  • (cs)

    The WTF is that there's a modal dialog box in an unattended server-side process, hanging the process cos there's nobody to click OK.

  • bjeeb (unregistered)

    Unattended services should not require user intervention to click an 'OK' button.

  • (cs)

    I thought it was pretty obvious that the WTF is the dialog box in server code.

  • (cs) in reply to ThePants999
    ThePants999:
    The WTF is that there's a modal dialog box in an unattended server-side process, hanging the process cos there's nobody to click OK.
    Gary was irreplaceable, apparently because nobody else could click "OK" in a confirmation box quite like he could.
  • Mark (unregistered)

    The WTF here for those who seem to not be getting it is that he's opening up a modal dialog box from an unattended location, so no one can click "ok" and have the process continue. So it just hangs there waiting for someone to press ok.

  • Jim (unregistered) in reply to Mark

    I thought that the WTF was that he'd hardcoded his username, which got disabled when he was fired ...

  • Mike D. (unregistered) in reply to Wonko_The_Sane
    Wonko_The_Sane:
    shook his frist?

    ...

    Sorry

    ... No, you are not.

  • no name (unregistered) in reply to Invevitably
    Invevitably:
    In all the efforts I've seen to intentionally mangle code to secure your position as the "only developer who knows how to handle this program", the developer in particular who mangled the code is shown the way out eventually and the new coders manage to un-mangle things over time without issue.

    Bottom line, don't do it do you really want to be known as "that guy who could have only intentionally mangled that code."

    Upvoting this. Where I work, a disgruntled developer snuck some code in that deliberately disabled a critical interface some weeks after he had left (having first taken the precaution of "losing" the source code in a "hard disk failure").

    It took me one day to re-write from scratch, and less than a weekend of disassembling to prove that it was a deliberate criminal act...

  • (cs)

    Amateur hour. I've worked with at least half a dozen people more irreplaceable than that. Last one was a woman whose favorite trick was playing the shell game with the temporary files generated by the accounting system. She was convinced we'd hire her back in a week, but it only took me 4 days to rip out her crap.

    The worst thing about that kind of person, is that they honestly believe their self-hype. The best thing is that removing their obfuscating crap almost always makes the system fly which makes you look like a hero.

  • Lance (unregistered) in reply to jpers36

    I thought the idea was that since they fired him, the company would have revoked access and changed his passwords so the password hardcoded in his script would fail and the job would die.

  • I can't see it (unregistered) in reply to roffles
    roffles:
    i lost it at *******

    captcha: duis you duis for me, you be a made man

    SW.Write("adiamond,") SW.Write("*******,") SW.Write("False")

    here?

  • (cs)

    The TRWTF is VB. I mean, it's ugly as hell. At least it took me seconds to see the WTF even when I haven't read VB code in over 15 years. BTW, how did this job worked in the first place? Did he have a remote desktop to each server all the time? Good point for having management buy you four monitors.

  • (cs) in reply to Lance
    Lance:
    I thought the idea was that since they fired him, the company would have revoked access and changed his passwords so the password hardcoded in his script would fail and the job would die.
    That's certainly possible, if the code ever gets to that point. Before it does, however, someone needs to click "OK".
  • (cs)

    “genius developer extraordinaire” + VB = XD

  • empir (unregistered) in reply to ubersoldat
    ubersoldat:
    The TRWTF is VB. I mean, it's ugly as hell. At least it took me seconds to see the WTF even when I haven't read VB code in over 15 years. BTW, how did this job worked in the first place? Did he have a remote desktop to each server all the time? Good point for having management buy you four monitors.

    If you haven't read VB code in the year, then you obviously don't read TDWTF.

    Captcha: plaga, or the Spanish word for the plague that VB is on the world.

  • proofreadplease (unregistered) in reply to roffles
    Management, on the other hand, disagreed with Gary’s self-assessment. Despite his bragging and grandstanding, Gary still had trouble meeting deadlines and following functional specs (being a jerk also helped with the decision too).

    Which decision? To have vanilla icecream instead of triple choc at the next staff party? To buy Gary a new pair of football boots with the social club's yearly takings? I'm hanging on this.. which decision is this referencing?

    I can only assume that Gary got sick of waiting on management's decision and quit his job for a much better paying one where his services were appreciated.

  • Rob (unregistered)

    Anything that goes into the codebase, particularly if you have any sort of source control is going to be an easy fix. And, it makes it pretty easy to cross the line into 'criminal behavior'.

    It is way better to have a series of important, complex, tasks that you've automated in a tiny sandbox that you schedule to run every day/week/whatever.

    When you leave, a lot of things will simply 'not happen'. Which is different than you inserting code that 'happens, badly'. And, it's impossible to revert your changes, because there weren't any changes.

    I didn't do this intentionally, but when I left my first job (on good terms, but short notice) I'd get calls about failed jobs (I was still listed as the contact) for several weeks; until I finally just said, 'Look, don't call me anymore'. If someone wanted to do this, on purpose, they could.

  • backForMore (unregistered)

    Everybody who says that they don't know what the WTF is RTRWTFs! Please put your keyboard away and make my hmburger now and I want a liter of Cola.

  • by (unregistered) in reply to Rob
    Rob:
    Anything that goes into the codebase, particularly if you have any sort of source control is going to be an easy fix. And, it makes it pretty easy to cross the line into 'criminal behavior'.

    It is way better to have a series of important, complex, tasks that you've automated in a tiny sandbox that you schedule to run every day/week/whatever.

    When you leave, a lot of things will simply 'not happen'. Which is different than you inserting code that 'happens, badly'. And, it's impossible to revert your changes, because there weren't any changes.

    I didn't do this intentionally, but when I left my first job (on good terms, but short notice) I'd get calls about failed jobs (I was still listed as the contact) for several weeks; until I finally just said, 'Look, don't call me anymore'. If someone wanted to do this, on purpose, they could.

    Source control is nice, however try to track what the hell happened over the course of months, mixed with other people changesets, mixed with branching and merging... Not saying it's impossible, just extremely difficult.

  • anon (unregistered) in reply to proofreadplease

    The decision whether or not to agree with Gary's self-assessment.

  • Chris (unregistered) in reply to Timmmm

    Go to the headless box, and click on the "OK" button in the dialog box.

    Oh, wait...

  • r66 (unregistered) in reply to anon

    One wonders why the code was working when he was still in the company ....? :-)

  • by (unregistered) in reply to r66
    r66:
    One wonders why the code was working when he was still in the company ....? :-)

    Yeah, no kidding... Talk about working hard, not smrt... I mean smArt.

    He effectively made himself a useless and brainless cog in a machine. Kind of like one's appendix...

  • (cs) in reply to by
    by:
    Source control is nice, however try to track what the hell happened over the course of months, mixed with other people changesets, mixed with branching and merging... Not saying it's impossible, just extremely difficult.
    Particularly when the other devs leave the log message blank on every single commit.
  • (cs)

    Is this how you fix it?;P

     ' Checks for the existence of the file. If it does not exist, 
     ' tries to create it. –Gary B. 12-OCT-05
     ' Added confirm box for debugging purposed – Gary B. 13-OCT-05
    
     Private Sub FileCheck()
         Dim FileExists As Boolean
    
         If File.Exists(FilePath) Then
             FileExists = True
         Else
             Dim t As Thread
             t = New Thread(AddressOf Me.ClickOK)
             t.Start()
             Try             
                 MessageBox.Show( _
    	         "File does not exist. Attempting to create needed files", _
    		 "File(s) Missing", _
    		 MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
                 'Populate file with default text
                 SW = New StreamWriter(FilePath)
                 SW.Write("https://initech-global.com/scripts/mc.exe/scrip.w")
                 SW.Write("\\masvr8b\share\scrip\,")
                 SW.Write("adiamond,")
                 SW.Write("hunter2,")
                 SW.Write("False")
                 SW.Close()
                 FileExists = True
             Catch ex As Exception
                 MessageBox.Show(ex.ToString, "File Creation Error", _
    	          MessageBoxButtons.OK, MessageBoxIcon.Error)
             End Try
         End If
     End Sub
    
    
     Private Sub ClickOK()
         'Give 10 seconds for Gary to acknowledge
         System.Thread.Sleep(10000)
         long hWnd1 = FindWindow(vbNullString, "File(s) Missing")
         long hWnd2 = FindWindowEx(hWnd1, 0&, "OK", vbNullString))
         SendMessage (hWnd2, BM_CLICK, 0 , 0)
         long hWnd3 = FindWindow(vbNullString, "File Creation Error")
         long hWnd4 = FindWindowEx(hWnd3, 0&, "OK", vbNullString))
         SendMessage (hWnd4, BM_CLICK, 0 , 0)
    
     End Sub
    
    
    
  • (cs) in reply to frits
    frits:
    Is this how you fix it?
    Ahem. Change log comment?
     ' Checks for the existence of the file. If it does not exist, 
     ' tries to create it. –Gary B. 12-OCT-05
     ' Added confirm box for debugging purposed – Gary B. 13-OCT-05 
     ' Added "Gary Bot" feature to do Gary's job while he's afk - frits 13-JAN-11
  • by (unregistered) in reply to frits
    frits:
    Is this how you fix it?;P
     ' Checks for the existence of the file. If it does not exist, 
     ' tries to create it. –Gary B. 12-OCT-05
     ' Added confirm box for debugging purposed – Gary B. 13-OCT-05
    

    Private Sub FileCheck() Dim FileExists As Boolean

     If File.Exists(FilePath) Then
         FileExists = True
     Else
         <span style="color:blue;">Dim t As Thread
         t = New Thread(AddressOf Me.ClickOK)
         t.Start()</span>
         Try             
             MessageBox.Show( _
             "File does not exist. Attempting to create needed files", _
    	 "File(s) Missing", _
    	 MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
             'Populate file with default text
             SW = New StreamWriter(FilePath)
             SW.Write("https://initech-global.com/scripts/mc.exe/scrip.w")
             SW.Write("\\masvr8b\share\scrip\,")
             SW.Write("adiamond,")
             SW.Write("hunter2,")
             SW.Write("False")
             SW.Close()
             FileExists = True
         Catch ex As Exception
             MessageBox.Show(ex.ToString, "File Creation Error", _
              MessageBoxButtons.OK, MessageBoxIcon.Error)
         End Try
     End If
    

    End Sub

    Private Sub ClickOK() 'Give 10 seconds for Gary to acknowledge System.Thread.Sleep(10000) long hWnd1 = FindWindow(vbNullString, "File(s) Missing") long hWnd2 = FindWindowEx(hWnd1, 0&, "OK", vbNullString)) SendMessage (hWnd2, BM_CLICK, 0 , 0) long hWnd3 = FindWindow(vbNullString, "File Creation Error") long hWnd4 = FindWindowEx(hWnd3, 0&, "OK", vbNullString)) SendMessage (hWnd4, BM_CLICK, 0 , 0)

    End Sub

    Cool, the drinking bird in code...

    http://1.bp.blogspot.com/_GzQNaaZsh_8/SnruQ-v9s9I/AAAAAAAAMeM/vRQoCVlQxfE/s1600-h/20.jpg

    I'm adding a bunch of text here... blah blah blah

  • tom103 (unregistered)

    Yet another WTF here is showing the message box with 2 buttons (MessageBoxButtons.OKCancel), but not checking the result...

    captcha: "genitus" (genitus developer extraordinaire ?)

  • Dan (unregistered) in reply to proofreadplease
    proofreadplease:
    Management, on the other hand, disagreed with Gary’s self-assessment. Despite his bragging and grandstanding, Gary still had trouble meeting deadlines and following functional specs (being a jerk also helped with the decision too).

    Which decision? To have vanilla icecream instead of triple choc at the next staff party? To buy Gary a new pair of football boots with the social club's yearly takings? I'm hanging on this.. which decision is this referencing?

    I can only assume that Gary got sick of waiting on management's decision and quit his job for a much better paying one where his services were appreciated.

    Yeah I guess his biggest failure was to assume the reader to be capable of thought and having the ability to connect the dots.

  • ÐÃ (unregistered) in reply to Frist Boy

    Is that what you told frits when he started spanking boys in Sunday school?

  • Eclipse FTW (unregistered) in reply to boog
    boog:
    by:
    Source control is nice, however try to track what the hell happened over the course of months, mixed with other people changesets, mixed with branching and merging... Not saying it's impossible, just extremely difficult.
    Particularly when the other devs leave the log message blank on every single commit.

    *** empty log message ***

  • ÐÃÆÃà (unregistered) in reply to ÐÃ
    ÐÃ:
    Is that what you told frits when he started spanking boys in Sunday school?
    Why are you ripping off my username?
  • Henning Makholm (unregistered) in reply to boog
    boog:
    Before it does, however, someone needs to click "OK".
    That's a vile lie!

    They could also click "Cancel".

  • Obsessive Quoter (unregistered)
    Mark:
    Now, it wasn’t that Gary was an unlikeable person, he just had a pompous arrogant attitude that got in the way of coworkers in Jake’s workplace from getting to know the true, “hidden” Gary. A self-proclaimed “genius developer extraordinaire”, he was famous around the office for two things.

    First being…pointing out how much of a genius he is! During his morning rounds, Gary would strike up a conversation about his latest round of changes saved the company untold sums of money, all the while, sprinkling in words like “instantiate” and “overload” as often and as irrelevantly as possible.

    Second – after telling you just how much of a genius he is, Gary would point out that without his efforts, the entire system that managed the company’s supply chain would fail – in short, he was irreplaceable.

    Management, on the other hand, disagreed with Gary’s self-assessment. Despite his bragging and grandstanding, Gary still had trouble meeting deadlines and following functional specs (being a jerk also helped with the decision too).

    On his way out, with one box in-hand, Gary shook his fit at the office shouting "Just wait – you’ll need me and I’ll be gone!" but all everybody simply rolled their eyes at his tirade and returned to work.

    Skip ahead to the next week and suddenly, jobs such as inventory re-costing hung with not even so much as a mention of a reason in the log.

    A task force was assembled to look into the problem and look over the source and found the below method copy-pasted in half of the “classes” Gary had contributed during his tenure to the system’s supposedly unattended services.

         ' Checks for the existence of the file. If it does not exist, 
         ' tries to create it. –Gary B. 12-OCT-05
         ' Added confirm box for debugging purposed – Gary B. 13-OCT-05
    
         Private Sub FileCheck()
             Dim FileExists As Boolean
    
             If File.Exists(FilePath) Then
                 FileExists = True
             Else
                 Try
                     MessageBox.Show( _
        	         "File does not exist. Attempting to create needed files", _
        		 "File(s) Missing", _
        		 MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
                     'Populate file with default text
                     SW = New StreamWriter(FilePath)
                     SW.Write("https://initech-global.com/scripts/mc.exe/scrip.w")
                     SW.Write("\\masvr8b\share\scrip\,")
                     SW.Write("adiamond,")
                     SW.Write("hunter2,")
                     SW.Write("False")
                     SW.Close()
                     FileExists = True
                 Catch ex As Exception
                     MessageBox.Show(ex.ToString, "File Creation Error", _
        	          MessageBoxButtons.OK, MessageBoxIcon.Error)
                 End Try
             End If
         End Sub
    

    Found the error ^^^

  • Anon (unregistered)

    I expected there to be a "might be needing this later" reference. Are we sure that TRWTF is using a modal dialog? Perhaps he truly is an evil genius after all...

    ... perhaps not.

Leave a comment on “Unattended Consequences”

Log In or post as a guest

Replying to comment #:

« Return to Article