RE: [PHP-DEV] Design by Contract
| From: | François Laupretre | Date: | Thu, 05 Feb 2015 16:11:02 +0000 |
| Subject: | RE: [PHP-DEV] Design by Contract | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81941@lists.php.net to get a copy of this message | ||
> De : yohgaki@gmail.com [mailto:yohgaki@gmail.com] De la part de Yasuo Ohgaki
> We don't have to integrate DbC into phpdoc. phpdoc may have integration of new DbC syntax.
> I think it's helpful even if phpdoc copies post/pre condition as document.
>
> There are too many possibility for DbC syntax.
> We are better to choose something in common among languages.
No. The more I detail the concept, the more I read alternative proposals, the more I consider
extending phpdoc is the best solution. As I explain in the RFC, both concepts are closely related,
and that's the only solution I've seen so far that preserves BC. I could add that it
proposes a solution to issues not even detected nor discussed in alternative proposals, like the
syntax for return value, separate check for arguments returned by ref, built-in type checks, etc.
Before we choose an alternative syntax, I think we should have good reasons, not 'Hey,
that's how it's done in D !'. If there's a good reason to copy D or Eiffel
syntax, let's adopt it, but I haven't read any good reason so far. And D is not so widely
used so there's no user habit. We can copy the concept without copying the syntax.
I think we're going too fast here. Before giving up and switching to another syntax, can you
give me a little time to present what I have in mind. I started writing it yesterday evening and it
will be ready tomorrow morning (UTC). Then, we can make a decision.
Cheers
François