Hacker News new | ask | show | jobs
by deathanatos 1413 days ago
> and one can legitimately argue that it is clunky, verbose and error-prone.

Clunky and verbose, yes, error-prone no. The APIs that do that are generally much more clear about ownership, and thus much easier, IMO, to write correct code for. Much worse is the API that returns you a pointer with no obvious mechanism to free it. Is it tied to the lifetime of an input to the function that returned it? Is it a global and this API is completely thread-unsafe? Am I leaking memory?