In this week's slog, I will
revisit my earlier SLOG and check my earlier ideas.
In my week4's slog, I
wrote:"self was very trick for me. But I decided not to understand but to
remember it! For every method in a class, remember writting
self!!!" However, now I understand that "self" is just the
class itself. So when we call method in a class, "self" tells system
which class is used.
In week7's slog, I wrote my point of view for benefits of Object-Oriented Programming. Now after finishing my assignment 1&2&3, I get another point. Using class is quite convenient to add something new to your code! In assignment 1, we wrote "subtract_square_state.py" and in assignment 2 we wanted to write another game state called "tippy_game_state.py". By using class we can keep "subtract_square_state" in place and wrote another class inherited from super class "game_state".
(Here is the result in python shell after running "Game_view". By using class we can choose the game which we want and choose strategy.)
In my view, it is efficient if the program is huge.I also find that it is efficient for "debug" because we can choose different games to check our code as we want.
Another point which is worth mentioning about OOP is that I find our code is much easier to understand by using class.
For example:
I found something useful in her slog. In week 7, she gave a summary for abstract data types. After giving a summary for each type, she provided a website link such as:
"http://interactivepython.org/runestone/static/pythonds/BasicDS/TheStackAbstractDataType.html"
I visited those website and found it is quite a good summary for abstract data types!
It gives a summary for each data type and give an example for each method!
I have highlighted this website! Thank you Celina~!



















