135

What would be the last words of particular kinds of programmers?

For example, a Perl programmer:

I don't have to write documentation. The source is formatted so well, I can read it later...

or

I'm just going to write a regular expression to find this, then I'm done...

499

Pre CSS:

           </td>
          </tr>
         </table>
        </td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>
</body>
</html>
499

Post CSS:

              </div>
             </div>
            </div>
           </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
</body>
</html>
403

C/C++:

if (launchMissiles = true)
{
   FireNukes();
}
374 accepted

Lisp:

)))))))))))))))))))))))))))))))))))))))))))))))))))

204

It worked on my machine...

187

goto

157

I'm 90 percent done!

134

"It's a hardware problem"

130

Every programmer, everywhere:

What? That can't be happening, I didn't touch that part of the code.

(I've never found a statement that angered support staff more than that)

121

Java:

One more layer of abstraction and this problem should go away...

115

C:

"128 characters should be enough for this message, right?"

111

SQL n00b:

DELETE FROM big_important_table_with_no_backups WHERE CustomerID = 100 OR 101;
107

Java people don't die, they wait for the garbage collector to get them :P

84

To be a little poetic:

/(bb|[^b]{2})/ that is the Question.

66

C++

delete this;
64

I don't need to rerun all of the tests after this minor changes.

57

Maybe already there but I think those comments are famous last words....

// this can't happen

Also found as: (thx to Pim Jager)

//This should never happen.
56

Perl & PHP:

die("So long, and thanks for all the fish");
53

Wait, WTF?

52

C#

Thread.Sleep(Timeout.Infinite)
51

ASP.NET:

/* The commented code below was DELETED because, even though it was commented out, 
it was  being executed anyway. */

I've actually seen this...

51
try
{
   LHC.Collide(Particle1, Particle2);
}
catch(Exception e)
{
   if(e is BlackHole)
   {
      //LOL
   }
}
50

A programmer who was happy with his life:

return 0;

A programmer who wasn't happy with his life:

return 0xDEADBEEF;
50

Mars orbiter team circa 1999:

Yeah, so feet and inches who uses that any more...?

49

It should work.

48

Assembly:

Huh, that code wasn't supposed to be self-modifying...

46

"It's ok, we trust our users"

"SELECT * FROM User WHERE User.Id = " + Request["id"]
37

PHP tutors:

It's only aimed at beginners, the security stuff can go in a later chapter...

PHP site developers:

It's only a prototype, we can worry about that escaping business later...

PHP site users:

I'll just browse this site using IE...

33

A C++ programmer on his deathbed is haunted by a memory leak.

With his last breath he wispers:

"Is that you 0xfaccface?"

28
// XXX: Fixme
27

I'll just copy these 50 lines, search and replace, and presto I'm done!

27

From an old cartoon: It's a grave-side scene immediately after a funeral. The sky is dark and threatening to rain. The young widow, dressed in black, is looking down at the grave. Her little boy stands beside her, holding her hand and crying.

A stranger approaches and asks, "I realize this is an awkward time but did you ever hear him mention the words 'SOURCE CODE'?

26

Windows Engineer

Ctrl+Alt+Del

25

Lolcode (http://lolcode.com/):

KTHXBYE
25

PHP

php_flag register_globals on

There, that should make my life easier.

24

"Of course I have a backup!"

24
mysql> UPDATE users SET password = '123456'; WHERE username='MyName';
Query OK, 4858210 rows affected (0.51 sec)
Rows matched: 4858210  Changed: 48958210  Warnings: 0

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username='MyName' at line 1

21

Nearly there!
Just two more minutes and I'm done!

21

Skeeeeeeeeet!

20

"I copied this from the internet."

19

Web:

Let's use frames !!

18

Maintenance programmer new to C:

"Oh my god, it's full of stars!"

17

VBasic:

GoTo HEAVEN
17
MessageBox.Show("This should never happen. Tell a programmer.");
16

Language-independent: That's a feature, not a bug...

15

Who put triggers in the database!

15

I'm surprised no one has yet mentioned:

Quick! someone switch back to "More Magic"!

15
  1. Death speaks: "... I was surprised to see him here at Mountain View, for I have an appointment with him tonight in Redmond."

  2. "I have found an O(1) solution to the Travelling Salesman Problem, but the margin of my Moleskine is too small to contain it."

14
//Do not touch!
14

Since life is a bug, it must be reproducible

14
try
{
  doStuff();
}
//catch(Exception e)
//{
////This can't happen
//}
14
// todo: implement this later.
14

Happy programmer:

ESC:wq

Unhappy programmer:

ESC:q!

14

Noooo, Dont cast me into a void....

14
    </blink>
</font>
13

Python programmer:

You know, I bet we could use a list comprehension/map/filter/reduce for this.

This is usually followed by writing some incomprehensible Perl-like one liners.

12

Any object-oriented language (Delphi syntax below):

Self.Free;
10

Windows:

Either this desktop wallpaper goes, or I do.

(with apologies to Oscar Wilde and Echostorm, who correctly pointed out that it was not George Bernard Shaw to whom I should be apologizing)

10

perl


cat /dev/urandom > test.pl; perl test.pl; echo $?

result: 0

10

UNIX programmer:

die_you_gravy_sucking_pig_dog();

See Jeff Atwoods post: http://www.codinghorror.com/blog/archives/001211.html

10

Any (real) programmer:

"It works on my machine"

9

PHP:

if($me->getLifespan() - 30 <= time()) {
    $dying_words = 'I have no regrets.  Well, except for ';
    $dying_words .= implode($regrets, ', ');
    $dying_words .= ' and... nah, that\'s it. Bye.';
    die($dying_words);
} else $me->rockOn();
9

Just going to put skynet online.

9

The C programmer:

I hope this string is NULL terminated!Fz}${%UOE)Ad0DL@+:zs]-i34ow74Segmentation Fault

8

LW of a Java (JEE) programmer:

"This new framework will revolutionise the way we do things! We'll be able to do more with far less code..."

8

It'll be finished for the release, no problem

8

I'm always testing these changes in production! How else would I know they are safe?

7

Objective-C:

[soul release];
7

Microsoft:

Jon Skeet asked for a feature request, to import a little, trivial thing into the .NET framework...

7

Spot the bug:

switch(DefconStatus)
{
    case One: ShowLight(Green);
    case Two: ShowLight(Amber);
    case Three: ShowLight(Red);
    case Four: FireNukes();
    break;
}
6
<?php
    $john = '';
    unset($john);
    header("HTTP/1.0 404 Not Found");
?>
6

For fans of Terry Pratchett's Granny Weatherwax

while (!deadyet) {
    print("I aten't dead");
}
6

Bash programmer

sudo rm -rf /
6

Valid for any language:

"This behavior is by design."

5

This code is never used..

5

"Dr. Falken, would you like to play a nice game of Global Thermonuclear War?" - WOPR

5

For Jeff:

Stack Overflowed.
5



//todo



5

Delphi

finally
  Free;
end;
5

"The problem isn't with the code, it's the data you're supplying"...

or

"It's only a quick change it shouldn't impact anyone else"

an actual comment found in code I inherited:

// Please, for the love of God, WORK!
5

Last words of a java programmer:

catch (Exception e) { 
    // this shouldn't happen
}
4

PHP:

 "?>"
4

How about: "I quit."

4

You did code a failsafe, didn't you?

4

Wait, you're not supposed to use gotos for loops?

4

python programmer using vim:

:%retab!
4

exit('stage left');

4

"Do not disturb my circles".

Archimedes

4

For the "Testing is for wimps" programmer:

"If it compiles, ship it!"

3

It is out of the scope

3

C#:

base.Dispose();
3

Objective-C programmer

[self release];
3

PHP:

if (! mysql_query($sql))
   die(mysql_error());
3

DBA: i believe in reincarnation, so I'll just rollback and retry

3
// "That's All Folks!"
3
C# Coder:



try{
Console.Write("I promise to code better if you give me more days!");
numberOfDaysExtension=AskForExtension(numberOfDaysRequired);
}
catch(NumberOfDaysRequiredOutOfRangeException e){
e.ToString();
}
finally{
if(numberOfDaysExtension<=0) {
 this.Dispose();
}
else{
 GetACupOfCoffee();
 GoBackToDesk();
 }
 }
3

PL/SQL

EXCEPTION    
   WHEN OTHERS THEN NULL;
3

VB

Set Me = Nothing
3
try{
    ...
}catch(Exception ignore){
   //This won't happen
}
3

Coq: Yep, Q.e.d., it's true. I mean, if you prove this simple, obvious lemma ...

3
main() {
        printf("goodbye, world");
 }
2

DROP TABLE mankind

2

catch (exception) {

// No way code will ever get here }

2

Programmer that never has to support his code:

Documentation isn't necessary. Documentation is overrated. Documentation is foolish.

Programmer that has to support the above programmer's work:

Where the $%#! is the documentation?

2

ruby and perl, ruby and perl, and all I ever really wanted was a little calms

2

Google Programmer talking to the Devil "Wait! But... I DID NO EVIL!!!"

2

Yet another one in C:

life_id_t life;

life = fork();
if (life == 0) {
  assert(reincarnation);
  memset(brain, 0, sizeof(brain));
}
2

An overflow is impossible.

2

sudo shutdown -h now

2

If it was a php day I probably just: die;

2

"Whatever you do, don't press the red WinForms button."

2

Reminds me, couple of comments that I saw in production few years ago

// 'programmer name' commented here because it was giving error 
// incorrect code goes here

One more,

// Added by 'programmer name'

This comment is particularly annoying, because the programmer has cared enough to say who added the code, but not what the code does or it's purpose

try
{
  DoStuff();
}
catch(Excpetion ex)
{
  // This should never happen, but if it happens
  // we need to use Exception logging mechanism
  // As of now, we do nothing
}

and 3 years later, the catch block continues to live

2
using(Programmer p = new Programmer(Programmer.Flavours.CSharp))
{
   while(!p.Fingers.Arthritic)
   {
       p.TryWriteCode();
   }
   p.Retire();
   p.WriteWill(p.Descendents);
}
2

it was working on my machine ..

2

Eclipse:

  // TODO Auto-generated catch block
2

Python:

import antigravity

# everything seems to be set in miles, blasted imperial measurements
# setflight(milestotravel, speed, epoch)
antigravity.setflight(929571303.6, 670616629, 1348401600)

Kudos to those who can work out the significance of those numbers.

2

ruby programmers never die. They simply learn to metaprogram themselves into beings of pure logic.

2
//TODO: fix later

I don't know how many of these I've put in my code.

1

Java Guy: System.exit(0)!

1

C/C++:

exit(natural_causes() ? 0 : cause_of_death());

Pascal:

END.
1

Bill Gates1 last words: "Oh, fancy meeting you here Mr Beelzebub."

Skizz

  1. s/Bill Gates/<your icon of evil>
1

C#

using(LifeSupport ls = new LifeSupport())
{
  Patient p = new Patient(me);
}
ls.Breathe(p);
1

Java:

System.exit(0);

1

Self.Dispose();

1

Any Coder: I REGRET NOTHING! (With his life flashing before eyes...which was just hours and hours of writing code and not much else...)

1

Windows:

DEL /S /Q * .txt
1

Vb programmer: all I wanted was to be loved!

1
//HACK: insert your, "i will fix this later" excuse
//FAKE: insert your, "he/she/it isn't completed yet, I'll just hard code this for now" excuse
1

System.exit();

1

java programmer:

this.finalize()
1

I just need one more day.

1

Response to "Why doesn't it do...?"

"Wasn't in the spec"

1

Sorry, that's not in the contract!

1

C#:

GC.WaitForPendingFinalizers();
GC.Collect();
1

VB.net Programmer "But i was so close to getting rid of the Line Continuation Character!"

1

its not a bug.. its a feature !!!

1

Visual Basic:

Microsoft has decided that Visual Basic .NET will not be backward-compatible with Visual Basic 6.0

1

I trust the completely unknown users' input when they would enter and run their own sql on this public facing website.

http://thedailywtf.com/Articles/Oklahoma-Leaks-Tens-of-Thousands-of-Social-Security-Numbers,-Other-Sensitive-Data.aspx

1

OK, that's the beta-test finished.

1

Memory Fault, core dump

1

public class ToBeDisposed:IDisposable {

override Dispose() { base.Dispose(true); } }

1

C#

Human Live()
//.......
Return this;
1

Catastrophic failure

1

PowerBuilder programmer:

See you in heaven. I've done my time in hell programming in PB.

1

// TODO: This really shouldn't be done this way but I don't want to bother fixing it right now...

1

I saw this comment in Axis code - "I'm not sure if we need this code any more, but I'm afraid to delete it."

1

For you Java sci-fi fans:

void destination() {
  if (!hope) {
    system.exit(0):
  }
}
1

Windows:

This program has performed an illegal operation, the secret service has been notified, you have 30 seconds...

Two buttons - [Run now] [Disappear later]

1

}

}

No... wait..

}}

}

1

PHP:

/*
1

C:

return 0;

1

of a wicket framework user:

                }
            });

        }});
}

} based on a true story. cust copy/pasted from the file i was editing right now. the bizzarre mix of } }} ) ; and their different sematics drives me insane.

1

Segmentation fault

1

Last words of a C++ programmer:

"Yeah! I finished it! I'll compile it..."

(2587 compiler errors)

"What can be wrong here? This can't be happening to my beautiful code!"

(forgot a semicolon in the middle of a template class)

**dies

1

Thread programmer:

(130) EOWNERDEAD
1

COBOL programmer:

MM/DD/YY is a fine date format. It's how I write them in real life, isn't it?

1

Javascript:

window.stop();
1

Perl:

my $removeMe = "/useless/useless.527824";
$removeMe =~ s/useless.+//;     
system("rm -rf $removeMe"); # gets rid of useless dir. right?
1

C#

protected void SortEternity(string Time, double Alive)
{
  do
 {
    for (int a; a > 1; a++)
    {
        for (int b; b > 1; b++)
        { 
            for (int c; c > 1; c++)
            {
                for (int d; d > 1; d++)
                { 
                    for (int e; e > 1; e++)
                    {
                        for (int f; f > 1; f++)
                        { 
                            for (int g; g > 1; g++)
                            {
                                for (int h; h > 1; h++)
                                {
                                 //I think it is time to get some coffee
                                }
                            }
                         }
                     } 
                 }
            }
       }
   }
  }While(Alive==true);
}
1

But it works on my machine.

1

Bill Gates :

Reboot

1

Old Scheme programmers never die; they just go out of scope.

I promise.

... To be continued...

1
// this code somehow works
1
gets(large_enough_buffer);
1

C/C++ programmer : My program is still leaking memory, but I was almost about to fix it.

1

Cobol

STOP RUN.

Imagine someone yelling it.

1

Indian Scheme programmer:

(reincarnate (karma (car lives)) (cdr lives)))))))))))))))))))))))))))))))))

Star Trek programmer:

Computer, end life

Star Trek programmer in troublesome times:

Computer, end life
>> unable to comply, codes have been encryped
Override
>> ending life

Python programmer:

export life

Haskell programmer:

To lazy to change my state to death

APL programmer

''

HQ9E+ programmer:

E

Microsoft programmer

//Fuck Bill

BASIC programmer

Goto hell

Prolog programmer:

!
1

Java

public class MayanCalendar extends Calendar {
    // ...
}

Calendar calendar = new MayanCalendar(2012, 11, 21);

...actually any code that uses java.util.Calendar or java.util.Date.

1

It compiled. Let's ship it!

0

shell:

sudo kill -9 -1
0

Socket programmer:

(122) EHOSTDOWN or (110) ETIMEDOUT
0

"It's better to don't write comments to achieve faster compilations"

0

Hmm, this is interesting ...

0

Must... click... commit...

x-|

0

Perl programmer:

__END__
0

The take over bid of my company is worth $100 per share at a total of 100.000 shares.

0

This was his last code he wrote... you can be sure ;)

StringBuffer iCalendarRequest = new StringBuffer(
    "BEGIN:VCALENDAR\n"
        + "PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN\n"
        + "VERSION:2.0\n" + "METHOD:PUBLISH\n" + "BEGIN:VEVENT\n"
        + "ORGANIZER:MAILTO:test@test.de\n" + "DTSTART:"
        + dateFormatter.format(start)
        + "T"
        + timeFormatter.format(start)
        + "A\n"
        + "DTEND:"
        + dateFormatter.format(ende)
        + "T"
        + timeFormatter.format(ende)
        + "A\n"
        + "TRANSP:OPAQUE\n"
        + "SEQUENCE:0\n"
        + "UID:040000008200E00074C5B7101A82E0080000000000278000000000000000\n"
        + " 000004377FE5C37984842BF9440448399EB02\n"
        + "DTSTAMP:"
        + dateFormatter.format(now)
        + "T"
        + timeFormatter.format(now)
        + "Z\n"
        + "LOCATION:Conference room\n"
        + "PRIORITY:3\n"
        + "CLASS:PUBLIC\n" + "END:VEVENT\n" + "END:VCALENDAR").toString();
0

Surprise to his team - Crucial Module delivery at integration time after worked on it several weeks!!!

/* Module Name: abcd

Very Imp - I have written this module which is platform/language independent. This code SHOULD work on all platforms and languages even in dynamic/functional - tested using C#, Java and C/C++. BUT THIS COMMENT AND OTHER COMMENTS MIGHT GIVE COMPILATION ERRORS.

*/

[some code]

0

Ruby:

              end
            end
          end
        end
      end
    end
  end
end
0
//This is a temporary solution
0

It's the user's fault. They don't know what they're doing. This runs Ok on my machine.

0
Console.WriteLine("ALL OF YOUR PRAYERS HAVE BEEN GRANTED!")
0

Database Developer:

Who needs foreign-key constraints? My app will ensure that only correct values are inserted!

0

Lua:

(code version)

self = nil

(non-code version)

Aww shoot, i knew we should have sealed those metatables!
0

Any programmer:

"Bottom of the Heap, moving to the top of the Stack"

0

I don't do design

0

BASIC programmers don't die. They Gosub without Return.

0

COM:

((IUnknown*)this)->Release();
0
if (!(--life)) return 0;
0

Today I've seen how our continuous build of some product on windows machine have failed. It seems funny to me:

cp -rf /home/hudson/.../etc/pymodules/Win32/* /home/hudson/cpptest.win32.x86/hypnos/product/Win32-4.0_i486/bin/lib/
chmod -R a+x /home/hudson/.../Win32-4.0_i486/bin/lib/lib-dynload/*.so # Makes no sense on windows but does not hurt
chmod: cannot access `/home/hudson/.../Win32-4.0_i486/bin/lib/lib-dynload/*.so': No such file or directory
make[3]: *** [pymodules] Error 1
make[3]: Leaving directory `/home/hudson/...'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/hudson/...'
make[1]: *** [cw] Error 2
make[1]: Leaving directory `/home/hudson/...'
make: *** [all] Error 2
Archiving artifacts
Finished: FAILURE
0

Last words of a programmer:

"I stay until the problem is solved."

0

Basic:

GOTO HELL
0

Hmm He should run an SQL statement in a transaction that fails so that he can get back to the previous position after the rollback.