Python vs. C++ Builder - speed of development
Brandon Van Every
vanevery at 3DProgrammer.com
Mon Feb 3 21:08:00 EST 2003
Andy Freeman wrote:
> "Brandon Van Every" <vanevery at 3DProgrammer.com> wrote in message
> news:<%In%9.4882$6P2.543391 at newsread1.prod.itd.earthlink.net>...
>>
>> I don't create a more abstract class until it is proven that I need
>> one.
>
> Do you write inline code for matrix multiplication or do you use a
> (small) set of procedures?
I have a matrix class with plenty of inline functions. I haven't needed to
optimize anything yet. When I do put on the optimization hat, I break out
the matrix into individual operations according to what the CPU does well.
That's a pretty late stage of the development game though.
> The "need" is to avoid writing basically the same thing multiple
> times.
> Procedures satisfy that need in some contexts and templates satisfy it
> in others. There is no difference in kind.
I know that I need the matrix over and over again. If I didn't, if I only
needed dot products between vectors, I wouldn't write a matrix class. In
fact, I didn't! Nor did I implement up-front all the things you can do with
matrices. I didn't need an inverse for a looong time. As far as I'm
concerned, the proper way to implement functionality is by lazy evaluation.
Otherwise you are wasting your time theorizing about what functions you
*might* need. Stick to what you *do* need.
--
Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA
20% of the world is real.
80% is gobbledygook we make up inside our own heads.
More information about the Python-list
mailing list