>>>The CFC this. variables are an extremely powerful feature in a CFC.
>>
>>If you went round telling C#, Java and C++ developers to use public
>>data members like that, they'd laugh in your face.

Well, smirk anyway.

Using public data members is a "serious no-no" (that's the technical 
term I think :) ) because it greatly limits what changes you can make to 
the functions in the future. If the author of the code (you) at a future 
date discovers a better way to design the function that is very 
different than the original, and changes it, then all the 3rd party 
software that was written using it will crash or have to be rewritten, 
perhaps significantly. It much better to just abstract it out to 
function calls and hide the actual implimentation so that's it is as 
close to plug-and-play as possible, even if there may be a slight 
performance loss. (Except for a few rare cases of course.) It's better 
to take performance hit than have potentially buggy, crashing code 
because you're having to change ever little part of it to accomodate 
modificates, thereby loosing all the investment you and others have made 
to date stress testing the software.

This is one of the things I love most about C++/Java, etc. I can write a 
function or class that will work "ok" for now and get something going, 
then latter, as time permits, refine and hone -- perhaps even completely 
rewrite a class -- and not _have_  to change anything about the way the 
rest of the software works. Very useful for larger scale projects where 
multiple hands are in the pie focusing on their specific talents or skills.

-- 
--Lewis Sellers (AKA min)
Intrafoundation Software
http://www.intrafoundation.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:188798
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to