I hear this phrase often and do not fully understand it's meaning. What does it mean? And if possible, is there an example?
thank you!
I hear this phrase often and do not fully understand it's meaning. What does it mean? And if possible, is there an example?
thank you!
One use of this expression refers to a style of programming where there is a very deep call stack. You might see a method called Grobble
and wonder what it does, so you open up the definition and see this:
class FooHandler
{
void Grobble(Foo foo)
{
foo.Grobble();
}
}
So then you look at Foo.Grobble
:
class Foo
{
FooImpl _fooImpl;
void Grobble()
{
_fooImpl.Grobble();
}
}
That takes you too FooImpl
which looks like this:
class FooImpl
{
void Grobble()
{
this.Grobble(false);
}
// etc...
}
After going deeper and deeper into the code, still unable to see the end, you are allowed to frustratedly exclaim "It's turtles all the way down!"
The reference is to the metaphor of the Earth being on the back of a turtle. What is the turtle standing on? Another turtle... etc.
This usually refers to self-hosting programming languages, where the interpreter or compiler is written in the same language that is being interpreted/compiled. It can also refer to the libraries for the language being written in the language itself.
Smalltalk and Lisp are well known for this kind of thing.
Turtles all the way down is a phrase sometimes used to refer to infinite recursion. For example, what is the least integer? There isn't one. -2 is less than -1, -3 is less than -2 and so on. There is no bottom. The original source of the quote was an answer to the question of "If the world is on the back of a turtle, what does the turtle stand on?". Anyway, it doesn't have any programming specific meaning that I know of.
It is sometimes used to refer to 'pure' object oriented (or functional) languages. In a.o. java, c#, c++, Objective c and Delphi, there are native types (int) that don't behave like objects. The illusion is maintained much better in Smalltalk.