I have questions on Kotlin Features Survey 1-Stati...
# announcements
a
I have questions on Kotlin Features Survey 1-Static members in Kotlin classes #17 why people doesn't want it? 2-Optional (trailing) commas #11 what is this feature? 3-Collection comprehensions #7 what is this feature?
d
amorenew: 1) For me,
object
fills the same role. I wouldn’t really want both (although I didn’t participate in the survey). If someone wants static for jvm interop there’s
@JvmStatic
2) Trailing commas in lists would be legal, ie.
listOf(1, 2, 3,)
would compile, currently it doesn’t, mostly I think this is useful during code generation. There’s also another feature that’s alluded to, but I’m not sure what that was. 3) https://en.wikipedia.org/wiki/List_comprehension another syntax for loops.
👏 1
w
amorenew: ad. 2 you can e.g. have constructor parameters, each in new line, and last one would have a comma after it as well. I’d like it because you can then rearrange things without having to add/remove comma if you move the last element, and you see 1 line changed in VCS if you add an element to such list
👏 1
m
constructor( arg1: Int , arg2: Int , arg3: Int ) {
👍 1
👎 1
a
or rearrenge using idea change signature refactor
w
@msink this moves the problem to moving the first element, still 😉
and @agomez just using move line is way faster than any refactoring. The feature is there in Groovy, and I really like it for my Gradle scripts
a
yes, but if you invoke it from somewhere not using named params you'll break your code
b
@amorenew you can read about all features here https://drive.google.com/file/d/0BwAovUlww0CmVmNQTXd4TTdKYUU/view
👏 1
p
Lucas, well moving the line does not search for usages. So you migh as well use the "move argument" function in IntelliJ. Try it: `ctrl`+`alt`+`shift`+`→`