代码格式化程序 [英] A code formatter

查看:105
本文介绍了代码格式化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有没有人知道代码转换器采用这样的代码:


公共名称

{

get

{

返回姓名;

}

}


并将其转为:


公开名称{

get {

返回姓名;

}

}

注意大括号如何放在另一条线上。 (重点是什么?要使

你的工作看起来更大?)

如果有人知道可以通过文件并改变

布局,这将是一个很大的帮助


谢谢所有


Simon

Hi,

Does anyone know of a code converter that take code like this:

public Name
{
get
{
return name;
}
}

and turns it it to this:

public Name{
get{
return name;
}
}
Notice how the braces arent put onto another line. (Whats the point? To make
your work look bigger?)

If anyone know of something that could go through a file and alter the
layout, that would be a big help

Thanks All

Simon

推荐答案

>请注意括号如何放在另一条线上。 (重点是什么?要

make
> Notice how the braces arent put onto another line. (Whats the point? To
make
你的工作看起来更大?)
your work look bigger?)




不,要做到这一点更像java ...



No, to make it less java-like...


B0nj< b123 @ nj>写道:
B0nj <b123@nj> wrote:
注意大括号是如何放在另一条线上的。 (重点是什么?让你的工作看起来更大?)
Notice how the braces arent put onto another line. (Whats the point? To
make your work look bigger?)



不,让它更像java ...



No, to make it less java-like...




嗯,大多数Java程序员在我的

体验中使用单独的大括号。不是所有的都是远远的,但大多数。


我不得不想知道OP的目的是什么目的让关闭

支撑在一条线上服务,如果他问的问题是什么,那么将开口支架单独放在一条线上是什么意思。


在我看来,重点是为了让块更清晰,并且

结束。


-

Jon Skeet - < sk ** *@pobox.com>
http://www.pobox.com/~双向飞碟

如果回复小组,请不要给我发邮件



Um, most Java programmers use braces on separate lines in my
experience. Not all by a long shot, but most.

I have to wonder what purpose the OP feels that putting the closing
brace on a line on its own serves, if he''s asking what the point of
putting the opening brace on a line on its own is.

To my mind, the point is to make it clearer where the block starts and
finishes.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


>我不得不想知道OP的目的是将闭合的
> I have to wonder what purpose the OP feels that putting the closing
大括号放在一条线上,如果他问的是将开口支撑放在哪一个上是什么意思呢?它本身就是。
brace on a line on its own serves, if he''s asking what the point of
putting the opening brace on a line on its own is.




我更喜欢这样。在我看来它看起来更加整洁和缩进

代码块很容易区分。

我真的没有看到把它们放在那里的意义 - 它只是当你来打印这些东西时会占用更多的纸张!


当然这只是我的偏好


Simon



I prefer it that way. It looks a lot tidier in my view and with indenting
code blocks are very easily distinguished.
I don''t really see the point of putting them there - It just takes up more
paper when you come to print the stuff out!

Of course its just my preference though

Simon


这篇关于代码格式化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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