|
|
|
|
|
by cb22
20 days ago
|
|
What matklad said as a footnote deserves a little more attention! A huge benefit is having to think and be explicit about the limits up front. To take your example of arbitrary sized JSON and flip it around: how would you do it normally? Maybe, you'd allocate a buffer to hold your entire object when it comes in - but now you'll end up crashing when you get a large document that exceeds your available memory. Maybe you can do things in a fixed amount of memory, using streaming or chunking - which would be pretty simple to turn to static allocation! Static allocation forces understanding of those limits upfront. |
|