Hacker News new | past | comments | ask | show | jobs | submit login

Is there any useful argument to be had around this, for pragmatic purposes?

No one disagrees about what Java is doing here (that I know of).

Naming is a problem if people are writing bugs due to the poor explanation.

But I can't think of the last time I've actually seen bugs caused because anyone who thought that, for example, a swap() method would work in Java.

It's something that brand-new developers might muddle up, but usually they'll learn how it works within the first year, no? If they keep track of how to treat primitives vs. objects in methods by saying "Java passes primitives by value, Objects by reference", and that works for them, that's okay. I think a senior dev should know a bit more about what's really going on, but I'm not waste the time of a mid-level programmer because, even though this code is correct, I want to talk for 20 minutes about the reason why it's correct wasn't worded quite right.

I'm far more likely to see bugs caused by people misunderstanding Java's auto-boxing/unboxing of primitives for method calls ("how the devil is this line throwing a NullPointerException?").




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: