On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
* type checking is important in the development process: it helps us,
programmers, avoid writing errors in our code. I'll admit that I have a
strong 'structured programming language' background (Pascal et.al.) and to
me type checking is far from "wirthless" ;-)

Bear in mind that ColdFusion is a dynamic language and performs what
passes for type checking at runtime. The difference between duck
typing and not duck typing is mostly a matter of what the wording is
in the error message and perhaps a a slightly different line number -
the error is still detected at runtime. Also bear in mind that for
frameworks, duck typing mostly affects the *internal* calls of the
framework - not the interface between the framework and the developer
code.

* are you sure that the type checking is a time consuming part of the
framework?

Yes. I have done a lot of testing on a number of frameworks with and
without duck typing. Both Model-Glue and Fusebox posted improvements
of a factor of 2-3 when switching to duck typing. I believe the Mach
II folks have experimented with this and have seen similar numbers.

After all, type checking in CF (6.x and 7.x) is ultimately done in Java, and
if I'm not mistaken this is one of those parts of the JVM that is highly
optimized.

I think you misunderstand the type checking process. Type checking is
performed at runtime and CFC-based type checking has a performance
overhead that is removed by using duck typing. That's a simple fact
with ColdFusion. That the check is performed by some compiled Java is
pretty much irrelevant - it's still a runtime performance overhead.

That said, it is possible that changing the whole OO query model
representation will provide a larger performance boost than duck
typing. That doesn't mean duck typing shouldn't be done (and some
people are already reporting big speedups from the duck typing).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to