> You are quite correct.  However, using cfmodule and custom tags is
> potentially is server killer because it is EVERY call to the
> cfmodule/tag and not just the first call that grabs additional memory.
> So for every page call for every site visitor more memory is allocated
> for each cfmodule.

You'd have to use a hell of a lot custom tags for this to ever become an
issue. As noted in previous messages, I make extensive use of custom tags
and have yet to run into a performance problem caused by the use of custom
tags in the manners described.

I think this type of thinking goes back to a period of ColdFusion
development where custom tags were over used to compensate for the lack of
user-defined functions. This lead to writing recursive custom tags that
performed relatively simple mathematical operations. The overhead of the tag
invocation was incommensurate with the work being performed.

> Showing my age a bit now......  cfmodule and cf in
> general used to have a few problems with letting go of and reusing of
> allocated memory, so I've become acustom to using cfincludes rather than
> cfmodule, because of low resources in the memory department years back
> and a need to make stable applications that didn't require me to restart
> the server every couple of hours.  (A slight exageration, but that did
> used to happen with one of the sites I built back in 1997.  It used to
> get extremely high peeks of traffic at certain times of the day and it
> used to take the server down by taking all the available memory.  We
> eventually worked out what the problem was, reworked a load of stuff in
> the site and then site was rock solid - so solid that our poor old 128kb
> line used to get topped out)

I'm aware of other similar workarounds. Some developers would put all data
in a structure, copy that structure to another structure before calling
cfinclude, and then copying it back after the call. This turned out to be
faster/require less memory than using cfmodule.

That said, I have yet to see a situation since ColdFusion 5 (which
introduced UDFs) which necessitates such drastic measures.

> With regards "step all over your variables".  Never had a problem.  All
> it takes is a little care, attention to detail and meaningful variable
> names.

What size projects do you tend to work on? I myself do not work on large
projects. Most of the apps I've written fall in the 10,000 to 50,000 lines
of code range and have anywhere from 1 to 5 developers working on them. I
just finished a project which I spent 20 months on (35,000 lines of code).

I find that even under these relatively modest circumstances, it's difficult
to prevent stepping on data that doesn't belong to you unless you make good
use of the encapsulation features inherent in the language.

And, frankly, I find if very difficult to believe that you've "never had a
problem". I can see where the use of naming conventions and such would help
prevent such problems. But to say you've never had a problem -- well, I
assume you're making use of hyperbole.

> What's CFIMPORT?  ~joke~   Most of my clients are still on CF5

About half our sites are on ColdFusion MX. I'm porting one of the larger
ones right now, actually. It was written for ColdFusion 4. Consequently,
even though it is currently running on ColdFusion 5, it doesn't even make
extensive use of UDFs. I say this because I'm very cognizant of how far
ColdFusion has come in the last 2 major versions -- first with UDFs, then
with components.

To this extent, I thought the point of the thread was to discuss the best
practice now and how they may have changed from previous versions of
ColdFusion.

> (don't
> fix what aint broke).

Unfortunately, "the don't fix what ain't broke" mantra (a favorite or mine)
doesn't work so well with publicly facing Web sites. The Web sites we design
are more of a process, constantly revised and evolving. We have to support
newer browsers, upgrade server software for better security, handle ever
increasing loads, etc.

> Personal feelings.  Don't rag on mine just because I don't agree with you.

No, this discussion is not just about personal feelings. Legibility may be
largely personal preference. However, color coding (and even tag insight)
provides very tangible benefits. And there's no way you can call
encapsulation and parameter passing via attributes "personal feelings".

> In a sense yes that is correct.  By "tinker dynamically" I mean I can
> replace the headers much more easily dynamically with cfinclude than I
> can with cfmodule.  I can have a directory full of different headers for
> different occasions (images of Wurzel Gummage come to mind).  I can
> easily switch between headers by changing a single variable.  Using a
> CFMODULE, I have to pass some information into the tag that tells the
> logic in the tag which bit of html to use.  That html is either hard
> coded into the module (yak!) or you cfinclude it (pointless call to
> cfmodule).

There are many other ways to accomplish what you've described, but I sense
you are just being difficult at this point.

> So you've never had a client ask you to re-skin a site?

Yeah, you are just being difficult. This conversation has nothing to do with
re-skinning a site. The fact that you invoke a ColdFusion template via a
cfinclude or cfmodule call does not directly affect site skinning. It's an
implementation detail.

I would argue that the greater degree of encapsulation provided by tags
forces a stricter separation between the content of the site and the look
and feel. The same can be said for the ability to pass in parameters via
attributes.

Of course, if you're really, really careful, the same can be accomplished
with cfincludes.

> Michael has posed a personal opinion question - there is no right or
> wrong way - just different points of view.  Next time respond to the
> question and do not rag on someones personal opinion because you don't
> agree.

Michael or Micha? Michael posed a question. There are clearly advantages to
one method over the other. I was highlighting those benefits. I'd like you
to point out an instance in this thread where I "ragged" on either Michael
or Micha. 

Geez, it's code, not religion.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185830
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to