DEV Community

Discussion on: Explain "Memory Safe Programming Languages" Like I'm Five Please

Collapse
 
ehcanadian profile image
EhCanadian

Image that you have a coloring book and a crayon. There is nothing stopping you from coloring outside the lines if you are careless. There might be nothing outside the line so it's no big deal, or there might be something outside the line that you accidently colored over and ruined. That is NOT memory safe.

Now image that you have a stencil. You have a different stencil for every object on the page, and it's clipped to the page. Even if you try, you cannot color over any other objects. That is memory safe.

Collapse
 
algebramaniacabc profile image
AlgebraManiacABC

This is actually a really great metaphor for buffer overflow! I like it a lot!