views:

285

answers:

5

I've read of an easter egg as part of an actual programming language command (Python's antigravity), I was wondering if there were any other easter eggs or anything undocumented for other languages or popular APIs? Are there other undocumented commands that could actually be considered useful?

Some I've heard of:

  • Python antigravity comic
  • PHP dog logo: append ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 on any php page (I wouldn't consider this being a language egg though...)

Completely unrelated to programming I just noticed when you search in Google for "ascii art" it changes the Google logo to ascii.

A: 

or anything undocumented

There are millions that fall under that one. I bet that the majority of APIs have some genuinely useful but undocumented functionality.

I know that Samba has a particularly powerful (and somewhat destructive) undocumented function in it, but I shall say no more.

This might also get your attention: http://undocumented.ntinternals.net/

Artelius
Yes, I think you're right "undocumented" is a question on it's own...
Peter
+1  A: 

Tcl has the ability to read and write stardates.

% clock format [clock seconds] -format %Q
Stardate 63367.2

Quite some time ago I had a gig programming in DIBOL. The DIBOL compile had a special switch that would add ascii art of a sheep at the end of the compiler output, with the phrase "DIBOL - the black sheep of the DEC language family" or something to that effect.

Bryan Oakley
+2  A: 

If you're a Pythonista, you probably know of import this:

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

And then there's also the message from the developers to anyone that wants braces in Python:

>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance
Paolo Bergantino
+1  A: 

Using Matlab, type why from the command window. It returns things such as

Some not excessively good and rich engineer knew it was a good idea.

I stumbled upon it after getting frustrated with my code and typing why. You can type edit why to see (and change) its source. And it turns out the responses can get really long... http://www.mathworks.com/matlabcentral/newsreader/view_thread/164966

gary comtois
A: 

That's not really an API easter egg, but in the old Visual C++ 6, when you created a library project, it generated the following dummy function:

TEST_API int fnTest(void) 
{ 
    return 42; 
}
Thomas Levesque