Error Handling and Debugging

原创 2013年12月05日 15:27:38

Proactive Debugging

  • Comment, comment, comment. Put a lot of comments in your program. They tell other programmers what you did. They also tell you what you did. 
  • Use  a  single  macro  to   define  a  constant  value  that   is   or   may  be   reused   so   that   we  only   have  to   change   it   in   one  place.  
  • Use the "KISS" principle. (Keep It Simple, Stupid.) Clear and simple is better than complex and wonderful. 
  • Use the "DRY" principle.(Don't repeat youself.) Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  • keep in mind "The Law of Least Astonishment," which states that your program should behave in a way that least astonishes the user.
  • Turn on all the warning flags, then make your program warning free. 
AS DEVELOPER
  • Baby  steps  for  the  engineer: test   the  code   every  20  to   50  lines
  • Regression testing: running  the  same  old  tests   on  new   pieces  of   code 

AS FINDER

  • Never  assume   anything.  Never  assume  that   the  tools   are  working  flawlessly.  Never assume   that   the  hardware   is   good. 
  • Never  changing   more  than   one  thing  at a  time
  • Write a  few   notes  about  what   change   was  made  and  what   behavior  was  observed

AS FIXER

  • provide  feedback to   the  engineer  or   engineering   group  that   introduced  the  bug.



相关文章推荐

Eloquent JavaScript 笔记 八: Bugs and Error Handling

这一章讲Strict mode、Testing、Debug、Exception和Assert。终于遇到比较简单的一章。...

systematic error handling in c++

  • 2016年04月08日 12:11
  • 278KB
  • 下载

Scala新手指南中文版 -第六篇 Error Handling with Try(用Try来处理错误)

译者注:原文出处http://danielwestheide.com/blog/2012/12/26/the-neophytes-guide-to-scala-part-6-error-handlin...

The Big Book of PowerShell Error Handling

  • 2017年11月13日 10:44
  • 1.94MB
  • 下载

SSIS Error Handling

  • 2013年07月28日 13:57
  • 795KB
  • 下载

JAVA 复习(Think In Java, 4th) -- Error Handling with Exceptions

这是读 Think in Java 的 Error Handling with Exceptions 章节所整理的心得笔记~

RFC6455-The WebSocket protocol 之八:7. Closing the Connection & 8. Error Handling

7.  Closing the Connection

C++标准库 Error handling cassert cerrno

该系列博文主要参考自 cppreference.com 和 cplusplus.com 由于博主水平有限,内容仅供参考 cassert  其中只有一个宏函数assert #ifde...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Error Handling and Debugging
举报原因:
原因补充:

(最多只允许输入30个字)