Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
231
第 20章
调试
“调试”或许是一个“不吉利”的词,因为它与缺陷关联在一起。但实际上,我们所说
的“调试”是一种你一直在做的活动,不管是在实现一种新特性,还是在学习某个东西的
运行机制,又或者是在修正一个
bug
。或许
“探索”是一个更好的词,但我们将继续使用
“调试”,因为“调试”所指的活动不是模棱两可的,也不管活动的动机如何。
调试是一项常常被忽视的技能。似乎大家都觉得,绝大多数程序员生来就知道如何调试。
也可能是计算机系的教授和技术图书的作者觉得调试很简单,以至于对其都不重视。
事实上,调试是可以进行教学的技能,而且调试是理解一个东西的重要途径。通过调试,
程序员得以理解他们所工作的框架,也得以理解他们自己以及团队的代码。本章将讨论一
些工具和技术,你可以把它们有效地用在
Node
和
Express
应用的调试中。
20.1
 调试原则第一条
正如其名,“调试”常常是指查找和清除缺陷的过程。在开始讨论工具之前,先来考虑一
些一般的调试原则。
“我跟你说过多少次了,当你排除了所有的不可能,剩下的无论有多么离奇,也
必然是真相。”
——
Sir
Arthur Conan Doyle
调试原则第一条,同时也是最重要的一条是
排除
的过程。现代计算机系统复杂得不可思
议,如果必须把
整个系统
都装进脑袋里,并在这巨大的空间中搜寻某一个问题的来源,那
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115565099