你用了一段结束你的异常消息? [英] Do you end your exception messages with a period?

查看:114
本文介绍了你用了一段结束你的异常消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这两个异常消息与无一段时间。我能想到的为什么都可能是不错的一些原因。

I've seen both exception messages with and without a period. And I can think of some reasons of why both could be good.


  • 没有点会给你自由添加期间或将其您是否想。如果消息是在某种一个标题栏或东西会很有用。

  • 以一个点,你总是知道你有一个完整的句子,它看起来更完蛋了。

你推荐哪一个?

也可以在局部的一个问题资源字符串。显然,你不能把一个时期的一切后(会不会看上去很怪对按钮和菜单项等文本后周期)。但是,你应该再从一切离开上期开出是一致的,稍后将其添加在哪里有用吗?或者你更愿意把一个时期,似乎适合?比如所有的资源字符串和异常消息是句子,但不经过后那些话。但后来,怎么样很短的句子?像创建一个新的文件为例。也许可以离开了周期为那些被认为行为以及串...(一想到这里,而IM打字...

Could also be an issue in localized resource strings. Obviously there you can't put a period after everything (Would look weird with periods after text on buttons and menu items etc.). But should you then leave the period out from everything to be consistent and add it later where useful? Or would you rather put a period where it seems fit? For example after all resource strings and exception messages that are sentences, but not after those that are words. But then, how about very short sentences? Like "Create a new file" for example. Could maybe leave out periods for strings that were considered actions as well... (Just thinking while im typing here...

不是在世界上最重要的事情,我知道,但是像这样的小东西往往经过一段时间来烦我,我喜欢的一致性,并知道为什么我做我想做但问题是我不知道去哪个:。p

Not the most important thing in the world, I know. But small things like this that tend to bug me after a while. I like consistency and to know why I do what I do. Problem is I'm not sure which one to go for :p

推荐答案

是的,我平时对待异常消息为完整的句子,用了一段结束他们。

Yes I usually treat the exception messages as full sentences, ending them with a period.

然而,在异常的消息是为在的开发的和的不是最终用户的,它很可能是相同的底层异常应导致两个不同的消息对于最终用户,这取决于异常抛出方法被调用的上下文。

However, the message in the exception is meant for the developer, and not the end user. It may very well be that the same underlying exception should result in two different messages for the end user, depending on the context in which the exception-throwing method was called.

您真的应该显示较少的技术,用户更友好的信息给用户。

You really should show less technical, more user friendly messages to the user.

这篇关于你用了一段结束你的异常消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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