memesearch
A Sad Story About Temporary Buffers

A Sad Story About Temporary Buffers

Download Find similar pictures
Text on the meme
A Sad Story about get_temporary_buffer When the C++ STL library was designed by the first author of this book, he realized that it would be helpful to have a function get_temporary_buffer that takes a size n and returns the largest available temporary buffer up to size n that fits into physical memory. As a placeholder (since the correct version needs to have knowledge that only the operating system has), he wrote a simplistic and impractical implementation, which repeatedly calls malloc asking for initially huge and gradually smaller chunks of memory until it returns a valid pointer. He put in a prominent comment in the code saying something like, “This is a bogus implementation, replace it!” To his surprise, he discovered years later that all the major vendors that provide STL implementations are still using this terrible implementation—but they removed his comment.
What it means

A book excerpt tells the story of a deliberately crude C++ implementation of get_temporary_buffer that was supposed to be replaced. Years later, major STL vendors were still using it, but had removed the warning comment. The joke is about temporary placeholder code becoming permanent production code. EN: A book excerpt tells the story of a deliberately crude C++ implementation of get_temporary_buffer that was supposed to be replaced. Years later, major STL vendors were still using it, but had removed the warning comment. The joke is about temporary placeholder code becoming permanent production code.

Objects
Tags
Source
Type
image
Size
800×436 · 90.0 KiB
Mood
ironic, relatable
Language
en
Added