On Wed, May 4, 2016 at 10:07 PM, Johan S. R. Nielsen
<santaph...@gmail.com> wrote:
> Michael Orlitzky writes:
>> I have a matrix m... how come,
>>
>>   * m.rank gives me bullshit
>>   * m.rank() works
>>   * m.T() crashes
>>   * m.T works?
>
> This is in my mind the most compelling reason to phase out properties in
> Sage. I think Erik makes many good points, but ultimately I think
> consistency is more important. The problems with ? and tab-completion
> seem manageable, so I leave that aside.
>
> In many ways, programming math is a software designers worst nightmare,
> where designing the good API that is logical and works in all cases
> quickly becomes daunting. Michael's example above is nice: the rank of a
> matrix is an invariant, so it should just be a read-only property, just
> like all the my-first-@property-tutorials tells us, right? But by that
> logic, tons and tons of zero-argument methods should be read-only
> properties in Sage. And if someone later on implements a clever
> algorithm2 for computing the rank of certain types of matrices, and
> would like to toggle that by an optional argument, @property is suddenly
> a problem. And so where would you draw the line?

I think I agree with you here--I think ideally something like rank
should be a property, but there are good exceptions where it shouldn't
be, and so for the sake of consistency it shouldn't be in general.
I think matrix.T is a special case that should be viewed as syntactic
magic (and could be handled better with a better implementation of
"?").

I was mostly just objecting to Michael's earlier comment that
@property is not useful *in general*, and that's demonstrably not
true. But I've come to understand and agree with the overall sentiment
here that it should be employed *carefully* in Sage.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to