Hacker News new | ask | show | jobs
by codygman 2090 days 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?