Re: Python or Java or maybe PHP?



In article <863bk66tdt.fsf@xxxxxxxxxxxxxxx>, Mike Meyer <mwm@xxxxxxxxx> wrote:
.
[valuable remarks
on scientific
evidence and so on]
.
.
>Finally, there's a camp that pushes static typing up a notch,
>practicing what's called "Design by Contract" (DbC). Languages like
>Eiffel and D incluce DbC facilities. With these, you add extra code
>that provides checks on the preconditions to a method invocation,
>postconditions when it exits, invariants for an object, and various
>conditions on a loop. This help with the DRY principle, as a good set
>of unit tests would check all these things before and after each test,
>so you'd have to code the checks (or invocations of them) for every
>method invocation in every test. With language support, you only code
>them once, and the compiler generates code to check them
>automatically. Again, people who use them swear by them - but have no
>hard data to back up their believes.
.
.
.
.... and it's even possible, as has already been hinted
several times in slightly different aspects in this
thread already, to combine these concepts to yield, for
example, DbC practices with a dynamic language such as
Python ("Design By Contract for Python", PyDBC, Contracts
for Python, ...).

.



Relevant Pages

  • Re: Programming by Contract
    ... zope.interface provides extensive support for design by contract. ... I have seen posts about the assert statement and PbC (or maybe it   ... was DbC), and I just took a very brief look at pycontract ...
    (comp.lang.python)
  • Re: Comparing design by contract with defensive development
    ... > The author is in favour for defensive development. ... > What is your opinion between defensive development and design by contract.? ... Design by Contract (DbC) is a much better approach. ...
    (comp.object)
  • Re: Viability of Design by Contract technique with templates
    ... > Bertrand Meyers' DBC (Design By Contract) has an important characteristic, ... > ideally we would write the class separate from the contract, ... > and goals of DBC, along with its viability for production quality code. ... Meyer makes the point that focusing on ...
    (comp.object)
  • Re: Test Tools
    ... is design by contract... ... When you DBC, you should write your constraints in tiny steps, such as ... a few lines of constraint code. ...
    (comp.software.testing)
  • Re: from Dannys chat - 11/19
    ... > Design by contract ... > it isn't anything you can not implement using asserts. ... I'm not a great fan of DBC. ...
    (borland.public.delphi.non-technical)