69

适当地引入防卫性编程 | Harttle Land

 6 years ago
source link: http://harttle.land/2018/02/07/defensive-programming.html?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Anything that can go wrong will go wrong. – Edward Murphy 防卫性编程(Defensive Programming) 是指限制对程序的不可预见的使用,增加软件的安全性。 防卫性编程在程序鲁棒性、可维护性上都有帮助,尤其是在你不幸地选择弱类型语言编写源码时。 在 C++ STL 程序设计中,我们称函数模板和类模板为 隐式接口,这些接口描述了编译期多态。 在 JavaScript 中,接受一个对象时也不需要声明其类型,只有后续对它的使用方式描述了它的接口。 Harttle 把 JavaScript 中的这一现象称为 隐式接口。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK