Comment

Comment by tunesmith

Is it bad to completely ignore this behavior? For instance, something like:

Dog d = new Dog("fido"); d = alterDog(d);

public Dog alterDog(Dog d) { d.name="arfybark"; return d; }

It's not quite a pure function since it changes it in place, but at least the parameters and return types reflect the method. I ran across a term for this practice in the past but don't remember what it's called.

parent tunesmith 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton