I’ve been using CFScript for a while now, and I love it. One of the things I come across frequently is inconsistent casing of function names:
foo = new Query();
foo = new query();
foo.setSQL();
foo.SetSql();
ArrayAppend();
arrayAppend();
if();
If();
How do you stay consistent? Do use different casing for UDFs as opposed to built in functions? What is considered best practice?
All the Adobe examples use
UpperCamelCase(but they can be inconsistent!) but we’ve adopted a standard that mirrors the Java standard when it comes to case of variables, functions and CFC (class) names – examples:http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
and
http://geosoft.no/development/javastyle.html#Naming Conventions
We find it works well and it means using
lowerCamelCasenames for functions.Everyone will have a different take on this, but the important thing is to pick a standard and be consistent.