Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
niteshade
· 13y ago · 0 comments
Absolutely non-intuitive?
Comments
[–]
gh0zt
13y ago
I think the point here is that you'd have to do something like this
$x = new Number(1) $y = clone $x; $y->absolute();
to work with the absolute value of variable $x without actually changing $x
[–]
agumonkey
13y ago
Yes, this is a common source of bugs when you're not sure what is changing. See below, someone suggests to use 'to' and 'as' prefix to convey immutable / mutable methods.