2015年2月15日星期日

CSC148 SLOG for week6

This week we were asked to make a summary of Object-Oriented Programming(OOP). My first impression on OOP was that it means ‘class’. However, it has a much more formal and detailed definition on wikipedia: Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which are data structures that contain data, often known as attributes; and code, often known as methods. In CSC108, most of time, we were using procedural programming, another paradigm. While procedural programming pays attention to writing procedures(or functions) implement on data, OOP mainly focuses on objects which contain both data and functions.

There are several essential concepts covered by OOP:
Objects: Instances of classes. Simply speaking, it stores properties of a thing in a class to some  location.
Class: A blueprint of a program. It’s like to describe something you want in your own way. To make a class, it’s important to form a delicate structure first. Given an ultimate goal, you need to figure out attributes(usually noun) and behaviors(usually verbs) and assign accurate types for them to accomplish your goal in a better way.
Methods: Operations on objects. You can change some of properties of an object through some methods you create by yourself.
Inheritance: Preserve properties. When you are creating a subclass, you can use inheritance to maintain the same properties between superclass and subclass which can simplify your code to some extent.

2015年2月6日星期五

CSC148 SLOG for week5

It has been a month since I took this course and I gradually find it is much more challenging than CSC108. The biggest difference between those two courses is that I need to care about the structure of a program by myself. In CSC108, the professor would give us a single function and inform us what it can do by examples. We just need to write a right code for it. Now, we are given an ultimate goal for a program and we need to make an overall design to make it come true. Although it is more complex, it makes me feel I'm a real programmer.


I took the first term test of CSC148 this Wednesday and I want to make a summary of it. Actually, I made a huge mistake in preparing this test—not checking piazza frequently! I hadn’t attached enough importance to piazza before took this test since I thought I could handle the course material without discussing with others. In fact, I was wrong. Looking through others’ questions and answers to those questions is of great benefit to understanding the course content and preparing for the tests. Without checking piazza, I had no idea what contents would be covered by this term test. Therefore, I reviewed much more than the range of this test and couldn’t focus on the key point of it(for example, I spent lots of time on Abstract Data Types). I didn’t even know we could bring an aid sheet to the exam. Fortunately, questions in this test didn't require me to look an aid sheet for help otherwise I might have freaked out during the test! In a word, I will get used to using piazza as soon as possible and make the best use of it.