On 2/14/2013 10:14 AM, Öö Tiib wrote:
> [..]
> 'value' (as noun) can not be considered non-property of something whose
> 'value' it is. I never provide properties as L-Values for any by-passer
> to store references at and change at will. I feel it error-prone.
>
> I prefer immutable (after construction) properties. I feel it is safer
> It can be LOT more efficient if property's value is even set
> compile-time. Consider such things about every property.
>
> If there is certain need to mutate a property during object's life-time
> then it deserves command-like operations named by verbs. It is better
> to make such operations as safe and complete as possible. Keep invariant
> of whole object under its own control.
>
> 'value' is still hard example since it is fitting verb too. On such cases
> I prefer to use some synonymous verb (like 'assess', 'estimate', 'evaluate')
> to reduce the possible confusion:
>
> a.revalue( b.price() + c.net_value() );
Uh... Perhaps it's a wrong path we're trying to follow. 'Price' is a
verb as well as a noun, 'estimate' is a noun as well as a verb...
There is something to be said about 'set' as well (it's a noun too, I am
sure you've heard of 'std::set' :*)), but in combination with another
word it is less likely to be confused. I would definitely prefer
'set_value' to 'revalue' (along with 'value' as a "get"-like accessor).
But that's just me. Keep in mind that readability is still
subjective, let's not try to deceive *ourselves* into thinking that
there can be a complete set of readability rules suitable for everybody.
V
--
I do not respond to top-posted replies, please don't ask