I took the various separate components of the new Pod parser I wrote (a base class for this, a derived class for that, etc.), and finally plugged them together last night, and ran a test on a Pod "Hello World" document. It works! It's just minor cleanup work now.
Yes, I said "classes". It's object-oriented. I thought a great deal about whether I wanted it to be that object-oriented -- by no means do I consider OO to be the default (much less "correct") way to do things. It has its definite advantages at times, and I sure don't mind having the interface that module users see be nice and OO. But when I sense that the OOiness is taking on a mind of its own as I'm writing the internals, then I know things are going in the wrong direction.
How to know if what you're writing is too object-oriented:
Most program[er]s don't need OOP (Score:3, Interesting)
- Fixing languages that are fundementally broken (lacking closures, for example)
- "Naturally" object oriented systems (CAD, Window managers, etc.)
- large teams of mediocre programmers in large companies
- large companies where make-work is desirable (look at all of the effort we're putting into this project!)
That said, an object oriented Pod parser is probably the way to go, mostly because (1) you've put a lot of effort into it already(One of these days, it would be nice to see what a functional foo parser would look like, and see if that would be significantly better measured against some meaningful axis...)
Reply to This
Re:Most program[er]s don't need OOP (Score:2, Informative)
abstract classes! (Score:1)