這是這三週大家可共同維護的筆記。型式不拘,主要方便參與者與講者留存課堂上交流過的資訊。
3 的倍數喊 Fizz, 5 的倍數喊 Buzz, 3&5 的倍數是 FizzBuzz.
#Specification By Example
依長寬高之和計費,每單位(CM)收5元(黑貓)。 10min,帶測試。
依體積計費
程式工程師以 Domain Model 來描述世界並試著解決問題
Domain Model 越擬真,成本越高,在關注議題足夠像就可以了
將資料「bundle」在一起
沒有行為的物件不是好物件
對外介面一樣,實作內容不同 => 接受呼叫者決定意義,而非呼叫者
Static: Overloading 同名 function 但 parameters 不同
Dynamic: Overriding 改寫父類別 function
除了重複利用程式碼外不是目的,只是附帶作用,繼承的最大好處是可以多型。
反之,沒有要多型的時候不要繼承
重構:維持一樣的對外介面,但改變內部設定
需求改變時得到更適合的設計
做一起的事就放在一起
做不同事就分離它們
訂單總價計算器:
Input be like: { "items": [ { "product": "book", "price": 500, "quantity": 3 }, { "product": "pen", "price": 30, "quantity": 4 } ], "transportation": 80 }
無任何優惠:500 * 3 + 30 * 4 + 80 = 1,700
Out: the total price
https://forms.gle/HwCLEJFgH2U4PJP97
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing