Error Handling and Debugging

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.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值