in reply to coding of algorithms is inherently procedural

I recently referred to the Mastering Algorithms book, and as a result used the Graph module. When I started, it seemed that I needed to write a lot of difficult code, and I dreaded the bugs. Instead, my OO graph representation using this module solved the whole problem in about 10 lines of code. No bugs found so far!

I think the graph module shows an example where the algorithms are naturally object-oriented. They match at least these three hints paraphrased from Damian Conway's ten rules for when to use OO:

Other good examples for OO would be matrix and graphics algorithms.

It should work perfectly the first time! - toma
  • Comment on Re: coding of algorithms is inherently procedural