On Thu, Feb 23, 2023 at 10:34:32AM +0100, Michael Heerdegen wrote: > writes: > > > > Is it better just to assume in functions that the current buffer is > > > the data buffer and work on that, instead of passing data as > > > function arguments? > > > > That depends on your style and on the "contracts" you make > > with yourself (and ultimately, of course, on what you are > > trying to do: for each different purpose, some style will > > be clearer/more efficient -- ideally both, but life and > > things). > > And there is not only garbage, there is also the aspect of speed: many > operations can be performed in buffers and likewise for strings, but > sometimes operations are a lot faster for strings (modifying a buffer is > a more complicated operation). And then, if you have the right garbage collector, creating some garbage might be faster than modifying things in place (if some stars align, and you take into account other things and all that :-) Cheers -- t