is there a best practice for when to use arrays/li...
# announcements
a
is there a best practice for when to use arrays/lists/varargs as parameters?
r
General rule of thumb I go by is to use varargs when you want a variable number of arguments, lists when you want a collection of arguments, and arrays when you specifically want arrays (if you don't know, use a list).
👍 1
e
also, go with lists (or arrays) if you want named arguments - using named args with varargs is super awkward, as you’d have to wrap them with an
*arrayOf()