two nOOb coding questions
first question
I have noticed that many tutorials declare a variable and then assign a value in the start function. is there an advantage to this over declaring and assigning it right off?
as in:
private int amountSpawned;
private bool gameOver;
void Start ()
{
amountSpawned = 1;
gameOver = false;
}
vs:
private int amountSpawned = 1;
private bool gameOver = false;
which is better practice and why ?
2nd Question.
when I use camelback notation I always leave the first letter not capitalized “likeThis”. But I have noticed that scripts tend to be capitalised from the first “LikeThis”. Should I do it for all classes ? functions? What is the best practice here that will help my coding be clear to others?
Thanks for your help.