Java 會唔會俾JavaScript 收皮

323 回覆
9 Like 224 Dislike
2021-07-26 00:03:39
docs睇過兩野,唔駛上堂啦,求其試下get started 都得啦,試下個framework,又要買course,咁幾皮野都唔夠玩
2021-07-26 00:07:34
其實有份工用過下,
睇 get started諗住無問題但一用嚟就發覺好多位要自己摸

有啲人話 同angular似 但冇用過唔清楚
2021-07-26 00:12:43
如果你試get started都唔係好順,一係佢assume 你識某啲野(其實唔係個個都識),一係個framework唔係好成熟,一係open source 啲人唔係好得閒update doc

我試過幾個frontend framework (Vue, alpine)都好易上手,backend (django / flask / fastapi)都好簡單
2021-07-26 00:28:06
見你話 nest 都幾好 以為你有經驗啫
2021-07-26 00:33:10
我見佢啲doc似樣,update得幾密,github 有好多人save 左,上網research 左一陣,又有人推介,應該無咩伏喳

如果做細project,試一陣,無咩大問題都ok la,nodejs本身行async;

我個stack 係python, 宜家python 要行async 仲難搞
2021-07-26 00:40:36
I see…

其實都一年前,果陣大 project,好多用法其實有,但搵唔到點做,之後見到啲人話要上佢個 course 先講清楚咁

咁老實 成套都幾好嘅 幾完整,但好多嘢唔知點做,要搵起上嚟惡搞啫

Python就唔熟了 其實冇 async ,係咪基本上做唔到 real time app
2021-07-26 00:50:07
python唔係無嘅,最新係有async嘅,不過啲framework, library未支援好,做live chat好似要用個叫channel既library,我未試過

不過node應該係易啲,因為佢自帶async,食concurrent requests 又食得多,畀我揀多次都上node唔上python 做web app

我自己通常去subreddit 度問,有好多得閒會答你
2021-07-26 01:46:53
真心建議用nestjs 之前,要學識左decorator 先,佢所有component 離不開decorator , nest 既library typeorm 又好, jwt auth passportjs 都好,例如wrapper @nest/common , @nest/passport-jwt...etc

起碼要知道decorator 起run time 時執行, method decorator 既descriptor value 個d @Get @Post constructor 係用DI 吉入去
2021-07-26 19:44:02
睇住呢堆di同decorators,就諗起Java嘅spring framework

見到都反胃
2021-07-26 20:14:27
我真心中意laravel 但太多人對寫php好抗拒以個人project 黎計, Taylor Otwell 做得太好單係你諗到既位都有官方support 比起nest 用哂第三方野隨時出事 好似typeorm future 咁

https://github.com/typeorm/typeorm/issues/3267
2021-07-26 20:16:14
react
2021-07-27 19:39:11
2021-07-27 20:02:54
IoC前提係你寫緊OO
如果你緊arrow function, 想問你可以inject啲咩?
如果你鐘意functional programming, curry, higher order function先係比較好嘅做法
其次就係好似react咁用hook
2021-08-01 01:51:04
推呀
2021-08-01 13:47:58
推推推

2021-08-01 20:37:33
IoC 係咩?
2021-08-02 19:55:06
inversion of control
2021-08-02 20:51:00
oh ioc 點解fp (唔係haskell 嗰種最純嘅fp)唔用得?應該所以language 都可以implement?
2021-08-03 11:40:33
因為唔需要, IoC 係為咗解決OO 上嘅dependency 問題, 例如:
Class Dao {
    private Pool pool;
    Dao (Config cfg) {
         this.pool = new Pool(cfg);
    }
    getEntityA() {
         ....
    }
}

咁萬一底層嘅constructor 有變動:
Pool (Config cfg, int size, Other other) {
   ...
}

咁上層嘅object 都要跟住做修改, 分分鐘要改n層嘅野
所以相對上寫成下面咁會易啲maintenance:
Class Dao {
    private Pool pool;
    Dao (Pool pool) {
         this.pool = pool;
   }
}

而個pool instance就會由 IoC container 去管理

喺fp 之下, 會寫成:
getEntityA :: Pool -> IO (Either SomeException EntityA)

又或者:
getEntityA :: (HasPool m, MonadIO m, MonadThrow m) => m EntityA 

咁喺FP 下, 又會點樣寫IoC?
2021-08-03 11:56:20
唔熟java, 但基本上應該所以lang 都可以用callback 去做inversion of control, 去解決code 入面啲logic 嘅問題。 將佢交畀user 寫

同oo 解決inheritance 個dependency 其實差唔多,但純fp 好似haskell 應該會食callback?

https://kentcdodds.com/blog/inversion-of-control
2021-08-03 12:24:13
如果單純係講IoC 個concept, 咁high order function 其實應該都算係IoC?
睇返上面唔係講緊用DI 去 implement IoC咩, 所以我以為係指用fp style 寫spring 個種IoC
2021-08-12 23:08:29
成日更新 一更新d syntax 就唔同哂
利申9up
2021-08-12 23:21:59
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台潮流台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台成人台黑 洞