尤川豪   ·  5月前
Exp. 1,778  ·  231 貼文  ·  164 留言

tips on a maintainable codebase

use primitive types. use database id. ignore the performance

  • less assumption
  • less 通靈
  • less double take
  • less possibilities

self contained. reusable. pass in dependencies. configurable

  • front-end: standalone react component
  • back-end:
  • general rule:

spent more time on refactor it. less guess for you in the future, and for all others

  • the design time is worthy
  • modular, reusable. no redundant code

use the design choice that only result in one possibility naturally

  • the naming, the variable type. the function/method

manageable tech debt: make all of them within the own scope.

  • if they don't leak, then it's all fine.

using existing design choice. don't remake the wheels

  • coding conventions. linters

how to design abstraction? design the input/output point at the beginning

  • put in more time on the design phase. and then stick to them in the future.
  • you don't build large apps. you build smaller ones, and integrate them.
  • good for you, also good for teamworks

add stupid but simple tests

  • also add stupid but simple tests.

easy way for abstraction: KISS, increase complexity continously

  • you don't do this when you're experienced

easy way for manage technical debt: no duplicate code

  • be careful the issue: premature optimization Is the root of all evil
  • for tiny difference, split into different code might be better
  • how to balance? experience. split into many in the beginning. merge some of them when you are confident
  • if not sure, keep separate.

  • add examples for both front-end/back-end for all of them.
  • for front-end: add example with/without redux/redux-sagas
  • for back-end: add example with/without database
  分享   共 170 次點閱
共有 0 則留言
您的留言
  贊助本站開發,解鎖進階教材
尤川豪
Exp. 1,778  ·  231 貼文  ·  164 留言

關於作者

Devs.tw 作者,喜歡分享&建造新東西的工程師。

歡迎在 Facebook 追蹤我!不定期分享有趣技術文章!

  查看個人檔案