Frank Tudor
Frank Tudor

Reputation: 4504

Coldfusion coding standards documents

I used to have a nice set of coding standards I could print for coldfusion that was almost a framework but much looser with some code examples. Like teh use of createObject, more cfscript, error and message integration, Application.cfc usage and examples. Also seperation of buisness (actions) and display using cfincludes to make an index.cfm page 'a generator' of many actions leveraginf cfswitch/cfcase...etc. I am looking for some doucmentation or anything that I can print our and sit on my desk and refer to so my coding stays clean. Any help from the community would be very much appreciated.

Upvotes: 1

Views: 2790

Answers (3)

Simon Bingham
Simon Bingham

Reputation: 1310

I realise this is quite an old post now, but thought it would be worth mentioning http://wiki.coldbox.org/wiki/DevelopmentBestPractices.cfm. I think this is a good set of standards for writing CFML.

Upvotes: 1

Micah Githens
Micah Githens

Reputation: 1261

Although rather dated, You may find what you are looking for among the many posts listed under the "Coding Guidelines" section on the "Articles" page of the MDCFUG - Mayryland ColdFusion User's Group website.

Here are some other options:

Upvotes: 2

Barry Jordan
Barry Jordan

Reputation: 2706

I'm unaware of any "official" Coldfusion specific coding standards. Where I work we collectively came up with our own based on many years of experience working with the language. A simple one for example is to use camel case. From what I've seen camelCase is preferred over snake case in Coldfusion, so as a rule we have:

In general, for files use lowerCamelCase starting with a lower-case letter, except for CFCs which should start with an upper-case letter as they represent a class in ColdFusion.

We have other standards broken up under headings such as:

  • Variable Naming
  • Operators
  • Scopes
  • Functions
  • ColdFusion Native
  • Functions
  • Indentation
  • ......

I am looking for some doucmentation or anything that I can print our and sit on my desk and refer to so my coding stays clean.

In addition to this I recommend you create a set of generic code snippets, such as you can use in Eclipse, that conform to any standard you decide to go with. These can then be easily distributed among team members, helping to keep things consistent as well as saving typing time.

Upvotes: 1

Related Questions