In order to improve creating scripts without IDE s...
# stdlib
j
In order to improve creating scripts without IDE support, adding this
typealias File = java.io.File
to the kotlin stdlib in the jvm part would be great, so we don't have to remember to add the import. But I don't know if there are plans to add a real multiplatform
File
to the stdlib "soon"
c
The shortest code should be the most correct.
java.io.File
isn't even the modern way to deal with files on the JVM, and is not multiplatform. I don't think any helper of the sort should be added until there is a multiplatform file utility, whenever that is.
3
But I don't think it will ever happen as part of the standard library, because the idiomatic way to deal with I/O in Kotlin is probably through coroutines, and dispatchers etc are not part of the stdlib.
j
A lot of kotlin stdlib extension functions are over
File
, that is the main reason I need that import when scripting
p
there are just as many stdlib extensions over Path, and Path is the superior class is every way
1
y
For multiplatform, okio is probably the right way for most people.
1
☝️ 1
☝🏼 1