PS: Yes, I know, if it would be a web api, I'd need to do play the same games with strings there.
But there it's at least obvious why it is needed (and it would also be less tedious in a modern scripting language, compared to dealing with string in raw C).
Again, I'm not really complaining. I'm just wondering whether one would still solve it in the same today in a brand new OS.
Microsoft has powershell and it’s a properly good tool for manipulating objects.
Strings are easiest to manipulate using string manipulation tools, which unix/linux/posix has plenty, and no standard way to expose objects. Perfect is the enemy of the good here.
I hope support for structured text output becomes more common. For example, the `ip` set of tools can output data in JSON, which is safe and easy to destructure and extract whatever fields you need. Seems like a nice middle ground.
But there it's at least obvious why it is needed (and it would also be less tedious in a modern scripting language, compared to dealing with string in raw C).
Again, I'm not really complaining. I'm just wondering whether one would still solve it in the same today in a brand new OS.