[Grok-dev] Re: Fields inner class support removed in branch

Martijn Faassen faassen at startifact.com
Fri Sep 14 09:55:53 EDT 2007


Luciano Ramalho wrote:
> Thanks for this, Jan!
> 
> I will add this idiom to the doctests.
> 

Note that I personally am not a big fan of this idiom. Various reasons:

* I like simple attributes instead of properties as they just make 
reasoning about the code easier. Of course properties are cool, but in 
moderation.

* If a form is used, validation of the field will happen twice: when the 
form is submitted, and then again when the data is set. This seems 
redundant. :)

* a vague dynamic typing feeling: I don't want my runtime to do a lot of 
checks - if I really want to set a property to "foo" I should be able to 
do it, even if the field doesn't allow it. This isn't very well 
reasoned, but I got the impression in the past that sometimes it can be 
limiting to the programmer.

This is mostly a personal choice though. I don't think we should 
overemphasize this feature, as in having a culture of "You should be 
using FieldProperty in your code, you horrible heathen!". I'm fine with 
offering it as a sometimes useful option to programmers though.

Regards,

Martijn



More information about the Grok-dev mailing list