Quote Originally Posted by mickey View Post
I think one reason of managed heap was have code more secure (from programming error).
But from what kind of errors? What is so error prone with allocating data on stack?

Then what's the reasons to permit objects on the stack instead of heap? (is it useful and when? I don't see any reason to have obj on the stack [apart a bit speed])--
Stack allocated objects will automatically be destroyed when they go out of scope. That makes it easier to use them compared to heap allocated objects and it prevents memory fragmentation.