Objects are an organizational tool like functions that go one step further in the same pursuit, near and dear to every programmer, REUSE of your code and ENCAPSULATION OF COMPLEXITY. Objects allow you to put functions and variables into a single package. This allows you to better compartmentalize, divide and conquer, the various challenges of your project. Crafting what functions and variable should be lumped into an object is more of an art than a science. The true beauty of these object oriented design techniques becomes very apparent when things get complicated. We will not yet go into all the nomenclature and techniques to object oreinted design such as inheritence and polymorphism. For now you will feel the benefits of having your variables and code living together one package even with simple programs.
SnowFlake(int _x ,int _y){ //constructor
xpos = _x; //put parameter variables into instance variables with longer scope
ypos = _y;
}void move(){ //methods
xpos = xpos + 1;
ypos = ypos + 1;void draw(){//methods
ellipse(xpos,ypos,10,10);
}
}