理解defensive programming

本文探讨了防御编程的概念,包括如何通过assert和try/except等机制来增强代码错误处理,确保在未知环境下程序的稳定性和安全性。特别关注了与计算机安全相关的secure programming在防御编程中的应用。
  • Defensive Programming

    Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software under unforeseen circumstances.

    Defensive programming practices are often used where high avaiability, safety, or security is needed.

    Secure programming is the subset of defensive programming concerned with computer security.

  • 简单理解

    加入assert,try/except等功能,让代码可以更好的应对error

  • References

  1. Programming with Python: Defensive Programming
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值