CodeSOD: Never Bother the Customer |
Matthew H was given a pretty basic task: save some data as a blob. This task was made more complicated by their bosss core philosophy, though.
Never. Bother. The. Customer..
Right, but if the operation fails and we cant continue?
Never. Bother. The. Customer.
Okay, sure, but what if they gave us bad input?
Never. Bother. The. Customer.
Okay, sure, but what if, by hitting okay, were going to format their entire hard drive?
Never. Bother. The. Customer.
As such, for every method that Matthew wrote, he was compelled to write a safe version, like this:
protected void SaveToBlobStorageSafe()
{
try
{
SaveToBlobStorage();
}
catch (Exception ex)
{
}
}
No errors, no matter what the cause, were ever to be allowed to be seen by the user.
| Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |