News for hackers. Stuff that matters.
Re:OO is not Computing, Newer is not More modern by seanmcdirmid on Monday April 30, 2012 @08:22AM (#3908897)
OO gets a bad rap, it is incredibly useful in applying ontology to program structuring. Yes, OOP in Java isn't ideal, but if you look at more pure OOP languages like Smalltalk or Self, its virtues really do begin to shine through.

FP is great when expressing computations, but we often are just gluing nominal entities together, where OOP excels over FP. I like to have a few FP options in my languages (C#, LINQ), but my mind is firmly rooted in objects when it comes to overall macro design of the program.

Re:OO is not Computing, Newer is not More modern by ajuc on Monday April 30, 2012 @09:05AM (#3909025)
OO is great for systems, where you have real objects, and only care about their current state. In effect - for simulations, games, such stuff.

In most systems - changes over time, archival data, and relations between objects are important. And with OO it's ugly to keep them. You end up implementing relational db backed by object collections. And your nice objects instead of representing nouns (Employee, etc.), start representing relations (Employement, etc.).

So people use relational db with ORMs and load everything from database into objects only to show window/edit data, call one or 2 methods on these objects, and save data back into database. All this ceremony to write employee.giveRaise(raise) instead of giveRaise(employee, raise).

Re:OO is not Computing, Newer is not More modern by seanmcdirmid on Monday April 30, 2012 @09:27AM (#3909121)
And yet this problem kind of goes away in a key value or graph database. I wonder if the ORM mismatch is often not one of objects getting in the way, but one of using relational in the first place. At anyrate, how you manage your objects (for things like search) is ideally orthogonal to the objects themselves; though this is difficult to accomplish in practice.

I use objects in reactive (non-persistent/DB) systems all the time. Objects aren't the problem, but you do have to manage your dependencies dynamically by tracing/dirtying/and cleaning. Objects actually excel at encapsulating and managing state, it is much harder to do this with functions (see all the work on functional-reactive programming).

Re:OO is not Computing, Newer is not More modern by ajuc on Monday April 30, 2012 @09:55AM (#3909230)
Hm, I've never used key-value/graph datastore, and it seems I need to. Is there something like selects with joins for graph nodes? How do you represent changes in objects over time?