Re: Software Architecture/Design
Richard Fabian <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
On 9 June 2010 00:20, Tom Plunket <[email protected]> wrote: > Anyway- this is a very strange discussion to me, having been steeped > in writing OO code in C, since obviously "the data knows nothing" and > all of the transformations were functions that took an "object" and > did some operation with it. > Sorry, forgot to comment on this bit earlier. In my experience/understanding of OO, an object class is both a data definition and the implementation of the methods that can be called on it. An object instance is a self aware data construct. >From this definition, the closest you can approach dumb data is persisting the type of the object somewhere other than the object's memory. It's still object oriented, but code is branching on some other data store. In your OO code in C, either your data did know something (i.e. it had a type persisted somewhere that branched code dependent on the object) or it wasn't object oriented. If you're just throwing around structs, doing processing in stages, then that's not OO, that's just procedural development. Importantly, the only things about OO that's wrong from a performance point of view are the same few things that happen no matter what language you use. In OO, as the process is driven by the data values, branch prediction becomes a mess, your I cache is thrashed by virtual calls, and your memory is overly bloated by heterogeneous data structures. Also, it's not called objects-oriented, it's called object-oriented, which should give you a clue as to the other performance bottleneck. I don't care what language you use, if you start using data-oriented non-OO techniques in any language, from assembly to C#, you'll see performance gains. -- fabs(); Just because the world is full of people that think just like you, doesn't mean the other ones can't be right. _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com