Hello, On Fri, Oct 5, 2012 at 5:02 AM, Matthew Rocklin <[email protected]> wrote: > >> > 2. It is a bit more sophisticated/clever. Requires you to think about >> > higher >> > order functions >> >> I think if you use a good class structure then it won't be. To create >> a new rule, one just has to create a subclass of something (maybe a >> similar rule, maybe a base Rule class), that just defines the key >> components of the rule (i.e., those parts that make that rule >> different from other rules). All the if, else, map, etc. stuff should >> be abstracted in base classes. > > This is a personal preference but I strongly prefer higher order functions > to inheritance. My prototype is unlikely to be OO. I think that objects are > overkill for this task.
I would like to vote for higher order functions as well. I agree that higher-order functions impose a little bit more thinking burden on a contributor with little or no background in functional programming; however, the strategies and rules as presented by Matthew are actually quite easy to grasp without a strenuous thinking process. On the other hand, since writing strategies is more of a CS task, while the rules themselves contain the actual mathematical transformations, I think using the functional approach will be even less effort-demanding for contributors who are well-versed in maths but not that strong in CS. And yet on the other hand, once one gets beyond simple examples, I believe the contrast between the complexity of class structures vs. the complexity of combining high-order functions diminishes. >> I'm glad that someone is finally taking initiative on this. I think >> that MatrixExpressions are both expressive enough but small enough to >> make a good testing ground for these ideas. > > I agree. I'm quite fond of that little module. I'm looking forward to it! I hope to have slightly more time in a couple days, so I'll be able to contribute more the discussion and coding. Sergiu -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
