Mufasa explains C++ to Simba
Posted: Fri Aug 09, 2013 6:11 pm
I took this from a reddit post here: http://www.reddit.com/r/explainlikeIAmA ... ly/cbjwllc
But, I have a good feeling that people on this board will love it
Look, Simba. Every pointer that malloc returns, that is our memory space.
Wow.
A programming language's time as ruler rises and falls, like the sun. One day, Simba, the sun will set on BASIC's time here and will rise with C++ as the new king.
And this virtual memory will all be mine?
Everything.
Every pointer that malloc returns... What about that undefined place?
That causes a segfault. You must never dereference there, Simba.
But I thought C++ can do whatever it wants.
Oh, there's more to being a great program language than... accessing random memory all the time.
There's more?
Simba...
All the code you write exists together in a delicate balance. As the programmer, you need to understand that balance and respect all data from the lowly byte to the powerful object.
But don't we free lots of objects?
Yes Simba, but let me explain. When we program, our ideas become the code. And the objects come from our code. And so we are all connected in the great Compiling of Life.
But, I have a good feeling that people on this board will love it
Look, Simba. Every pointer that malloc returns, that is our memory space.
Wow.
A programming language's time as ruler rises and falls, like the sun. One day, Simba, the sun will set on BASIC's time here and will rise with C++ as the new king.
And this virtual memory will all be mine?
Everything.
Every pointer that malloc returns... What about that undefined place?
That causes a segfault. You must never dereference there, Simba.
But I thought C++ can do whatever it wants.
Oh, there's more to being a great program language than... accessing random memory all the time.
There's more?
Simba...
All the code you write exists together in a delicate balance. As the programmer, you need to understand that balance and respect all data from the lowly byte to the powerful object.
But don't we free lots of objects?
Yes Simba, but let me explain. When we program, our ideas become the code. And the objects come from our code. And so we are all connected in the great Compiling of Life.