Why put them in Photoshop scripts?
I would have to see the context that it was used in as there are many reasons. I used a unique ID as I needed to pass an array from CEP scripting engine to ExtendScript scripting engine or maybe it was the other way. The data could contain a "," so I couldn't use toString() on the array. I put a unique identifier in between each and then split it on the other end. Probably overkill and I'm sure there are better ways and it did add some overhead but it worked. Which is usually why things are the way they are in code sometimes. That is one example for you. Lots of times you want to tag an image unique for database purposes. You see them in CC libraries and XMP.