public or private

what function does add "public" or "private" and so on in front of "Start"/"Update"`````?

There is no reason to make Start or Update or any other MonoBehaviour functions public. They will be called by Unity regardless so it's best to make them private.

Making it public would allow you to call it yourself from outside the class which probably isn't a good idea.

Most beginner programming tutorials will cover this.

Public means that anything anywhere has direct access to whatever it is.

Private means only members of this class (and by extension, its children) have access to it.

Protected means only this class, its friends, and its children have access.

class Awesome {
 public bool ladeda;
 private function Foo() {}
 protected function Foobar() {}
}

Any object can store a reference to an Awesome (that is, var awesome : Awesome or public Awesome awesome) and access its "ladeda" variable. They cannot access its function Foo, though. And they can only access Foobar if they are declared as friends (I"m not sure how to create friendships in C#/Unityscript, or if it's even possible).

If you then have a

class MoreAwesome extends Awesome {
  public function Do() {}
  private bool no;
  protected bool yes;
}

MoreAwesome objects will be able to access the Awesome functions Foobar and Foo, as well as the private boo lean. Awesome objects won't be able to access MoreAwesome's no (I'm not sure about the yes.)

Basically public means visible to all classes and private means visible to only this class.

actually in public

you can edit the value from the inspector
if you wanna build a variable which uses your control avoid it
in private

 the variable remains inside theprogram 
 you cannot edit it unless opened the script
 use this when building a variable which uses your control to do actions

hope this helps

One noteā€¦

Classes and structs that are declared
directly within a namespace (in other
words, that are not nested within
other classes or structs) can be
either public or internal. Internal is
the default if no access modifier is
specified.

From Access Modifiers - C# Programming Guide - C# | Microsoft Learn

When I go through the tutorials I change them to private explicitly. It also allows me to flag that method/member as something I have read already and understood. I also convert the variables to var for the same reason.