Hi
 
Why don't the basic operators on the tuple objects return self rather than void?  Maybe I'm using these wrongly but....
 
 
I'd much rather say
 
    Point resultPoint = new point3f(firstPoint3f).sub(secondPoint3f).scale(3.5)
 
rather than having to say
 
    Point resultPoint = new point3f(firstPoint3f)
    resultPoint.sub(secondPoint3f)
    resultPoint.scale(3.5)
 
This is a trivial simple case but geometry calcs get complex.  Results can always be ignored if you don't want them.  The overhead of returning self is trivial!
 
If you think that this doesn't matter then bear in mind that if the basic numeric operators didn't return results then
 
    x = (- b + sqrt(b*b - 4*a*c)) / 2 * a
 
in would look something like
 
 
    Number work1 = new Number(b)
    work1.times(b)
    Number work2 = new Number(4)
    work2.times(a)
    work2.times(c)
    work1.sub(work2)
    work1.sqrt()
    work1.sum(b)
    work1.divide(2)
    work1.divide(a)
 
and we'd probably find it easier on an abacus
 
 
    Alex Bowden
 
  

Reply via email to