logic for upper lower case spelling in UnityScript?

I would prefer if it were all upper or all lower case, for example

Transform.Position
Transform.LookAt
Transform.LocalScale.

instead, it is:

transform.position
transform.LookAt
transform.localScale

what is the logic behind these upper lower case protocols? how long does it take to figure it all out? do you like it? do you think it is logical?

All programming languages have naming conventions. If you follow them, you make it much easier for others to read and understand your code. Life is much better when you can look at some code and say: "Oh, that must be a function because it starts with a capital letter."

2 Answers

2

Variables start with lower case, and methods start with upper case.

Both use camelCase for multiple word identifiers.

You actually wouldn’t prefer it if they were all upper or lower case. For example, Transform is not the same as transform. Transform is a component, transform is a GameObject variable, which is short for GetComponent(Transform). Yes, it is logical. Since functions are uppercase, you can tell at a glance that LookAt “does something” whereas localScale is a variable. Which is why code you write should stick with the same standard.