RE: [PHP-DEV] Design by Contract
| From: | François Laupretre | Date: | Fri, 06 Feb 2015 14:17:53 +0000 |
| Subject: | RE: [PHP-DEV] Design by Contract | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82042@lists.php.net to get a copy of this message | ||
> De : yohgaki@gmail.com [mailto:yohgaki@gmail.com] De la part de Yasuo Ohgaki
> Personally, backward compatibility is not too important.
> PHP5 is dead by PHP 7.2 release... This is the reason why.
> It's only 3 years later, only 2 years later after PHP 7.0 release.
That's where we disagree, as I think it's most important.
Thinking that PHP 5 is dead in 3 years is extremely naïve IMO. You probably didn't live the
PHP 4/5 migration but I guess we won't have more than 30 % of production servers under PHP 7 in
2018, just due to the delays of distros, hosting companies, and others.
Now, suppose you're distributing a library or a framework, like Symfony, Doctrine, etc. Someone
tells you : "Here's the new DbC feature. You can use it but this implies splitting your
code to two independent branches and maintain them in parallel until you have no PHP 5 customer
anymore.". What do you think you'll do (or won't do) ?
@Pierre,@Dmitry : you have a better vision than mine on the migration process. What's your
opinion on forcing software developers to maintain two separate branches ?
Once again, the conditions in @assert lines ARE PHP code. There's no new syntax. There is no
real difference between writing 'assert(<condition>)' and '@assert
<condition>', especially if the require/ensure blocks should contain 'assert'
statements only.
> What I believe is not important to you. I could be wrong.
It is important. As I may be wrong too.
Cheers
François