[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: settag again
- From: Reuben Thomas <rrt@...>
- Date: Fri, 4 Jan 2002 11:43:27 +0000 (GMT)
Another suggestion: stop settag returning a value. Functions that return
the value of one of their arguments is a C-ism, like assignments returning
the value of the assigned quantity. It's a way to write nasty code.
In particular, with settag it's not obvious which value you get back. If I
were writing or reading code in this way, I'd probably have to check the
manual every time I read (or wanted to write)
t2 = settag(t, tag)
or
return settag(t, tag)
or somesuch.
In both cases, the alternative is much clearer:
settag(t, tag)
t2 = t
or
settag(t, tag)
return t
--
http://sc3d.org/rrt/
penitent, a. undergoing or awaiting punishment (Bierce)