in reply to Make everything an object?

BrowserUk makes a number of good points and he's arguing from a sound starting point. Objects are way overused and, ofttimes, there are much better ways of handling things.

The point behind objects is to have intelligence. I have recently written a SQL parser. The parser emits a whole mess of objects and I think BrowserUk would agree with why. The first is that the whole thing knows how to stringify itself, from any point. The second is that I can descend the parsetree simply and easily without needing to know how its represented. Most parsetrees are somewhat regular. SQL's isn't. Hence, hiding complexity.

Your point, too, is well-taken. But, it's not a point about objects - it's a point about APIs. Your same point can be made about good libraries, too. Take Perl. It's a program that responds to an API. Do you care how hashes are implemented? The hashing algorithm changed signficantly between 5.6.0 and 5.6.1 - did you notice? Did you even know?


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Good APIs are the key (was Re: Make everything an object?)