Another bugbear I’ve come across lately: Please answer the following question without mentioning the terms “heap” or “stack”: –
What’s the difference between .NET reference and value types?
I’ve asked a number of people this question lately, and, without fail, all of them have answered that the former are allocated on the heap and the latter on the stack. That is indeed one difference, but it’s an implementation detail. It could change tomorrow and your code would still behave in the same way. As a developer of a .NET language, it has a much smaller impact on how you write code than the real answer.
So what’s the real difference between the two? It’s how they behave when passed between methods i.e. value types are copied whereas reference types refer to the same instance.
Most everyone I prompt knows this, but do not think to say it when asked the original question.