Api Casing

Why is Unitys casing completely contrary to both C#/Microsoft guidelines, the .NET framework and almost every other 3rd party/ .NET developer? It’s really frustrating when trying to write conventionally cased code.

I have used Unity on and off since version 1.6 (I think. It was a long time ago and mac only at that point) and vaguely remember a time when it wasn’t so wrong and then after a break coming back to it a few years ago realising it was completely broken.

Searching the forum yields this statement:

“We follow the MS convention. Properties are all Pascal case. Fields that are less than public are camel case. That being said - I don’t think we have any fields that are public; or at least very few. We try to expose everything via properties.”

So I guess the question is where or why did it go so wrong?

I think it’s a relic from UnityScript (which used camelCase), where they wanted to be consistent across both languages with how properties were accessed.

Now that UnityScript is obsolete, they have started adhering to the C# convention more when adding new features such as the new input system, but the old stuff such as gameObject.transform is still kept, likely so that they don’t create breaking changes by updating them.

This is all just my speculation though.