This makes the common pattern of NewResource, SetName, easier. It also makes it less likely for you to forget to use SetName.
For GAPI front ends that want to know what fields they can use and which they map to, these two functions can be used.
Resource sorting is needed for comparing resource groups.