Repeated strings and optimisation
Posted: Sat Mar 21, 2020 2:27 am
My app has a lot of repeated hard-coded literal strings of "Done" throughout (about 60). Does PureBasic create a new internal string for all these occurrences, or does it make one single reference to it and call that every time "Done" is used in my code? In other words, should I perhaps set Global done$="Done" instead and used done$ throughout my code? Is that a better for optimisation? Or maybe as a constant?
I haven't used a Global variable for it yet because that makes it harder to see in my code (due to not being highlighted as a literal string anymore, which is important for me).
I haven't used a Global variable for it yet because that makes it harder to see in my code (due to not being highlighted as a literal string anymore, which is important for me).