That is an interesting point of view considering that C++ is widely regarded as the language that brought OO to the masses and includes are a very important part of C++.
Stroustrup (and many others on the C++ committee, including myself) wanted to play down the use of #include or even remove it. Backward compatibility with C made that impossible unfortunately. That's why ISO C++ has this form of 'include':
#include <stdio>
The intent is to allow compilers to implement a form of namespace import without needing to physically include the file as part of preprocessing. There was quite a sentiment on the C++ committee that the preprocessor was the root of many evils and should be avoided as much as possible. We even discussed adding a Java-like "import" directive so that standard C++ did not need to rely on the preprocessor at all.
So "includes are a very important part of C++" is not actually true.
While bugs may have been found through the use of includes that doesn't mean the includes are the problem.
Agreed. Don't shoot the messenger. Includes continue to be a valuable part of CF.
For example, consider the following, which I used heavily pre-MX since custom tags where so slow.
<cfset local = pushStack()> <cfinclude template="whatever.cfm"> <cfset local = popStack()>
I understand that you're not actually recommending this practice but this is a pretty glaring "implementation detail" that programmers would need to be aware of. How many average CFers are familiar with stacks and call frames? Sure, you can just mandate in your coding guideline that "this is how we do things" but at the end of the day, developers working on your system need to have an understanding of how you implemented things (so that if they fail to follow your coding guidelines, they stand a chance of being able to work out why their code is failing).
What you really want is the ability to call Java static methods without cfobject.
Yes, and the ability to call (static) methods on a CFC without needing to create an instance. I searched the bugbase and there is an enhancement request in for this so I added a "vote" with a note that several folks had requested it.
test = bar.foo.util.crypto.MD5Hash('ChipTemm');
Yes, that would be nice.
Hopefully no one gets the bright idea to get inspiration from .NET for fear of seeing a cfusing or cfwith tag.
Given the pain that the C++ committee went through with namespaces and the "using" and "using namespace" directives - as well as my experience with Pascal dialects that supported "with" - I totally agree that I wouldn't want to see those sorts of tags added to CF!
Regards, Sean
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
