[quote="StefanL38, post:28, topic:1234679"] why does making the user repsonsible of the proper boundary checking of the array of chars making it even more easy?
[/quote]
Let me give you a trivial example to make the point. Say you send commands over the Serial line and you can send commands such as "stop motor 1,2,3" for example.
if you have a buffer size issue when you concatenate the list of motors to be stopped and only end up with "stop motor 1,2" your code won't crash because of the buffer overflow, the receiver still get a correct command but your program won't do what it was supposed to do and maybe you killed someone because motor 3 is still running...
(this would apply to sending AT commands - for example if you miss the ?when sending AT+CREG? you won't get the response expected, HTTP requests etc... anywhere there is a protocol to follow and possible variable data entry creates a risk)
➜ Hence the developer is always responsible for the code running fine and testing limits is part of good programming practice: not overflowing is good, but it does not help your program to run fine if you don't check for errors before taking actions.
I did not say it's easier, just different.
With c-strings, it's just an array, so I can check against buffer size ahead of an operation or use typical safe functions (strlcat() strlcpy() snprintf()...) which tells me (after trying to perform an operation) if things worked out (and that's what safestring uses - so if they were bad...)
➜ it means I've choice and I won't crash either.
Using safestring you only have to rely on knowledge after the fact that something went wrong.
If you need to know ahead of time, then you need to implement that (and go back to understanding arrays and bounds) and it really means you don't need the safestring in the first place.
The point is that a good program will need testing and the SafeString approach does not bring much added value for that. There is the convenience for some specific usage where it hides more cryptic stuff (concatenate a floating point value on a UNO where snprintf would not do it and need to use dtostrf() for example) but there is a learning curve and it's not a standard library.
So if you are on a path to become a solid developer, you need to master those. Once you have that under your belt, you can feel free to use a library if you want to.
if you don't want to master that and want only quick easy throw away code to deal with only expected data length or accommodate for a bit of flexibility with memory limits, then the String class is better for you.