The main differences:
1.) you can use the "normal" output syntax, for example, the echo operator. You do not need to rewrite your problem.
2.) You better control buffering, as buffers can be stacked. You do not need to know about naming conventions, etc., This simplifies the implementation when the record and use sides are implemented separately from each other.
3.) No additional logic requires the output of buffered content, you just flush . It is especially interesting if the output stream is something special. Why burden a control volume with this?
4.) you can use the same output implementation, regardless of whether the output buffer was created. This is a matter of transparency.
5.) you can "catch" accidentally inflated things, such as warnings, etc., and just learn them later.
[...]
source share