我曾经有一套很好的编码标准,可以打印用于冷融合,这几乎是一个框架,但对于一些代码示例来说要宽松得多。例如 createObject 的使用、更多 cfscript、错误和消息集成、Application.cfc 用法和示例。还使用 cfincludes 分离业务(操作)和显示,使 index.cfm 页面成为许多操作的“生成器”,杠杆 cfswitch/cfcase...等。我正在寻找一些文档或任何可以打印出来并放在桌子上参考的东西,这样我的代码就可以保持干净。非常感谢社区的任何帮助。
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.
发布评论
评论(3)
虽然相当过时,但您可能会在“MDCFUG - Mayryland ColdFusion 用户组 网站的 .cfm" rel="nofollow">文章" 页面。
以下是一些其他选项:
大学。马里兰州 ColdFusion 编程标准
示例应用程序方法指南 由 Adobe.com
提供
SBA ColdFusion 编程标准 包含为 US Small 编写的 126 页编码标准业务管理以确保安全性、促进代码重用、易于阅读和易于维护。
俄勒冈州卫生与健康局科学大学 - 编码指南,其中包含许多好与坏的编码示例。
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:
Univ. of Maryland ColdFusion Programming Standards
Sample Applications Methodology Guidelines provided by Adobe.com
SBA ColdFusion Programming Standards contains 126 pages of coding standard written for the U.S. Small Business Administration to insure security, promote code re-use, easy readability, and easy maintenance.
Oregon Health & Science University - Coding Guidelines which contains a number of GOOD versus BAD coding examples.
我不知道任何“官方”Coldfusion 特定编码标准。在我工作的地方,我们根据多年使用该语言的经验共同提出了自己的方案。一个简单的例子是使用驼峰式大小写。据我所知,在 Coldfusion 中,驼峰式命名法优于蛇形命名法,因此通常我们有:
一般来说,文件使用小驼峰式命名法,以小写字母开头,但 CFC 除外,它应以大写字母开头。大小写字母,因为它们代表 ColdFusion 中的类。
我们还有其他标准,如:
除此之外,我建议您创建一组通用代码片段,例如您可以在 Eclipse 中使用的代码片段,它们符合您决定采用的任何标准。然后,这些内容可以轻松地在团队成员之间分发,有助于保持事情的一致性并节省打字时间。
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:
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.
我意识到这是一篇相当旧的帖子,但认为值得一提 http://wiki。 Coldbox.org/wiki/DevelopmentBestPractices.cfm。我认为这是一套很好的编写 CFML 的标准。
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.