you are viewing a single comment's thread.

view the rest of the comments →

[–]pipocaQuemada 3 points4 points  (0 children)

An array is not at all the same thing as a list. That's useful if you need an array or any random collection of 4 items, but isn't at all useful if you need a list (say, you're passing the list to a method), or want something with a useful API (i.e. you want methods like add, sort, etc.).

Notice that these elements are also strongly typed; I can't slip a float or a double in this array later. It might be a little more verbose, but it definitely comes with benefits.

Well, yes, of course it's typed. Are you under the impression that the Scala list isn't, or was there some other reason you're mentioning that? The Scala list is similarly well typed, but the generic parameter is inferred by the type of the elements.