2015年1月30日星期五

SLOG 2

The past several weeks seemed busy and interested since we have been learning something different and complicated, and they were attractive as well. Some new knowledge was introduced to us, including  the concept of building a class and writing its method.
At first, Professor Danny used some simple examples to make us understand the basic steps of creating a class. For example, when we want to own a tool that can calculate the area of any triangle, we should firstly create a class that is called Triangle, and give the concept of a triangle. Don't take it as a stupid work, since some day we may have to solve problems that are much more complex, and the basic concept is very significant. Then we have to write definitions of the area, and we can call it triangle_the_area. After giving the docstrings  of the definition, we can finally write the method of the definition, which is so-called most important and difficult part of a class.
during the next Weeks, we also learnt how to raise the Errors, by using
The method Exception. With this method, we can easily find out some Errors that may be tough to catch or may cost us a lot of time. That can help us write function more accurately and save ours time, so I think it is important for us to use it when necessary.

没有评论:

发表评论