> For the complete documentation index, see [llms.txt](https://gyx8899.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyx8899.gitbook.io/blog/checklist/codetips.md).

# 代码教鞭：不值得犯第二次的错

抓住每一个进步的机会，不管他是在开发中、 Code Review 中、测试中、线上 bug 中，都要整理出来，不踩第二次坑。

## 编码思想

## 编程语言

### `Javascript`

* 善用 `try {} catch (e) {}`

  使用第三方 `library` 或不熟悉的组件 API，尽量使用 `try catch` 包裹，除非你对使用的 API 有足够的把握不爆 bug, 特别是输入数据类型和边界条件。从而保证在 API 报错时不对页面造成影响，同时输出报错信息。
