Hacker News new | past | comments | ask | show | jobs | submit login

I started using Kotlin on the weekend and I have been pretty happy with it. The only issues I have with it so far is that I would like to use a package name with more than two identifiers (eg. com.android.scripting, instead of just com.android), and there isn't a succinct way of declaring multidimensional arrays. I resort to doing something like

        val arr: Array<Array<Tile>> = Array<Array<Tile>>(height, { x ->
            Array<Tile>(width, { y -> Tile(x, y, Terrain.GRASS) })
        })
Now I'm looking at writing my array in Java instead and making good use of Kotlin's interoperability with Java. :)



Most of the time you can omit type arguments:

        val arr = Array(height) { x -> Array(width) { y -> Tile(x, y, Terrain.GRASS) } }




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: