[Tutor] Questions about classes

R. Alan Monroe amonroe at columbus.rr.com
Tue Nov 13 04:13:42 CET 2012


> 2. Why use a class in the first place? What is the purpose of
> constructing a class instead of just writing a program with a bunch
> of functions?

Sometimes, you DO just write programs with functions.

A class can be useful if you have a bunch of a thing. Like a monster.
Each monster can know its own location, hitpoints, etc.

Alan



More information about the Tutor mailing list