top | item 24608478

(no title)

codygman | 5 years ago

> If you have the option between creating a function which accepts a string (e.g. ID) as argument or accepts an instance of type SomeType, it's better to pass a string because simple types such as strings are pass-by-value so it protects your code from unpredictable mutations

What if you work in a language where SomeType is pass-by-value?

Would you still prefer the string?

discuss

order

No comments yet.