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

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
  分享   共 1,098 次點閱
按了喜歡:
共有 0 則留言
還沒有人留言。歡迎分享您的觀點、或是疑問。
您的留言
尤川豪
445 貼文  ·  275 留言

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

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

查看所有文章