|
課程摘要 |
第一週
(106/02/21) |
- 課程簡介
(b&w,
videos:1,2),
課程大綱, 參考書籍, 線上資料
- 以 C++ 製作物件導向程式的核心概念: 物件, 抽象化界面,
封裝, 繼承,
多型
- Homeworks:
|
第二週
(106/02/28)
106/03/02 (四)
補課 INS201/INS203 |
- 學習目標和 C 程式設計, 資料結構, 演算法有一些差異: 希望能夠增進軟體系統的重用,
不要像免洗餐具一樣即用即丟, 希望能夠不斷地透過物件的組合來產生新的軟體: 解線性方程式範例
(b&w),
coder vs. programmer
- Abstract
Data Type (b&w,
video):
[Data Type + Operation] common part which is independent
of all implementations
-
C++ Console I/O (b&w,
videos:1,2,3):
an object oriented I/O library
- Homeworks:
|
第三週
(106/03/07) |
- Making
and Using Objects (b&w,
videos:1,2)
- Objects
and Classes (b&w,
videos:1,2,3)
- Homeworks:
|
第四週
(106/03/14) |
- Objects
and Classes (b&w)
(cont'd)
- scanf
的進階用法 (b&w,
video)
-
A "Better" C Program (b&w),
codes
- Homeworks:
- read Chapter 3, 4
- testScanfReg1.cpp
- Google
C++ style guide, local
copy
- Common
C Programming Errors, local
copy
- Common
C++ Programming Errors , 2nd
link, local
copy
- How
to Debug Programs, local
copy
- Assertion
(b&w)
- detecting
memory leakage, local
copy, src1, src2,
src3
|
第五週
(106/03/21) |
- C++
as a better C (b&w,
videos:1,2,3)
:
- single line comment
- struct, enum, union tags are type names
- new iostream library (object oriented
usage, type sensitive usage)
- cooperating with stdio (ios::sync_with_stdio())
- variable declaration on the fly
- definition vs. declaration (variable
and function)
- function signature and name mangling
- parameter defaults
- #define vs. const variables
- new and delete
- stricter typing system
- typedef
- reference
(b&w)
- global scope resolution operator
- bool
- explicit
type conversion
- Reference
(b&w)
-
Complex C/C++ Type Definitions (b&w)
- Dynamic
allocation of 2-dimensional array in C (b&w)
- Homeworks:
|
第六週
(106/03/28) |
- Procedural Programming Example 6Balls
- Object Oriented Programming Example 3Bags
Example (b&w,
video),
codes
- Constructors
and Destructors (b&w,
videos:1,2)
- More
Classes (b&w,
videos:1,2)
(Object composition and ctor, this pointer, return pointers)
- Homeworks:
|
第七週
(106/04/04) |
spring break
下星期 (106/04/13
星期四 21:00) 繳交 作業二
|
第八週
(106/04/11) |
- Common
C/C++ Memory Errors (b&w),
html version
- The
Big Three: Dtor, Copy Ctor, and Assignment Operator (b&w,
videos:1,2,3)
- Homeworks:
|
第九週
(106/04/18) |
期中考 (09:30-12:00), ClosedBook
教室分配表
請提早 10 分鐘到 INS105 / INS B01 找你的座位
|
第十週
(106/04/25) |
- 期中考講解
( video),
成績分佈
-
Friend Classes and Friend Functions (b&w,
video)
- Homeworks:
|
第十一週 (106/05/02) |
- Basic
Object Design (b&w,
video)
- More
Object Design (b&w,
video)
- Homeworks:
|
第十二週 (106/05/09) |
- More
Object Design (b&w)
(cont'd)
-
Operator Overloading (b&w,
videos:1,2)
- Homeworks:
- read Chapter 12 operator overloading
- 兩星期後 (106/05/25
星期四 21:00) 繳交 作業四
|
第十三週 (106/05/16) |
- Operator
Overloading (b&w)
(cont'd)
- Inheritance
(b&w, videos:1,2,3)
- Homeworks:
|
第十四週 (106/05/23) |
- Inheritance
(b&w)
(cont'd)
- Homeworks:
|
第十五週 (106/05/30)
106/06/01 (四)
補課 INS201/INS203 |
- Advanced
Inheritance (b&w,
video)
- Polymorphism
(b&w, videos:1,2,3)
- Homeworks:
- review Chapter 14 Inheritance and Composition
- review Chapter 15 Polymorphism
and Virtual Functions
- read Vol. 2, Chapter 6 Multiple inheritance
|
第十六週 (106/06/06) |
- Hiding
& Overriding Examples (b&w,
video)
- Generic
Programming (b&w,
videos:1,2)
- Homeworks:
|
第十七週 (106/06/13) |
- Exception
(b&w, video)
- Object
Oriented Design Smells and SOLID Principles (b&w,
video)
這些都是教你如何運用繼承來應付需求的改變, 繼承的語法簡單, 但是錯誤的使用繼承會造成極大的負面效果, 那就不要用吧!! 可是不用它的話,
OOP 不只是跛腳, 根本就斷頭了....
- C++
11 (b&w)
- Homeworks:
- read Vol. 2, Chapter 7 Exception handling
- State
Diagram (b&w)
- 繼承不是萬靈丹 - Strategy vs. Template method,
Direct Inheritance vs. Decorator
- UML
語法介紹 (b&w),
參考資料, UML
簡介
- "An
Open Letter to Object Technology Newcomers", Alistair Cockburn
(local
copy)
- C++11,
FAQ, tutorial
1 by Allain,
tutorial 2 by Kalev, rvalue
reference, Thread,
Smart pointers,
C++11
和快速迭代式開發
- 982期末考,
992期末考, 1002期末考,
1012期末考,
1022期末考,
1032期末考,
1042期末考
請注意: 僅供參考, 每學期上課的內容有相當的調整, 每學期的作業內容也有相當的調整
|
第十八週 (106/06/20) |
期末考 (9:30-12:00), ClosedBook
教室分配表
請提早 10 分鐘到 INS105 / INS B01 找你的座位
查詢自己的期末考考卷與成績
(請至作業欄選取期末考)
參考答案, 成績分佈
尾聲
|
|
C++ sucks because you will get C back.
唉呀呀! 是 postfix 的 operator++(int), 難怪很多同學辛苦地學了一個學期只得到 C, 包括成績還有寫出來的程式都是,
名字一開始就取錯了嘛, 改名叫做 ++C 或是 B 的話, 至少會學到一點和 C 不一樣的東西, 叫做 ++++C 的話 (那不就是 A
了), 說不定大家都輕鬆地學會了 XD (咦, prefix 的 operator++() 有 lvalue? 是耶)
|