@property - take it behind the woodshed and shoot it?

eles eles at eles.com
Fri Jan 25 11:50:22 PST 2013


On Friday, 25 January 2013 at 16:48:21 UTC, Simen Kjaeraas wrote:
> On 2013-37-25 17:01, eles <eles at eles.com> wrote:
>
>> On Thursday, 24 January 2013 at 08:35:01 UTC, Walter Bright 
>> wrote:
> But setting the hours field to 28 is natural? While I want all
> properties to be safe nothrow pure, it is unlikely to be a good
> idea to force this upon people.
>
> I'm all for putting it in the style guide, though.

See this answer here: 
http://forum.dlang.org/post/mdhvjbjqryzjljzqleay@forum.dlang.org

The problem is that programmers would start feeling like "it's 
better" to check every assignment for exceptions, in the case 
that the variable is latter converted into a throwing property.

I have no solution to that, though...

OOH, I feel it will lead to bad programming style. OTOH, I feel 
like masking a database interrogation behind a property will 
throw some exception sooner or later.

So, I am clueless.


More information about the Digitalmars-d mailing list