Groovy脚本文件的命名约定 [英] Naming convention for groovy script files

查看:148
本文介绍了Groovy脚本文件的命名约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于groovy脚本文件的命名是否有约定?

Is there any convention regarding groovy script files naming?

我应该以驼峰形式命名脚本文件,就像它是常规类一样(即FooBar.groovy)吗?

Should I name the script file in camelcase form, like if it was a regular class (i.e. FooBar.groovy)?

还是用小写字母和下划线(即foo_bar.groovy)命名更好?

Or will it be better to name it using small case letters and underscores (i.e. foo_bar.groovy)?

推荐答案

我已经看到一些建议,比如说与Java类一样,groovy类文件应该是驼峰式的情况,但是对于groovy脚本,建议至少使用小写名称.第一个字母.这个想法是,您可以在目录列表或Windows资源管理器中查找文件时很容易就知道文件的名称,仅以文件名为例-因此以小写字母开头的脚本是一个很好的线索.

I have seen suggestions that say groovy class files should be the camel case just like Java classes, but for groovy scripts, the recommendation was lower case names, at least the first letter. The idea is that you can very easily get an idea of what file is when looking in a directory list or Windows explorer, just by the case of the filename - so scripts starting with lower-case is a good clue.

这篇关于Groovy脚本文件的命名约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆