arrayOf unnatural

@Gawie_Kellerman

I personally was very glad when I learned that Kotlin did NOT have any special syntax for arrays and treated them the same as other data structures.

In Kotlin (like in Java) I use a whole bunch of different kinds of lists, sets and maps. Why arrays should be different? ArrayList is used much more often than Array, but you wouldn’t want a special syntax for ArrayList, would you? There is no way they all are provided with their special syntax.

By design arrays should only be used in those rare cases when you need super-performance (tight loop operations or something). That’s why they lack many convenient utility extensions, which makes it impractical to use arrays often.

For almost any task an ArrayList is better than an array (even with boxing). The only inconvenient use case I know is using arrays in annotations (no choice there).

I wanted to express my opinion in order to prove that there is NO unified point of view that array literals are missing in Kotlin. Many celebrate their removal.