I was not trying to suggest...
I was trying to get your opinion about the "safety" of using languages that have in-built GC on a PC?
Well, the word "safety" can trigger all kinds of requirements, so let's just say "risk of slowing down over time." The answer is that, just like when using malloc/free, it isn't difficult to write code that makes it hard or impossible for a GC to do its job. With some care you can mitigate the risk. Anything that gets "deployed" and that could have "serious" consequences will/should be reviewed and profiled to catch the naughty behavior. Most software doesn't go through that process, so you can expect most software to exhibit the problem. Empirically, slowdowns obviously happen and it's not because electrons are tired.
I just want to know if a person can write a program using (for example) one of the .NET languages or Python or Ruby or Java without having to worry about memory leaks due to poor garbage collection?
A comprehensive answer. Thank you.And, at the end, nicely linked to the Arduino system....R
Yes, if you're philosophically ok with heap-based memory allocation, String works fine.For cases where you incrementally increase the length of a String, the reserve() function lets you pre-allocate the memory, which is far more efficient and often avoids memory fragmentation issues.