views:

15924

answers:

194

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...

+121  A: 

Java:

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

Cody Brocious
Or "one less layer of abstraction and the performance will be good enough" ... :-)
Mendelt
Or "do you have the correct CLASSPATH"?
Ric Tokyo
"maybe I need one more framework for this..."
ammoQ
+10  A: 

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)

MusiGenesis
That was Oscar Wilde
Echostorm
Good thing they're both dead.
MusiGenesis
+115  A: 

C:

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

Arkadiy
Haha, this is my favorite by far. I hate hate hate looking at legacy code like that, where you know that is exactly what the original programmer was thinking.
unforgiven3
also valid for SQL - "80 characters should be enough for name field, surely?£
Noel Walters
"640K ought to be enough for anybody" -- Bill Gates
Tim Matthews
To be fair, Bill Gates actually never said that. It's completely misattributed.
Matt Olenik
@Matt: [citation required] ... oops, wrong site
Joachim Sauer
+64  A: 

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

Dmitriy Matveev
AKA "my test suite is too slow and cumbersome to be much use"
Arkadiy
I don't need to grammar check this comment after these minor edits.
mozillalives
+48  A: 

Assembly:

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

Cody Brocious
Hahaha, too true!
Sukasa
Or better yet, self modifying code that ends up running the old version (and not the one in memory) due to pipelining!
Brian Knoblauch
... said just before the programmer's newly sentient creation turns on him.
Jeremy Friesner
+66  A: 

C++

delete this;
Arkadiy
I upvoted this, although in intrusive reference counting systems (e.g., COM objects), `delete this` is indeed the right thing to do as the last action, when the refcount drops to zero.
Chris Jester-Young
Didn't the question say "the last words"? :) On a more serious note, the intrusive ref counting does go awry, and the issues of memory ownership are the most thorny issues in C++, IMO.
Arkadiy
I have used this in real code and it made sense...
Dan
Beat me to it. Probably with a comment above: `//TODO: Fix this later.`
Johnsyweb
@dan, it's great nevertheless.
Pavel Radzivilovsky
Shouldn't the intrusive_shared_ptr object do a "delete m_data" rather than having the m_data do a "delete this" ?
Jeremy Friesner
+1  A: 

Java Guy: System.exit(0)!

leeand00
+21  A: 

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

Sam
+130  A: 

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)

Cody Brocious
"But I didn't CHAAAANGE anything!!!"
Arkadiy
I'm guilty of saying this. /penance
Greg D
I just admit that I changed, probably everything.
John Leidegren
"It's working fine on my PC." - also very common :D.
virious
+374  A: 

Lisp:

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

glenatron
Hehe. Reminds me of http://xkcd.com/297/
Herms
Yeah, I had to laugh, too ... but if this happens, the code should presumably be refactored.
Svante
really nice said
Schildmeijer
I think you missed one. :)
Brandon DuRette
Could also be the answer to: Last lines of a Lisp program.
T Pops
@Brandon: I see what you did there
Christian Hayter
@Brandon : LOL....
Senthil
@Svante: Not possible.
RCIX
@Herms - does the theory that one could inherit the brackets one's parents used count as a parent thesis? xD
glenatron
That isn't funny, I always end my lisp programs like that (give or take a couple of parens.)
daramarak
+49  A: 

It should work.

Glennular
This is pretty much banned in my office. It was the favourite phrase of one of our less talented programmers, since he left we're not allowed to use 'should'
Neil Aitken
What do you say instead? It will work? C'mon we're all anal retentive programmers and cannot make a statement like that when we know it's possibly false!
Stimy
Was going to say the same myself. "I checked in those changes... it should work now"
Dead account
This is why I just say, "Try again."
Mike Daniels
@Stimy - no - the point is this is something idiots say to make whoever's complaining go away. Its all in the intonation they use: Compliant: "The doohickey's malfunctioned." Idiot: "Hmm. It _should_ work." Real annoying.
bobobobo
+52  A: 

C#

Thread.Sleep(Timeout.Infinite)
RandomNoob
Needs a probabilistic call to Thread.Dream.
zaratustra
Pfft, I go in and out of comas all the.........................
DisgruntledGoat
+5  A: 

This code is never used..

+204  A: 

It worked on my machine...

TGnat
If I had a penny for every time I heared that line... ;-)
ISW
At which point you run it on their machine, and it still doesn't work.
Kibbee
then they say "it ran before" and you find out they have failed to notice it hasn't even compiled for a while so the final build and the code don't even match ><
Ric Tokyo
Let's ship it with your machine then!
Genericrich
if i had a penny for every time that I say that... :-)
Baget
Haha! should make it into a catch-phrase :)
Dacto
oh ... i think i always say that ...
iceangel89
Hilarious comment, Genericrich =x
Pavel Radzivilovsky
+28  A: 
// XXX: Fixme
Cody Brocious
+14  A: 
//Do not touch!
CodeMonkey
+50  A: 

A programmer who was happy with his life:

return 0;

A programmer who wasn't happy with his life:

return 0xDEADBEEF;
Davy Landman
When I read "DEADBEEF", I always thign of a juicy steak...
peterchen
it's DEADD00D over here.
MaxVT
He really should have said `return (EXIT_SUCCESS);` in the first one.You know, in case they change it later.
Jeff Kelley
In communications programming, it's 0xDEAF
Cylon Cat
+8  A: 

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..."

Phill Sacre
ROFLOL......(15 chars)
Senthil
+12  A: 

Any object-oriented language (Delphi syntax below):

Self.Free;
_J_
aka, the suicidal C++ delete this;
Omry
+13  A: 

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.

Jason Baker
I do that a lot and am still ali
pi
you are still ali? I thought you were pi
johnc
he died mid word but still had the muscle memory to click "add comment" /respect
Tanj
LOLOL (that means that i actaully laughed out loud out loud)
Harry
+14  A: 

Since life is a bug, it must be reproducible

GvS
And indeed it is. Well not in a karmic sense.
jcollum
+19  A: 

Web:

Let's use frames !!

Berzemus
I never understood why ppl hated frames
acidzombie24
@acidzombie24 - watch the number of HTTP requests... frames can bring a site to its knees in no time.
scunliffe
There's also the fact that frames break the back and forward buttons on web browsers. Granted, AJAX heavy pages do this also...
quanticle
+8  A: 

It'll be finished for the release, no problem

Zeus
+403  A: 

C/C++:

if (launchMissiles = true)
{
   FireNukes();
}
Brad Barker
I hope those weren't aiming in my direction...
Michael Myers
I did something similar ones, thank god for our testing server. if(deleteclients = true){ deleteclients(); }
Pim Jager
HAHA! Nice real version of this scenario Pim.
Brad Barker
pretty destructive
Perpetualcoder
So subtle, yet so funny.
John MacIntyre
So true, so true
Dan Blair
in the case of booleans, this is why you should never check them against true and false, but just do if(launchMissiles). of course doesn't works so well for ints... hopefully you'll get a compiler warning.
rmeador
What check? That is an assignment statement.
EvilTeach
That's why you should always write: if (true == launchMissiles)
Milan Babuškov
@Milan-That's the joke! The assignment is why this is the 'famous last words' .. it's a bug that kills us all!
John MacIntyre
@EvilTeach: I meant that you'd never have made that typo if you weren't trying to test the value against true.
rmeador
That's why you should just write "if (launchMissiles){ FireNukes(); }".
luiscubal
Should put a pragma to ignore all warnings at the top!
Chris Smith
@luiscubal you dont even need the curl braces around fire nukes.if(launchMisiles) fireNukes();
Tim Matthews
"Should put a pragma to ignore all warnings at the top!"... How funny :)
Aaron
Brilliant. Almost wet myself.
Brent.Longborough
wow, I didn't get it at first!! :/ which makes it all the more dangerous
hasen j
My thoughts: "Wait, shouldn't that be a double equals? Otherwise, it'll run every single t... oh..."
Smashery
@hasen +1 it does not make **it** more dangerous, it makes **you** more dangerous :)
flybywire
Best last words so far!
Victor Hurdugaci
but I'm le tired. http://www.albinoblacksheep.com/flash/end
Craig
@Rhythmic Algorithm, `if(launchMisiles) soundAlarm(alr_ICBM); fireNukes();` yeah, *that's* sa-
David X
This code is the same in Java. So you could have written `Java/C/C#`
Shervin
dammit.. if (true == (true == launchMissile))
Pavel Radzivilovsky
+53  A: 

Wait, WTF?

Andrei Krotkov
Universally applicable.
Joachim Sauer
+134  A: 

"It's a hardware problem"

James Curran
Dude, this is going on my tombstone.
Patrick Johnmeyer
That went up in my office today. Nice one!
Gerard
Come to think of it, it is WAY better as an epitaph than last words. +1 to you, Mr. J.
Ishmaeel
It usually is a chair/keyboard interface problem ;)
Thomas Levesque
User: all software above yours. Hardware: all software below yours.
Pavel Radzivilovsky
+84  A: 

To be a little poetic:

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

Fluff
Actually...That translates to "Two B or Two Not-B".
DanM
@DanM: That's even *more* poetic ;-)
Jasper Bekkers
2B || ~2B is a variant on it.
Davy Landman
No, it should be 10b | ~10b
Alnitak
I have a sign saying "2B or Not 2B" on my front door (I've live in apartment 2B)
James Curran
/bb|(?!bb)/ = negative assertions
porneL
My proofreaders reduced it to ... 1
gbarry
DanM: Same here - everytime I see it I think it's yet another bad translation of Shakespeare.
peterchen
cleaver, non the less
John Leidegren
+3  A: 

It is out of the scope

Rulas
I used to use this one all the time at my last job.
Nolte Burke
Hahaha...sometimes it is...sometimes is not =P
Rulas
+157  A: 

I'm 90 percent done!

lol, that's how it always goes
kitsune
Now the other 10% will take op 90% of the time.
Pim Jager
Yep, I've been two days away from completing this for the last two months.
Arkadiy
+1, but I've always found it to be 95% done... :)
technomalogical
Hahaha! Tomorrow he will say "80% done".
grayger
The last 10% takes 6-8 weeks ;)
ristonj
+1  A: 

C/C++:

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

Pascal:

END.
plinth
+1  A: 

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

Skizz

  1. s/Bill Gates/<your icon of evil>
Skizz
+50  A: 

Mars orbiter team circa 1999:

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

Kev
Americans still use that!! it's sad
hasen j
That and their strange gallon size :)
Kev
and the Fahrenheit!! When I hear the temperature is 50 I have no idea whether that's supposed to be cold, nice, or hot!
hasen j
http://xkcd.com/526/
Kev
http://www.userfriendly.org/cartoons/archives/99dec/uf001332.gif
LRE
the UF strip is hilarious: "metric to standard calculator". WTF!
just somebody
+17  A: 

VBasic:

GoTo HEAVEN
nezroy
+56  A: 

Perl & PHP:

die("So long, and thanks for all the fish");
DWright
Yay for Hitchhikers refrence.
Pim Jager
works in PHP as well
eliego
+1  A: 

C#

using(LifeSupport ls = new LifeSupport())
{
  Patient p = new Patient(me);
}
ls.Breathe(p);
Echostorm
How can you use ls outside the using() ? :O
Filip Ekberg
Stopped breathing due to lack of scope...
seanb
Filip - Exactly.
Echostorm
This one won't compile.
Loren Pechtel
+1  A: 

Java:

System.exit(0);

Tony Lambert
+10  A: 

perl


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

result: 0

UUOC, and it will not terminate. Better to use dd.
William Pursell
+16  A: 

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

ISW
oh damn already posteed... :/
Filip Ekberg
+27  A: 

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

Eric Palakovich Carr
Just a commit and I'm out of here!
Andrei Krotkov
+1  A: 

Self.Dispose();

Tom Moseley
+1  A: 

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

leeand00
+57  A: 

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.
BeowulfOF
In my code find you can find this quite often as: //This should never happen.
Pim Jager
If you've thought it through carefully and still think it should never happen, you could put in an assert. Your program will fail earlier and will be easier to debug.
Albert
I once had ancient FORTRAN that output, in Portaguese "It's better to be a live donkey than a dead doctor."
Brian Postow
Joking aside, it's better to use assert() here: assert that the thing is not happening, don't just state in a comment that it shouldn't.
hahaha, just added one of these not too long ago to my code
Petey B
assert(!"This should never happen");
pierr
+9  A: 

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();
Nice. although wouldn't a lot of regrets become a problem?
Pim Jager
I suppose the key is to keep your regret list small... the performance of Human::rockOn() declines as the size of $regrets increases, after all, so you could be onto a more widespread problem.
Purely a preference, but you switched the arguments in implode(). "Note: implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments." -- http://us3.php.net/implode
iddqd
+1  A: 

Windows:

DEL /S /Q * .txt
Stroboskop
+37  A: 

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...

bobince
+4  A: 

PHP:

 "?>"
+107  A: 

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

Null303
But the garbage collector can only get them if no one else knows they exist...
Michael Myers
So they die as soon as their last friend dies. But he knows it's friend...typical problem GCs have on their daily work :-)So if the GC is good it just kills the whole clan :-)
rstevens
@rstevens: Do Java programmers have friends then? :P
BenAlabaster
Isn't it: you don't have to bury a java programmer when he dies, the garbage collector will get him.
Nathan Feger
@rstevens what if one of them is static?
luiscubal
+51  A: 

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...

axel_c
ASP.NET will still execute even if its wrapped in '<!--' and '-->'. The trick to commenting out ASP.NET markup is using "server-side" comments instead: <%-- ... --%>
Juliet
Yes, I know that, but it's still a funny ASP.NET wtf :P
axel_c
So if the code below is gone, what's the point of mentioning it?
TM
/* The comment I left below was DELETED because, even though the answer is 6 months old, it was commented anyway. */
James M.
+1  A: 

Vb programmer: all I wanted was to be loved!

Sliceoftime
Thats ok... `OnErrorResumeNext`
scunliffe
+8  A: 

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

Aaron Digulla
This gives me nightmares
epochwolf
The only way to trust a company is never to work there ...
Aaron Digulla
We do that all the time. drives me batty.
Brian Postow
+6  A: 
<?php
    $john = '';
    unset($john);
    header("HTTP/1.0 404 Not Found");
?>
+2  A: 

DROP TABLE mankind

gnovice
"You feel dead inside."
Kuroki Kaze
+25  A: 

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

KTHXBYE
Pim Jager
+6  A: 

For fans of Terry Pratchett's Granny Weatherwax

while (!deadyet) {
    print("I aten't dead");
}
Sam Meldrum
+17  A: 
MessageBox.Show("This should never happen. Tell a programmer.");
John Gietzen
+1  A: 
//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
Chris
+1  A: 

System.exit();

Sven Lilienthal
+1  A: 

java programmer:

this.finalize()
+187  A: 
Jakub Šturc
Is their a question that XKCD does not have a comic for?
Pim Jager
@Pim Pager: Maybe, but not likely.
luiscubal
@Pim Jager - the exact question you just asked?
Damien_The_Unbeliever
I've added title and alt attributes to the image.
J.F. Sebastian
"Is THERE a question..." - Fixed.
Richie_W
That was the funniest shit I've seen all week.
Rayne
That happened to me once... Or was it a dream?
JohannesH
I'm looking at it, but I still don't get it...
Alix Axel
This cartoon is included in PHP's [documentation](http://php.net/manual/en/control-structures.goto.php) on GOTO.
Andrew Grimm
+33  A: 

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

With his last breath he wispers:

"Is that you 0xfaccface?"

Nailer
he must be writing 32-bit, right?
Behrooz
facc face? i don't get it.
Mark
f*ck face in hex?
Nailer
+14  A: 
try
{
  doStuff();
}
//catch(Exception e)
//{
////This can't happen
//}
This would be more realistic if the catch block wasn't commented out, because 1) it won't even compile if doStuff() throws checked exception (as Exception implies) and 2) a common mistake is to do just that: catch (any) exception and do absolutely nothing about it
Jonik
+4  A: 

How about: "I quit."

Erik Forbes
+499  A: 

Pre CSS:

           </td>
          </tr>
         </table>
        </td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>
</body>
</html>
Nick
This and Nikron's made me lol alot.
Pim Jager
Make sure you upvote Nikron's if you upvote this one.
Epaga
@Epaga why? This was the original, and it was funnier/more true.
TM
The two work well together as a pair.
Rob
make sure you upvote nickf's comment in Nikron's post if you upvote Epaga here
hab
lols... people are even voting the comments in pairs..
Jeriko
+26  A: 

Windows Engineer

Ctrl+Alt+Del

Casey
I actually had to click the <kbd>edit</kbd> link to see how you did that! D:
MrValdez
Doh, me too. Then I noticed, wow, I'm > 750 rep :D
furtelwart
its a neat little trick. You can find more here http://stackoverflow.com/questions/31657/what-html-tags-are-allowed-on-stack-overflow
Casey
Windows "Engineer"?
Nolte Burke
+1 for using <kbd>
Ates Goral
Ionno, I use Ctrl+Shift+Esc these days.
Mark
+3  A: 

C#:

base.Dispose();
Patrik
+25  A: 

PHP

php_flag register_globals on

There, that should make my life easier.

tj111
And the crazy thing is, it doesn't make anything any easier.
eyelidlessness
+10  A: 

UNIX programmer:

die_you_gravy_sucking_pig_dog();

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

Ricardo Villamil
+499  A: 

Post CSS:

              </div>
             </div>
            </div>
           </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
</body>
</html>
Nikron
THis and nick's made me lol alot.
Pim Jager
Well played sir!
Bob Somers
hahah that definitely made me LOL. If you vote this up, make sure you also vote Nick's up so they stay in this order.
nickf
ROFLOL. That's what I see everyday when maintaining old code
Senthil
lols... people are even voting the comments in pairs..
Jeriko
+5  A: 

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

Michael Kniskern
+1  A: 

I just need one more day.

Filip Ekberg
+15  A: 

Who put triggers in the database!

Milhous
delete table where id=4 // 1 row(s) affected // 0 row(s) affected // 14 row(s) affected // OMG what did I just do?
tsilb
+7  A: 

Objective-C:

[soul release];
Billy Gray
+10  A: 

Any (real) programmer:

"It works on my machine"

Oh, this drives testers batty!
tsilb
+6  A: 

Bash programmer

sudo rm -rf /
Ólafur Waage
Don't forget you need to be root! "sudo rm -rf /"
epochwolf
!!!! This has been my warcraft 3 LAN screenname for at least a year now.
Razor Storm
+3  A: 

Objective-C programmer

[self release];
Igor
Already said! :) http://stackoverflow.com/questions/469445/last-words-of-a-programmer#470622
Filip Ekberg
+1  A: 

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

"Wasn't in the spec"

Gerard
+2  A: 

catch (exception) {

// No way code will ever get here }

nzpcmad
+111  A: 

SQL n00b:

DELETE FROM big_important_table_with_no_backups WHERE CustomerID = 100 OR 101;
too much php
or WHERE CustomerID *LIKE* ...
Ric Tokyo
OOoh now that is a good one!
David
ahh, you can roll that back. Truncate table XXX so bad
Nathan Feger
You assume that I knew what a transaction was when I ran that query.
too much php
Er, I mean, you assume that the SQL n00b knew what a tranasaction was.
too much php
+1 for Peter comments.
Mark Pattison
In what flavor of SQL does that query work? Postgres rejects it with a type error.
Barry Brown
hmm i dont really get it, tho it might need to be CustomerID = 100 OR CustomerID = 101... oh icic the OR 101 part will always be true?
iceangel89
@iceangel89: Yes, so it deletes everything in the table.
user9876
WHERE CutomerID IN (100, 101)
titaniumdecoy
.. `LIMIT 2` ..
bobobobo
+46  A: 

"It's ok, we trust our users"

"SELECT * FROM User WHERE User.Id = " + Request["id"]
Matt Ephraim
Request['id'] = "1; DROP TABLE User;" OR if you wan't to be nice: Request['id'] = "1 OR User.Id LIKE %; DROP TABLE User;" so you they will get all the data one last time.
Pim Jager
http://sqlninja.sourceforge.net/
ccook
http://sqlmap.sourceforge.net/
ccook
http://xkcd.com/327/
musicfreak
Why Avast Antivirus reports every file I download from sqlmap.sourceforge.net as a virus?
Jader Dias
@estourodepilha.com: Why are you using antivirus?
Longpoke
+1  A: 

Sorry, that's not in the contract!

Marv3lz
+1  A: 

C#:

GC.WaitForPendingFinalizers();
GC.Collect();
Ash
+9  A: 

Just going to put skynet online.

PeteT
Very nice!...that one just gave me chills
Egg
+4  A: 

You did code a failsafe, didn't you?

+4  A: 

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

Xymostech
+2  A: 

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?

Bernard Dy
+2  A: 

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

klyde
+1  A: 

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

Harry
+1  A: 

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

Nrj
+2  A: 

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

Harry
+5  A: 

For Jeff:

Stack Overflowed.
Mark Harrison
+5  A: 



//todo



Click Ok
+1  A: 

Visual Basic:

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

MrValdez
+1  A: 

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

Jared
+7  A: 

Microsoft:

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

Peter
+2  A: 

Yet another one in C:

life_id_t life;

life = fork();
if (life == 0) {
  assert(reincarnation);
  memset(brain, 0, sizeof(brain));
}
Tim Post
This is clearly a fork procedure.
zaratustra
Agreed. Modified :)
Tim Post
+3  A: 

PHP:

if (! mysql_query($sql))
   die(mysql_error());
Click Upvote
+27  A: 

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'?

David Stafford
Strictly speaking, these are not the programmers last words, but I'm upvoting this one anyway.
NealB
+6  A: 

Valid for any language:

"This behavior is by design."

Greco
+14  A: 
// todo: implement this later.
nickf
+14  A: 

Happy programmer:

ESC:wq

Unhappy programmer:

ESC:q!

PolyThinker
side note: VI's "quit without saving" is an odd command as it requires touch-typers to perform 6 consecutive keystrokes typed with their pinkies: <esc>,<shift><colon>,<q>,<shift><!>
James Curran
Perhaps it's a way to prevent accidental quitting without saving? I've no idea, but yes, it's a bit more difficult to type than other commands.
PolyThinker
Kind of awkward to type in ! with only ur pinkies...
Ikke
Shift-colon is worse, are you supposed to use the same finger?! I always use 4th and 3rd fingers anyway...
DisgruntledGoat
grep 'map ; :' $HOME/.vimrc || echo 'no wonder I'm a disgruntled goat'
William Pursell
Clueless programmer: ZZ
William Pursell
Happiest programmer: C-x C-s:D
Razor Storm
That's a feature, not a bug. Especially these days, quitting without saving is just lazy. I try to always save my files, and rm the ones that I don't need later. That way, I tend not to delete things that I need later on.
quanticle
+20  A: 

"I copied this from the internet."

bitschnau
+51  A: 
try
{
   LHC.Collide(Particle1, Particle2);
}
catch(Exception e)
{
   if(e is BlackHole)
   {
      //LOL
   }
}
Orkun Balkancı
Mr. BlackHole should own his own 'catch' block. :/
Arnis L.
Haha, good one :) Now, wait for November-restart ;)
+3  A: 

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

Steven A. Lowe
+1  A: 

OK, that's the beta-test finished.

Simon Knights
+1  A: 

Memory Fault, core dump

Pradeep Kumar Mishra
+4  A: 

python programmer using vim:

:%retab!
sth
+3  A: 
// "That's All Folks!"
AndyUK
+5  A: 

Delphi

finally
  Free;
end;
dmajkic
This could be inside a using statement and thus not suicidal.
Loren Pechtel
+5  A: 

"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!
Chris
+3  A: 
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();
 }
 }
Lonzo
+9  A: 

The C programmer:

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

ahoka
+3  A: 

PL/SQL

EXCEPTION    
   WHEN OTHERS THEN NULL;
Daniel Emge
Yeah, I just found this in some code that a contractor released into our production evnironment. I am not a happy man.
Jonathan
+2  A: 

An overflow is impossible.

martinus
+2  A: 

sudo shutdown -h now

timday
This answer belongs on serverfault
William Pursell
Serverfault didn't exist when this was posted. Hmmm... So far as I can tell noone seems to have posted a corresponding "last words of a sysadmin" question over there yet...
timday
+1  A: 

public class ToBeDisposed:IDisposable {

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

Irwin
+5  A: 

Last words of a java programmer:

catch (Exception e) { 
    // this shouldn't happen
}
yx
Was that intended to be all on one line? (If so, it bring up it's own interesting question....)
James Curran
+24  A: 

"Of course I have a backup!"

splattne
"Ofcourse I have a backup on my Machine!"
I think it was only 2GBs.(it took me 10 days and so on.and this is not a joke).
Behrooz
+2  A: 

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

Movaxes
+2  A: 

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

Alex Baranosky
+14  A: 

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

HeretoLearn
+4  A: 

exit('stage left');

+1  A: 

C#

Human Live()
//.......
Return this;
Konstantinos
+1  A: 

Catastrophic failure

pablito
+18  A: 

Maintenance programmer new to C:

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

Michael Borgwardt
Usually pointers to a multi-dimensional arrays, of dimensions 1 by 4 by 9 by ...
Beska
/******************/ - I hate this kind of comment
tsilb
+1  A: 

PowerBuilder programmer:

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

eran
+1  A: 

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

GeoffreyF67
+3  A: 

VB

Set Me = Nothing
keithwarren7
+4  A: 

"Do not disturb my circles".

Archimedes

Ryan Townshend
+3  A: 
try{
    ...
}catch(Exception ignore){
   //This won't happen
}
Ubersoldat
+1  A: 

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."

Don Branson
+1  A: 

For you Java sci-fi fans:

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

Windows:

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

Two buttons - [Run now] [Disappear later]

Shraptnel
+3  A: 

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

huitseeker
+1  A: 

}

}

No... wait..

}}

}

Kyle G
+3  A: 
main() {
        printf("goodbye, world");
 }
JohnFx
+21  A: 
JohnFx
You should take a screengrab of James T. Kirk and adding this text to it for more impact :D
Michael Stum
Thank you for summing up the Photoshop skills of 95% of the userbase here, including me.
T Pops
Photoshop?!? Mister, I work for a living!I used Hypersnap DX (screenshot tool)!
JohnFx
+2  A: 

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

Vin
...successfully catches exceptions since '99!
Groo
yeah you bet :)
Vin
+2  A: 
using(Programmer p = new Programmer(Programmer.Flavours.CSharp))
{
   while(!p.Fingers.Arthritic)
   {
       p.TryWriteCode();
   }
   p.Retire();
   p.WriteWill(p.Descendents);
}
WOPR
+1  A: 

PHP:

/*
Sam152
+4  A: 

For the "Testing is for wimps" programmer:

"If it compiles, ship it!"

cbeuker
+14  A: 
    </blink>
</font>
Mike Robinson
+1  A: 

C:

return 0;

+2  A: 

it was working on my machine ..

+1  A: 

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.

Andreas Petersson
+15  A: 

I'm surprised no one has yet mentioned:

Quick! someone switch back to "More Magic"!

Brian Postow
+1  A: 

Segmentation fault

Ryan Bigg
+15  A: 
  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."

Brent.Longborough
darnit! they won't let you double-vote something :)
warren
@warren: donworry, it's only fun really (;->)
Brent.Longborough
Is the solution "sell on ebay?"
Matthew Scouten
+1  A: 

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

Eduardo León
+7  A: 

Spot the bug:

switch(DefconStatus)
{
    case One: ShowLight(Green);
    case Two: ShowLight(Amber);
    case Three: ShowLight(Red);
    case Four: FireNukes();
    break;
}
Simon Hughes
I got it: Your defcons are backwards and you're missing 5. Defcon 1 is WW3, defcon 5 is peace. If you fire nukes at defcon 4, you're in trouble. DEFCON 4 = "Increased intelligence and heightening of national security measures".
tsilb
Actually, the cases are missing the break; statement. This means the cases will flow to the next one regardless. So if its defcon Two, we'll showLight(amber), and Showlight(Red) and FireNukes().
Simon Hughes
Lol, it's a "nukelight"!
RCIX
+2  A: 
David Pokluda
A: 

shell:

sudo kill -9 -1
chaos
+1  A: 

Thread programmer:

(130) EOWNERDEAD
chaos
A: 

Socket programmer:

(122) EHOSTDOWN or (110) ETIMEDOUT
chaos
+1  A: 

COBOL programmer:

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

chaos
+1  A: 

Javascript:

window.stop();
Jeremy Ricketts
+1  A: 

Perl:

my $removeMe = "/useless/useless.527824";
$removeMe =~ s/useless.+//;     
system("rm -rf $removeMe"); # gets rid of useless dir. right?
Ouch! Please make it stop.
Tom
+1  A: 

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);
}
Dacto
Since the integers will wrap, this will end.
George Edison
Huh? All the for loops do nothing as the termination condition is true. The final While won't compile.
Loren Pechtel
+2  A: 

Eclipse:

  // TODO Auto-generated catch block
grayger
+24  A: 
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

That one actually made me break out in a sweat... kudos :)
Taeram
Once I did something similar to this. I wrote "Update a_table set a_column = 12345" and I went to take a coffee. When I turned back to my computer I executed the query. It took a while to execute the query then it printed "10000 row affected" That was not my last word :) I had a backup a very very recent backup.
JCasso
+1  A: 

But it works on my machine.

Chris
A: 

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

FerranB
+1  A: 

Bill Gates :

Reboot

+1  A: 

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

I promise.

... To be continued...

Dan Breslau
A: 

Hmm, this is interesting ...

ldigas
A: 

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

x-|

Groo
A: 

Perl programmer:

__END__
MiffTheFox
+1  A: 
// this code somehow works
mcm69
Hey, that's the comment I use for most code... :)
rozon
A: 

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

Bart Roozendaal
+2  A: 

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.

Jonathan Prior
The second one is the speed of light i think...
RCIX
A: 

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:[email protected]\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();
codedevour
Not the worst one, much clear than most code in my company
Kamarey
I don't find this funny. I've actually seen code like this. I died a little that day.
andymeadows
Was he/she an ex-VB6 developer by any chance? :-)
Christian Hayter
A: 

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]

+2  A: 

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

tsykoduk
A: 

Ruby:

              end
            end
          end
        end
      end
    end
  end
end
Jared
doubles as Lua too!
RCIX
A: 
//This is a temporary solution
pierr
A: 

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

Ricardo
A: 
Console.WriteLine("ALL OF YOUR PRAYERS HAVE BEEN GRANTED!")
Mo
+1  A: 
gets(large_enough_buffer);
Muxecoid
A: 

Database Developer:

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

Vinz
+1  A: 

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

fastcodejava
A: 

Lua:

(code version)

self = nil

(non-code version)

Aww shoot, i knew we should have sealed those metatables!
RCIX
A: 

Any programmer:

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

Kyle Rozendo
+1  A: 

Cobol

STOP RUN.

Imagine someone yelling it.

Luc M
A: 

I don't do design

Ropstah
+2  A: 
//TODO: fix later

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

George Edison
A: 

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

bitc
Terribly lame!!
George Edison
A: 

COM:

((IUnknown*)this)->Release();
Foole
Fixed that for you.
jeffamaphone
A: 
if (!(--life)) return 0;
Waltzy
+1  A: 

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:

!
Lajla
A: 

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
Dmitriy Matveev
A: 

Last words of a programmer:

"I stay until the problem is solved."

Inno
+1  A: 

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.

ponzao
Actually, the Mayan calendar's current long count ends at December 21st 2012...
hleinone
Thanks, the premature end of the world is now fixed.
ponzao
...and propably you wouldn't initialize the Mayan calendar with years and months since those concepts are inexistant in the Mayan calendar. ;) More like `new MayanCalendar(14, 1, 0, 0, 1)` (for compatibility with GregorianCalendar some of the fields are zero and some one-based)
hleinone
Let me guess, they used weeks? If so were Mayans the first people working in HR?
ponzao
Mayas used days, 20 day periods called winal, 360 day pariods called tun, 7,200 day periods called k'atun and 144,000 day periods called b'ak'tun. Now we're pretty close to the end of 13th b'ak'tun.
hleinone
You Sir are better than Wikipedia.
ponzao
A: 

Basic:

GOTO HELL
SchlaWiener
A: 

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.

+1  A: 

It compiled. Let's ship it!

Maister