It's a common practice in Unity to start the name of a scene, prefab, etc. with an underscore so it will be listed first in the project window.
This is because things are sorted lexicographically and underscores come before letters in ASCII, right?
Well, no.
So what the heck is Unity using to sort things? Did they ... did they really add the underscore as a special case?
@peterdrake Sorting by ASCII order would be terrible anyway because then upper and lower cases of the same letter would end up in totally different sections in the results. Any competent alphabetic search would split and sort between letters, numbers, and punctuation first.
Also, I have not heard of using the underscore that way. That sounds like a sign that you need to refactor instead of hacking stuff in. I always name things based on their form/function. If I prefix it with anything, it's the type (i.e. "MatSteel")
@peterdrake @andykorth Maybe I've just gotten used to the .NET/Windows way.
Here's some more info about how it works behind the scenes: https://learn.microsoft.com/en-us/dotnet/api/system.globalization.compareoptions?view=net-7.0
@LouisIngenthron @andykorth Thanks.
I can't imagine how I would have ever found that page, even if I was looking for it.
@peterdrake @andykorth I went to the String.CompareTo page first, and it led me there.
@LouisIngenthron @peterdrake Oh nice find, that's a much better document than I found!