But the point of interfaces is that the error message is more meaningful.

For mid sized projects with a more senior developer creating an API for less
senior developers to code to, it should provide more meaningful error
messages at runtime for a class of cases. Also, if you don't have complete
code coverage in your tests I can envision cases where a runtime Interface
error would be thrown on instantiation of a class whereas the fact that a
method was missing would not be caught at all without interfaces because you
didn't exercise that path. Shoddy programming? Sure. But let's face it, not
every CF shop practices TDD properly or writes a full suite of unit and
integration tests.

I see a use case for interfaces in CF even though I'd be very unlikely to
use them myself - even in my framework code.

I'm sure plenty of people will misuse them, so I'm not sure whether there
will be a net benefit or downside to the community, and if you factor in
what else we might have gotten instead of interfaces the math becomes even
harder, but if nothing else the feature will allow CF developers to learn
one more language construct and will hopefully allow them to develop their
own understandings on the strengths and the weaknesses of the approach.

Now, who's for optional type hinting for variables so we can get automated
refactoring support and pre-runtime error messages if we want them by adding
optional type info to variables? *grins*

Best Wishes,
Peter



On 5/22/07 3:11 AM, "Sean Corfield" <[EMAIL PROTECTED]> wrote:

>> Now, with interfaces, I could say, have a ITransferEventObserver (I is
>> a common prefix for an interface), which has the method that is
>> required for an event to be observed.
> 
> And you'll just get a different runtime error :)
> 





You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to