https://kotlinlang.org logo
Title
u

ursus

10/19/2019, 2:56 AM
A: fun foo(parentId: Long, itemId: Long) 
B: fun foo(itemId: Long, parentId: Long)
m

Mani

10/19/2019, 3:36 AM
how does the order matter? But I would personally prefer writing most valued param as first param, most valued can be derived from domain logic
u

ursus

10/19/2019, 5:25 AM
it doesnt, its just style .. what do you mean by
most valued can be derived from domain logic
?
d

deactivateduser

10/19/2019, 8:08 AM
My personal preference is to have the parameter higher in hierarchy comes first. Taking from your example, it would be parentId followed by itemId.
m

Mani

10/20/2019, 8:58 AM
I agree with @deactivateduser