支架放置会影响可读性吗? [英] Does bracket placement affect readability?

查看:84
本文介绍了支架放置会影响可读性吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复项:
if语句的格式
是否有用于标识的最佳编码样式(同一行,下一行)?
编写stackoverflow样式'questions'/'tags的最佳方法'滚动按钮

Possible Duplicates:
Formatting of if Statements
Is there a best coding style for identations (same line, next line)?
Best way to code stackoverflow style 'questions' / 'tags' rollover buttons

public void Method {

}

public void Method
{

}

除了个人喜好外,一种风格比另一种风格有什么好处吗?我曾经用第二种方法发誓,尽管现在将第一种样式用于工作和个人项目.

Besides personal preference is there any benefit of one style over another? I used to swear by the second method though now use the first style for work and personal projects.

通过可读性,我的意思是想象那些方法中的代码-if/else等...

By readability I mean imagine code in those methods - if/else etc...

推荐答案

我认为这完全是主观的,但是,我认为为您的团队建立代码标准并让所有人使用相同的样式很重要.话虽如此,我喜欢第二个代码(并已使我的团队使用了它),因为当它不是您的代码时,它似乎更易于阅读.

I think it is completely subjective, however, I think it is important to establish code standards for your team and have everyone use the same style. That being said I like the second one (and have made my team use it) because it seems easier to read when it is not your code.

这篇关于支架放置会影响可读性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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