尤川豪   ·  2年前
445 貼文  ·  275 留言

Elm - 檔案越少越好,長度越長越好

https://guide.elm-lang.org/webapps/structure.html

I encourage you to push your limit on number of lines! See how far you can go. Try using comment headers, try making helper functions, but keep it all in one file. Having this experience yourself is extremely valuable!


Some folks see The Elm Architecture and have the intuition to divide their code into separate modules for Model, Update, and View. Do not do this!


It leads to unclear and debatable boundaries.


If you build each module around a type, you rarely run into these kinds of questions.


Actively trying to make components is a recipe for disaster in Elm.

  分享   共 696 次點閱
共有 0 則留言
還沒有人留言。歡迎分享您的觀點、或是疑問。
您的留言
尤川豪
445 貼文  ·  275 留言

Devs.tw 是讓工程師寫筆記、網誌的平台。隨手紀錄、寫作,方便日後搜尋!

歡迎您一起加入寫作與分享的行列!

查看所有文章