[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rather, DSSLs increase modularity, productivity

Nice description of the problem.  The real issue is less not about
types so much as

1. having things written down, and
2. having things checked.

For languages like Smalltalk and Scheme, contracts provide a very
robust alternative.  They provide a way of formally stating the
invariants that were in your mind with far less formality than many
type systems engender.  They're in your program right next to the code
(and perhaps even using some of it), not on a scrap of paper you might
lose.  Opinions vary on whether or not it is wise to turn off
contract-checking in a production system, but at least you can keep it
on while testing, which helps you understand what invariants you've
changed as you upgrade software, keeping you from regressing past a
certain stage of decay.

DrScheme has a very nice contract system.  I'm sure some such thing
exists for Smalltalk also.  DrScheme's contract system has good
properties such as a formal clarification of what it means to blame a
component.  (Indeed, the system is not only formal, it is also
sensible.  Alas, the two are often distinct!)  I don't know whether
Smalltalk or other contract systems offer such facilities.