迫于摸鱼瞎想,大家是代码折行时.放在哪行

2021-01-05 13:52:46 +08:00
 chenyu8674
a.
b()
还是
a
.b()


摸鱼中,想了解下
5069 次点击
所在节点    程序员
53 条回复
palfortime
2021-01-05 20:20:56 +08:00
交给 rustfmt 烦恼
jzmws
2021-01-05 20:40:05 +08:00
@Lin0936 你们公司按照代码行算工资吧
a
.
(
)
jzmws
2021-01-05 20:41:37 +08:00
不过一般是

a
.b()

很多开源的都是按照这样写的,然后我也用

其实跟多 a.b(c-{
})
no1xsyzy
2021-01-05 20:47:15 +08:00
@qwerthhusn C 、Python 等语言可以不用加号,实际被当作一个完整的字符串字面量:
"abc" \
"def"
或者,在不产生歧义的情况下可以不加反斜杠
("abc"
"def")
dotw2x
2021-01-05 20:48:13 +08:00
习惯这么搞,看着爽一点
list.Where()
.Take()
.Select()
.ToList();
ychost
2021-01-05 20:48:31 +08:00
stream().map(..)
.filter(..)
.reduce(..)
20015jjw
2021-01-06 01:50:04 +08:00
不同语言不一样吧...
PEAL
2021-01-06 09:39:23 +08:00
突然想起来 layui 的窒息写法

table.render({
elem: '#demo'
,height: 312
,url: '/demo/table/user/' //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
,{field: 'username', title: '用户名', width:80}
,{field: 'sex', title: '性别', width:80, sort: true}
,{field: 'city', title: '城市', width:80}
,{field: 'sign', title: '签名', width: 177}
,{field: 'experience', title: '积分', width: 80, sort: true}
,{field: 'score', title: '评分', width: 80, sort: true}
,{field: 'classify', title: '职业', width: 80}
,{field: 'wealth', title: '财富', width: 135, sort: true}
]]
});
gaigechunfeng
2021-01-06 10:27:36 +08:00
这,上,热,门?
哈哈,年底池塘的鱼都不够摸了吗
songco
2021-01-06 10:44:59 +08:00
都能接受, 项目统一的 formatter 是什么样就按什么来
togou
2021-01-06 12:08:38 +08:00
Pms
.then()
.then()
这也太标准了啊
短的直接
[].filter().map().some();
yamasa
2021-01-06 13:14:50 +08:00
Java 要是写 stream lamda 或者 reactive,不用.func()太难看了啊。 一行一行的.func()感觉足够优雅,可读性也好得多。
wangyzj
2021-01-06 13:16:28 +08:00
除了 js
用前者

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/741838

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX