Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have seen this on the SO on many times. Whenever a question is vague and the question is asking some magical answer somebody or the other leaves a comment saying answer is 42. Even a book I am reading right now uses '42' as the number whenever it wants demonstrate some basic concept using an integer. So is there any history behind it or it is just a coincidence?

share

locked by Yannis Rizos Nov 4 '12 at 17:01

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

    
Now that Fishtoaster's answer has reached 42 upvotes, I'm locking this to preserve the awesomeness forever. –  Yannis Rizos Nov 4 '12 at 17:00
comments disabled on deleted / locked posts

2 Answers 2

up vote 42 down vote accepted

It's the answer to Life, The Universe, and Everything from Douglas Adams' Hitchhiker's Guide to the Galaxy.

share
8  
I thought everyone knew this. :( –  Nathan Taylor Sep 3 '10 at 1:41
8  
If I ever write a programming language I will allow for base 13 integers. Then 6 * 9 will finally be 42, and the universe will instantly be replaced with something vastly more complex!! I've a feeling that this has already happened... –  Joe D Sep 17 '10 at 18:32
1  
Why in the world is this a :-(, @Nathan Taylor? Surely you're not suggesting that all programmers subscribe to some single monoculture. –  Andy Lester Oct 8 '10 at 21:59
4  
@Andy Lester it's not just a single monoculture, it is the monoculture. –  Nathan Taylor Oct 9 '10 at 13:07
1  
I have not read the book but I know the answer to Life, The Universe, and Everything is 42. –  timur Mar 16 '11 at 6:29
show 3 more comments

As Fishtoaster mentioned, the number 42 has gained pop-culture status via Douglas Adams's Hitchhiker's Guide to the Galaxy, but its true origins are from Lewis Carroll (from whom Adams gained occasional inspiration).

share
1  
Some of the examples in that article are pretty sketchy, especially where it starts getting into mathematical extrapolation and alternate base numbering. –  Fishtoaster Sep 2 '10 at 19:14
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.