终端应用程序应该猜测用户想要什么吗?

发布于 2024-10-05 11:37:16 字数 373 浏览 1 评论 0原文

有一个小讨论 关于 git 默认为用户做什么和不做什么。

默认情况下,颜色被禁用(通常使用 git config 设置),但它会将其输出发送到某些命令的寻呼应用程序(例如在 git log 中)。

一方面是不应启用任何标志,因为它使用户可以完全控制应用程序。相反,在发布新应用程序时,应该尝试以尽可能多的花哨功能尽快赢得用户。

这可能是一个非常主观的问题,但是在 2010 年,终端应用程序应该开始默认做出可用性决策还是强制用户进行自定义。

There was a small discussion about what git does and doesn't do by default for the user.

By default, colour is disabled (generally set up with git config), yet it sends its output to a pager application for certain commands (such as in git log).

One side to this would be that no flags should be enabled since it gives the user full control of the application. The contrary would state that when releasing a new application, one should try and win users over as quickly as possible with as many bells and whistles as possible.

This is probably a very subjective question, but in the year 2010 should terminal applications start making usability decisions by default or force its users to customize it.

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

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

发布评论

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

评论(3

三寸金莲 2024-10-12 11:37:16
$ rm file.txt </dev/null
Do you want to remove file.txt [y/n]
tty not connected, guessing "no"

所以不;请避免任何假设,因为它们可能与预期完全相反。

git diff 中的颜色默认是禁用的,因为分页器可能不支持它——即使是 less 也是如此,需要使用 -R 选项显式调用以打开转义序列支持。

$ rm file.txt </dev/null
Do you want to remove file.txt [y/n]
tty not connected, guessing "no"

So no; please avoid any assumptions because they can turn out to be the exact opposite of what is expected.

Color in git diff is disabled by default, because pagers may not support it — this is the case even for less, which needs to be explicitly invoked with the -R option to turn on escape sequence support.

放低过去 2024-10-12 11:37:16

如果在某些情况下某些东西的行为不同,例如当输出是 tty 与管道时的颜色情况,那么应该清楚这个条件是什么,但是 git log 不会检查这一点,而是检查其他一些 程序在其 --color=auto 模式下确实类似于 ls

在使用 --colorgit log 情况下, 它使用较少的颜色转义代码,

如果您想覆盖它,请给它们一个像 --color[=WHEH] 选项,如 ls 可以强制颜色无论输出的类型如何,

--color[=WHEN]         control whether color is used to distinguish file
                       types.  WHEN may be `never', `always', or `auto'

自动模式都是我在第一段中描述的,

默认值应该是对程序用户有用的模式,如果在某些情况下默认值不是想要的,那就是选项为了

if there are conditions when something acts differently like in the case of color when the output is a tty vs a pipe it should be clear what this condition is but git log doesn't check for this but some other programs do like ls in it's --color=auto mode

in the case of git log with --color it uses less with color escape code pass though on

if you want to override it give them a like a --color[=WHEH] option like ls has which can force color on regardless of the type of the output

--color[=WHEN]         control whether color is used to distinguish file
                       types.  WHEN may be `never', `always', or `auto'

the auto mode is what i describe in the first paragraph

the default should be the one useful to the users of the program, if there are cases where that default isn't what is wanted that's what options are for

苦行僧 2024-10-12 11:37:16

终端应用程序也不例外。请参阅 oracle import (imp),它提供了合理的默认值,因此即使它提出问题但给出了默认选择,天真的用户也会选择它,除非他真的确定该选项。或者甚至在 oracle 中创建具有较小版本的数据库,该版本假定所有合理的默认值和扩展版本。

一方面是没有
应该启用标志,因为它给出了
用户完全控制
应用

如果用户真正开始使用它,他将学会使用完全控制。例如,我正在评估开源的工作流引擎,想象一下,对于每个工作流引擎,我都需要在其启动和运行之前设置完整的基础设施,例如数据库表结构。相反,最复杂的工作流引擎之一提供了很好的 HSQLDB 实现,非常适合评估。

一旦某些东西开始工作,我就可以调整它以适合我,而不是花几天时间在一个一开始看起来很死的软件上。

The terminal applications are no exceptions. See oracle import (imp) it provides sensible defaults so even though it asks questions but a default selection is given a naive user would go for it unless he is really sure about that option. or even create database in oracle which has a smaller version which assumes all sensible defaults and an extended version.

One side to this would be that no
flags should be enabled since it gives
the user full control of the
application

User will learn to use full control if he actually starts using it. For instance I was evaluating workflow engines, open source ones, imagine for every workflow engine I needed to setup full infrastructure like database table structure before it even gets up and run. Instead one of the most sophisticated workflow engines gives nice HSQLDB implementation which works great for evaluation.

Once something starts working I can tweak it to suit me, rather than spending days on a software which seems quite dead in the beginning.

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