IT界討論區(58) 唔講上一份人工

1001 回覆
6 Like 0 Dislike
2019-03-09 12:05:48
所以啲人問

你最多係用邊個 Design Pattern sounds like an on9 question
2019-03-09 12:16:43
用我上面句野答
2019-03-09 12:17:44
and no two patterns are the same
2019-03-09 12:42:27
Yes ar

Actually I use the most consistent is Singleton
2019-03-09 13:09:27
Singleton
2019-03-09 14:10:39
決定左有咩feature之後先決定用咩design pattern囉
2019-03-09 14:19:15
從來都唔用
鳩寫爛曲算
行到咪得囉

singelton又要factory
搞咁多做乜?
有野咪new出黎用吓囉
2019-03-09 14:30:06
t巴真係好正
2019-03-09 14:52:22
2019-03-09 15:00:00
唔執你手尾
2019-03-09 15:00:57
So you will think about which design pattern to use before actually writing?
2019-03-09 15:01:53
Yes ar
But even when I refractor I only follow DRY code and Single source of truth
2019-03-09 15:02:08
What’s wrong
2019-03-09 15:59:50
真係咁寫架喎
普通application 根本寫到靚一靚同諗到乜就寫乜出黎係冇分別
除非玩big data同好講performance 架啫
2019-03-09 16:00:31
一個大class搞哂所有野
2019-03-09 16:07:25
100K 月薪 and 100K lines of code
2019-03-09 16:08:58
singleton好多時係為寫而寫
2019-03-09 16:10:44
MVC need single data model wor
2019-03-09 16:12:48
同用唔用singleton 係兩樣野黎
我睇法係好多野用singleton 都係哂鳩氣
2019-03-09 16:13:37
But every app I developed always have 1 Singleton

Only 1 tho
2019-03-09 16:17:48
乜先
同埋你以前玩java就話冇得揀
你寫c#有static class
static class定singleton 都有排拗
2019-03-09 16:25:13
咪諗下寫下諗下寫下咁既feedback loop囉 唔係完全唔諗 亦唔係落左決定就永世唔改
2019-03-09 16:27:17
I no chance C# la
Full time iOS dev
2019-03-09 16:29:03
又唔完全係為寫而寫
如果有N個class 本身啲object reference chain係好精巧既
但係你要改 要跨幾層class 而你既上一手同事又唔知死左去邊
咁最簡單咪就係改某啲class做singleton
最好一定係了解成個設計意圖 然後fit入去個chain到
但係同上一手同事有不可跨越既時空距離 都唔係我可以控制到既事黎...
2019-03-09 16:29:11
你有backend架嘛
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞