由买买提看人间百态

topics

全部话题 - 话题: indentity
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
m******t
发帖数: 2416
1
来自主题: Java版 - 终于上来了

I want the next line
indented for 4 spaces.
m******t
发帖数: 2416
2
来自主题: Java版 - Design thought.. Sugguestions?
I finished reading the long post, but this stuff is so specialized that
the only question I can come up with is - how did you manage the
indentation in these code snippets?
w**z
发帖数: 8232
3
来自主题: Java版 - Google Java coding standard
Yep, Google's got standards when it comes to Java coding, and they've been
carefully documented for your enlightenment. While these enforceable coding
conventions are clearly most relevant to Java developers interested in
joining the Googleplex, they're also a good indicator of what you might
expect to see in other shops. InfoQ's Bienvenido David lists some of the
rules gleaned from the Google Java Style guide:
No wildcard imports.
Overloads appear sequentially.
Braces are used even when the bod... 阅读全帖
w**z
发帖数: 8232
4
来自主题: Java版 - Google Java coding standard
Yep, Google's got standards when it comes to Java coding, and they've been
carefully documented for your enlightenment. While these enforceable coding
conventions are clearly most relevant to Java developers interested in
joining the Googleplex, they're also a good indicator of what you might
expect to see in other shops. InfoQ's Bienvenido David lists some of the
rules gleaned from the Google Java Style guide:
No wildcard imports.
Overloads appear sequentially.
Braces are used even when the bod... 阅读全帖
F*******i
发帖数: 190
5
Thanks!
a*****i
发帖数: 4391
6

check scripts section in www.vim.org
a*****i
发帖数: 4391
b*d
发帖数: 75
8
来自主题: Linux版 - emacs: indent after a newline
use ctrl+j instead of return

press
r******h
发帖数: 656
9
在.vimrc里面去掉
filetype indent on
s****n
发帖数: 700
10
来自主题: Linux版 - 关于vi的几个问题
以前我用emacs编程的时候, 如果indent错位的话,可以选中区域后ctrl+alt+\去自动
格式化。 不知道在vi里有没有类似的命令。
还有我这个电脑的vi如果用鼠标copy paste多行的话, 每行都会缩进很多间距,不知
道是为啥。 用p就没有这个问题。
h***r
发帖数: 726
11
来自主题: Linux版 - 浏览器emacs,ymacs
no.
c-x is for running a command, like indent.
it deos not support that yet.
s**h
发帖数: 1889
12
python. 不过个人极其讨厌python用indentation来判定code block :)
S*A
发帖数: 7142
13
这个其实问题不大,而且习惯了也挺好用的。
如果你写程序比较规矩的话, indentation 是要
match execution block 的。不然才是乱套了。
如果你永远是 match 的话,那个 end of block marker
其实就是不需要的。
而且这样程序简洁很多。 简洁是 python 的精髓。
F*******i
发帖数: 190
14
来自主题: Linux版 - Google go 还挺不错的
i am happy with vim's synatax highlight/indent for cython
c******n
发帖数: 4965
15
来自主题: Linux版 - python question
it is possible to do it that way, but it's cumbersome
consider that you have 10 vars to be accessed through closure,
you would have to create 10 useless member vars, and have to access
them through self., adding much more typing.
scripting like python and perl, a very important thing is "idiom",
stuff like this has been done before, and people have found the best
way to do it, it's best to follow.
I have found from stackOverflow that the best way here is to wrap the
closure content like the foll... 阅读全帖
s***g
发帖数: 495
16
Ever heard of indentation?
N****w
发帖数: 21578
17
indentation 只是数空格
s***g
发帖数: 495
18
俺指得是广意双向indentation.
N****w
发帖数: 21578
19
啥叫广意双向indentation
O******e
发帖数: 734
20
vim has a "folding" feature that some people file useful, though I don't
use it. See ":help fold".
You can add the following lines to your .vimrc file to turn on folding
for Fortran 95 syntax:
let fortran_dialect="f95"
let fortran_free_source=1
let fortran_more_precise=1
let fortran_fold=0
let fortran_fold_conditionals=1
let fortran_fold_multilinecomments=1
set foldmethod=indent
h********r
发帖数: 821
21
俺弄了个土办法,好像也能解决问题。首先把文件中所有的then换成then{,还有endif
换成endif},然后按照5楼大哥指点的用%,然后不管针对indent多烂的code,世界都和
谐了:)
c*****t
发帖数: 1879
22
来自主题: Programming版 - 程序速读指南
SGI STL 里大量使用 _M_。至于 Sun,它自己 JDK 里面的 code 就很糟糕。
没有固定的 naming convension,乱七八糟的 indentation,scope (private
vs default 等)。有些地方使用 v_, _v, 等。我不喜欢 _ 因为 C 里面 _
和 __ 属于 system function 。最好不要养成习惯使用 _。
我觉得使用 prefix/suffix 比较好。Eclipse/IDE 对此有特殊支持,可见
还是比较重要的。
至于
if (..) {
}
很多人喜欢这种风格,俺就是不喜欢 hehe :)
g*****g
发帖数: 34805
23
来自主题: Programming版 - 程序速读指南
SGI, STL还是C/C++,用在Java上不合适,JDK的代码我读的不多,
但像Spring的code就写得很好,你可以看看。至于indention,我说了,
必须用formatter,否则不可能一致的。除了static final,不推荐用
_在任何变量上,比如gameList这样一个变量很干净,game_list就很C。
声明变量的时候经常直接就如
GameList gameList = new GameList();
都不用脑,不用多想名字,也很清楚。
m*****e
发帖数: 4193
24
来自主题: Programming版 - Indent的问题
I think the default is better.
T***B
发帖数: 137
25
来自主题: Programming版 - Indent的问题
What I do:
If 'if' block is short, just put '{' at the end of the line to save space.
Otherwise, start '{' from a new line to get better readability.
if( ... ) {
. . .
}
if (... &&
...)
{
...
}
k*****c
发帖数: 1670
26
来自主题: Programming版 - Indent的问题
better be consistent.
c****e
发帖数: 1453
27
来自主题: Programming版 - Indent的问题
emacs 下我用 "ellemtel" style, 是你要得这样.
S*********g
发帖数: 5298
28
来自主题: Programming版 - 问一下python初学者的问题
block不是靠空行的吧
是靠indent的吧
j*****k
发帖数: 1198
29
来自主题: Programming版 - 问一下python初学者的问题
嗯,indent, 好不习惯
y****e
发帖数: 23939
30
来自主题: Programming版 - 问一下python初学者的问题
不麻烦啊,一般的editor都可以选定一个block 一次indent啊
我用的是eclipse,加上pydev,很方便的啊
E*****d
发帖数: 238
31
来自主题: Programming版 - 问一下python初学者的问题
是吗?我用的是idle或者emacs,可以blck indent嘛?
n**d
发帖数: 9764
32
来自主题: Programming版 - indent C++ source code by VC++ 6.00
Thanks! How could you find it?! Is there any icon?
It works, but someting like this:
#define D(A) T << #A << endl; A
int main() {
ofstream T("format.out");
//assure(T);
D(int i = 47;)
D(float f = 2300114.414159;)
const char* s = "Is there any more?";
D(T.setf(ios::unitbuf);)
D(T.setf(ios::showbase);)
D(T.setf(ios::uppercase | ios::showpos);)
D(T << i << endl;) // Default is dec
...
}
f*z
发帖数: 421
33
来自主题: Programming版 - indent C++ source code by VC++ 6.00
Do you know how to do it in Visual .Net 2003?
Thanks!
l*****c
发帖数: 1153
34
来自主题: Programming版 - indent C++ source code by VC++ 6.00
Ctrl+A
Ctrl+K+F
For VC2003 and later? As I remember.
s******e
发帖数: 431
35
来自主题: Programming版 - indent C++ source code by VC++ 6.00
It is called format selection.
g*****g
发帖数: 34805
36
来自主题: Programming版 - 花了一个小时学习了python
这个indent是有点怪,不过在一个IDE里搞估计不是什么问题。

perl
r****t
发帖数: 10904
37
来自主题: Programming版 - 花了一个小时学习了python
python code ,不管谁写的,indent 都一样,这是一个优点。
我的印象是 everything is passed by reference.

perl
m******t
发帖数: 2416
38
来自主题: Programming版 - 花了一个小时学习了python

I just needed a scripting language in my toolbox for,
well, scripting things.
I could do most things in bash, but the logical test
operations in bash are just horrific.
Perl was ruled out because I would like to
be able to actually understand what I wrote after
a while.
Python I tried as well, but disliked the strong C
flavor, and the "indentations matter" philosophy.
So ruby turned out to be quite flexible, with a strong
OO style. _And_ the potential to integrate with java via
jruby. That's a
f****e
发帖数: 222
39
来自主题: Programming版 - python的一大缺点
就是indent
有人用space,有人用tab
很是烦人
g*****g
发帖数: 34805
40
来自主题: Programming版 - python的一大缺点
俺不得不说,多几个{};之类的,不会让productivity变差的。
非用indent来分割block,比较土。
T*****9
发帖数: 2484
41
来自主题: Programming版 - python的一大缺点
我从来都是tab indent...
f****e
发帖数: 222
42
来自主题: Programming版 - python的一大缺点
呵呵,不能这么肯定阿
用python的说得上名字的公司就那么几家,还真有用tab的

indent 造成的麻烦不能怨别人
t******a
发帖数: 1200
43
来自主题: Programming版 - python的一大缺点
不喜欢 Python 的 indent 的话就用 Ruby, 代码风格更适合传统口味的
程序员。现在我是 Python, Ruby 混用。项目必须用 Python 的话就用 Python,
没有要求的话一律 Ruby. 觉得 Ruby 推崇的编程风格更符合个人口味一些.
k***r
发帖数: 4260
44
来自主题: Programming版 - 有人用Haskell吗
@blaze, @wdong,
I actually like Python very much. After you get pass the first
period, the indentation makes thing easier and you type less.
Among the languages I have used for any actual projects, Python
has been the most productive language for me when I need to
quickly get something done.
Even so, Haskell looks very foreign to me. wdong's comment
gives me a good perspective of the language in terms of the
shift to functional programming but remarks like python should
die has somewhat discount
r*******n
发帖数: 3020
45
来自主题: Programming版 - 有人用Haskell吗
I like Python, too.
I started using Python in company in 2005,
and never got into the trouble of spaces/tab problems,
actually, the indentation makes the programs look NEAT.
A another advantages are that it's so productive and
has a lot of libraries.
It's true which language you like depends on who you are,
but Python works very well for me,
by the way, I don't like perl, either, because of its symbols system.
p***o
发帖数: 44
46
来自主题: Programming版 - 有人用Haskell吗
Significant indentation really sucks, because you won't be able to
automatically reformat your code in your editor. It's not because the editor
is not powerful enough. It's just impossible! The syntax is aimed to make
the language clean looking, but it causes more trouble than this minor
benefit.
But Haskell is too great a language to ignore, despite of this "defect
". I'm really sad to have to put up with its syntax.

it is
at
g*****g
发帖数: 34805
47
来自主题: Programming版 - 有人用Haskell吗
The point is that you have to manually maintain indentation.
While when you use curly brackets, you can use a formatter
to format the code based on your preferred template (Eclipse
has this feature). Therefore, all the source code can have
the same style no matter how it is originally written.
Consider this python example, all 3 are equal.
>>> if 1 + 1 == 2:
... print "foo"
... print "bar"
... x = 42
>>> if 1 + 1 == 2:
... print "foo"; print "bar"; x = 42
>>> if 1 + 1 == 2: print
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)