At 11:10 PM +0100 9/3/02, Ross Clutterbuck wrote: > > >Fruther to that, if anybody has used some of the real kick-ass scripting >stuff (like extensive or OOP ... >
Object oriented programming is a different way of thinking from procedural coding. I was bitten by the OOP bug many years ago, and now I just "think in objects". The whole concept of data and code working together in a unit (an object) makes so much sense to me, that I couldn't concieve of any other way to write code. I always break my programs, no matter what size, into a number of global objects - each of which is responsible for a different part of the program. For example, I almost always have a Navigation object that handles all navigation in the program. If I am doing any tracking of the user status, I create a User object. If I have a database, I create a Database object. All code dealing with these seperate areas lived in its own seperate object. There are a number of benefits. The single biggest benefits are that it makes debugging and changes much easier. Debugging is made more simple because if you know what part of your program is screwing up (for example navigation), then you know that the problem must be either in the Navigation object or in the places that call the handlers in the Naviation object. Perhaps the biggest benefit is in the localization of changes. In my big recent project, half way through the project, the client came up with a whole new way to do navigation. To implement the change, I only had to change code in the Navigation object. Also, there was a an area where we had a problem with the speed of database access. I was able to completely rewrite some code in the database object to speed up the program without having to make a single line change anywhere else. Another big big benefit is the ability to use multiple "instances" of an object, each with it's own set of data. If you have ever attached the same behavior to multiple sprites, you have been doing this yourself. Behaviors are an excellent implementation of objects. To find out more about OOP in Lingo and why it's a good thing, feel free to check out my on-line EBook at: http://www.furrypants.com/loope Irv -- Lingo / Director / Shockwave development for all occasions. (Home-made Lingo cooked up fresh every day just for you.) [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
