gpt4 book ai didi

kotlin - Kotlin编码约定:水平空白

转载 作者:行者123 更新时间:2023-12-02 12:38:58 25 4
gpt4 key购买 nike

在Kotlin的coding convention中的空白区域中,注意到:

As a general rule, avoid horizontal alignment of any kind. Renaming an identifier to a name with a different length should not affect the formatting of either the declaration or any of the usages.



这是什么意思?

Renaming an identifier to a name with a different length should not affect the formatting of either the declaration or any of the usages

最佳答案

这是违反该规则的示例:

val b      = SomeFluentBuilder()
val result = mutableListOf<String>()

b.foo()
.bar()
.baz()
.build()

b重命名为(例如) someFluentBuilder将破坏声明中的对齐方式以及构建器的用法。

关于kotlin - Kotlin编码约定:水平空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52909155/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com