对于同时提供 GUI 和命令行界面的应用程序,程序集名称应该是什么?
我在.NET 中编写了一些桌面应用程序,它们既提供了正常使用的前端GUI,也提供了满足其他需求(例如扩展、调度、自动化、高级使用等)的命令行界面。由于两个可执行文件构建到同一目录,因此命名它们的最佳做法是什么?我已经看到或完成了以下一些操作:
- 将 GUI 命名为
并将控制台命名为.GUI.exe
。.exe - 将 GUI 命名为
并将控制台命名为.exe
。.Console.exe - 将 GUI 命名为
和控制台g.exe
,或其他名称后缀的混合物。c.exe - 将代码放在如上所述的描述性命名空间下,但排除控制台可执行文件上的命名空间。也许将其命名为较短且全部小写。这很容易在 shell 中键入,但普通用户仍然会看到 GUI 可执行文件的复杂命名空间。
- 完全使用不同的名称或命名空间。
对于同一个常见应用程序,有两种不同的界面(一种是图形界面,另一种是文本界面),但我希望文件名能够清楚地表明该程序是什么,同时给出一个提示(不仅仅是在其图标中):它是 GUI 或控制台,所有这些都没有使用神秘的名称。
旁注:有一个类似的“问题”,您有一个 .NET 类库,并且想要编写一个前端来使用它而不编写代码。在这里,我通常会看到名为
的可执行文件,其中库名为
(但我不相信这一点是很好的做法),或者是一个更友好的名称,例如Some Tool Name.exe
。但在这个问题中,我更感兴趣的是如何命名可执行文件。
I've written a few desktop applications in .NET that provide both a front-end GUI for normal use as well as a command-line interface for other needs (e.g. extending, scheduling, automating, advanced usage, etc). What is the best practice for naming the two executables, since they are built to the same directory? I've seen or done some of the following:
- Name the GUI
<X>.GUI.exe
and the console<X>.exe
. - Name the GUI
<X>.exe
and the console<X>.Console.exe
. - Name the GUI
<X>g.exe
and the console<X>c.exe
, or some other name-suffix mixture. - Have the code under a descriptive namespace like above but exclude the namespace on the console's executable. Maybe make it a shorter name and all lowercase as well. This is easy to type in a shell, but the common user still sees the complex namespace for the GUI executable.
- Use different names or namespaces altogether.
There are two distinct interfaces--one graphical, the other textual--to the same common application, but I want the filenames to be clear as to what the program is, while giving a hint (other than just in its icon) to whether it is the GUI or the console, all without using a cryptic name.
Side note: there's a similar "problem" where you have a .NET class library and want to write a front end to use it without writing code. Here, I usually see the executable named <X>.Exe.exe
where the library is just called <X>.dll
(but I'm not convinced this is good practice), or it is a friendlier name, e.g. Some Tool Name.exe
. But in this question, I'm more interested in what to name the executables.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的看法是,从编码的角度来看,命名空间是有意义的,而我的用户可能不应该看到这一点,特别是对于他们正在输入的控制台应用程序。
如果我有一个应用程序,其命名空间类似于......
那么我的exe将是
,控制台版本将是
The way I see it, is that Namespaces are meaningful from a coding perspective and my users probably should not see that, escpecially for a console app, where they are typing it out.
If I had an app where the namespace was something like....
then my exe would be
and the console version would be
将它们放在一个 winexe 程序集中,当您需要在控制台中运行时,将其附加到 此链接。
Put them in a single winexe assembly and when you need to run in console attach it following this link.