Re[9]: Ах да, мое решение :)
От: Mamut Швеция http://dmitriid.com
Дата: 10.04.15 13:29
Оценка:
EP>Кстати, вот выступление John Lakos из Bloomberg по поводу предусловий, assert'ов и defensive programming: "Defensive Programming Done Right"

Я из другого лагеря

3.13 Do not program "defensively"

A defensive program is one where the programmer does not "trust" the input data to the part of the system they are programming. In general one should not test input data to functions for correctness. Most of the code in the system should be written with the assumption that the input data to the function in question is correct. Only a small part of the code should actually perform any checking of the data. This is usually done when data "enters" the system for the first time, once data has been checked as it enters the system it should thereafter be assumed correct.

...
The caller is responsible for supplying correct input.




dmitriid.comGitHubLinkedIn
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.