Classes
摘要
Understanding classes and why they are a vital tool for building large, robust applications is one of the most challenging hurdles many developers must overcome. A class can be thought of as a contract that new objects must obey when they are created. When modeling a user, we might define a User class with a username and a password; every instance of User would contain those attributes. In theory this makes sense, but for developers who don’t spend every day writing code, the idea often feels abstract.