Coldfusion 编码标准文档

发布于 2024-12-21 09:58:12 字数 252 浏览 1 评论 0 原文

我曾经有一套很好的编码标准,可以打印用于冷融合,这几乎是一个框架,但对于一些代码示例来说要宽松得多。例如 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

玩世 2024-12-28 09:58:12

虽然相当过时,但您可能会在“MDCFUG - Mayryland ColdFusion 用户组 网站的 .cfm" rel="nofollow">文章" 页面。

以下是一些其他选项:

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:

嘿看小鸭子会跑 2024-12-28 09:58:12

我不知道任何“官方”Coldfusion 特定编码标准。在我工作的地方,我们根据多年使用该语言的经验共同提出了自己的方案。一个简单的例子是使用驼峰式大小写。据我所知,在 Coldfusion 中,驼峰式命名法优于蛇形命名法,因此通常我们有:

一般来说,文件使用小驼峰式命名法,以小写字母开头,但 CFC 除外,它应以大写字母开头。大小写字母,因为它们代表 ColdFusion 中的类。

我们还有其他标准,如:

  • 变量
  • 命名运算
  • 符范围
  • 函数
  • 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:

  • 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.

夏末 2024-12-28 09:58:12

我意识到这是一篇相当旧的帖子,但认为值得一提 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文