Re: Quick sanity check ...
| From: | guilhermeblanco@gmail.com | Date: | Wed, 20 Apr 2016 20:07:56 +0000 |
| Subject: | Re: Quick sanity check ... | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92573@lists.php.net to get a copy of this message | ||
The question here is how type strictness would benefit the language.
I agree with you on most parts. But still... if the class was declared like
this:
class CancelOutdatedOrdersDTO {
public int $olderThan;
}
Wouldn't that be solved entirely? Code would crash (through a TypeError),
it would never be pushed to production and we would never have experienced
this problem.
PS: I just gave one example... we didn't actually loose 100k, but I had to
spend an hour manually addressing the sales back to pending status.
Regards,
On Wed, Apr 20, 2016 at 4:01 PM, Stanislav Malyshev <smalyshev@gmail.com>
wrote:
> Hi!
>
> > The outcome is easy to grasp. Because it did not crash by a TypeError
> > (which would also require the file to be declared as strict), and we lost
> > 100k in sales. But PHP does not need more strictness...
>
> In other words, somebody wrote code that is supposed to only accept ints
> but does no checks. Somebody wrote tests that actually don't test
> anything. Somebody signed off on code that was not properly designed or
> tested to go into production. And the language is to blame. Right.
>
> --
> Stas Malyshev
> smalyshev@gmail.com
>
--
Guilherme Blanco
Lead Architect at E-Block