I don't want to start a religious war or anything, so please forgive what might be a loaded question. I know people can get very passionate about coding style.
I seem to have a buffer overrun issue in a sketch, and some of my googling revealed that... some people feel pretty strongly that String family functions are bad news, should not be used, don't manage memory properly, and possibly rot your teeth and make your hair fall out. And can lead to buffer overruns.
Is this one of those "old Turk" things? There are always traditionalists in coding style as in everything else. Or is it really something to beware of? Is the Arduino implementation of String sloppy?
I use String a lot, because I come to Arduinistan from the world of weakly-typed high level scripting languages, with really strong string processing functions. Trying to manipulate strings as char pointers etc feels so clunky to me, almost like going back to assembler. So I do use String everywhere because it's quick and powerful and easy and feels less alien than wrestling with all that type transformation and pointer management.
But if String is bad news, like "a disaster waiting to happen," then I guess I should grit my teeth and start eliminating it from my handwriting. So I appeal for opinions:
- Is String dangerous even when used correctly?
- Is it very easy to use it incorrectly?
- What are the most common mis-uses of it, if so, that I should be looking for in my code as I hunt for the horrid memory management goof that has stopped my project dead in its tracks?
PS I do have all compiler warnings turned on, and I make sure I have either eliminated or at least well understood every warning before I throw code at the Arduino.