LOOPE - Lingo Object Oriented Programming Environment by Irv Kalb
Table of Contents
This "E-Book" is intended for Lingo programmers who wish to learn how to write object oriented code in Lingo. It is not intended as a primer on programming, nor is it intended as an introduction to Lingo. To understand the material presented here, the reader must already be comfortable with variables, handlers, and the basic control structures such as if/then statements, repeat loops, case statements, etc. I will assume that the reader already has a strong working knowledge of Lingo and has written one or more programs using it. I will attempt to build on these fundamentals by showing how using object oriented concepts within Lingo can give programmers a new approach to thinking about and writing Lingo code.
When I was in college, one particular programming course had a tremendous impact on me. The instructor, Robert Tausworthe, talked about the elements of well-written software. He called them the "ilities", and listed them as follows:
Reliability - minimizing the number of errors
Maintainability - ease of correcting errors
Modifiability - ease of altering or adding new features
Generality - applicability to a wide spectrum of applications
The ironic thing is that this list came from a course on Structured Programming. This course was given in the days before object oriented programming became popular. I believe that all programmers should consider the ilities when writing code. I have thought about these issues very often throughout my programming career. I hope to demonstrate that object orientation gives you tools to a good job of programming for the ilities.
The concepts of object oriented programming are not easy. If you are already used to structured programming, it may take a while for you to "get" the basic idea. I honestly feel that it took me about five years to become completely comfortable with the main concepts. However, I didn't have a book like this to guide me. To illustrate my points, I will attempt to use as many "real world" coding examples as possible. And I will use many analogies to point out how you may already think of interacting with objects in the "real world".
As this book progresses, I will explain the differences and similarities between objects and behaviors in Lingo. There is a great deal of overlap between the two. It was difficult to decide which should be explained first. I decided that it would be better to jump in with both feet and attempt to tackle explaining objects first. Once you understand the basic concepts of objects then understanding behaviors should be extremely easy.
All examples of code will be shown in this font:
SomeHandlerName someParameter1, someParameter2
-- some code here
When a new word is defined or a new concept is introduced it will be displayed in bold, like this.
This book will be an interesting experiment. Because this is an "E-Book", I will have the opportunity to continuously change the content. If I get feedback that a certain area is unclear, I can rewrite a section to clarify, add, or eliminate wording. Spelling mistakes and errors in code examples can be easily corrected. You can send feedback to me via email at: Irv@furrypants.com. Ideally put the word "LOOPE" in the title of your message. Although I cannot guarantee that each message will get a personal response, I will guarantee that all email messages will be read and thoughtfully considered. As the writing of this book continues, I may add an "Updates" page which will list dates and changes to chapters.
At the time that I am writing this, Director 8.5 is generally available. So, most examples and discussion will focus around features available in Director 8 and Director 8.5. However, because this is an "E-Book", I will be able to update things on the fly. There is now a list of updates available to show what has changed.
I would like to thank the following people for their insights into object oriented programming, their help in reviewing this material, or just in general being good people. An extremely large thank you to Mark Castle for reviewing and editing early versions of this work and for creating many of the graphics found herein. To Tab Julius for allowing me, as a completely unknown programmer/writer, to contribute to the Lingo User's Journal. And also to Tab for creating and maintaining the Lingo-L list. To Zac Belado and Pat McClellan for originating the Director Online User's Forum which gave me a vehicle to express myself. Through their contributions to various lists, many people have have had a great influence on my views about object oriented programming. Among these people are James Newton, Jakob Hede Madsen, Kerry Thompson, Andrew White, Mark Jonkman, Alex Zavatone, John Dowdell, and Warren (the Howdy-man) Ockrassa. Also thank you to Dave Mennenoh for the HTMLingo XTRA which was used to capture Lingo for this book. And of course, a great big thank you to John Thompson (the creator of Lingo), without whom none of this would be possible.
This book is dedicated to my family who found it hard to understand what I was doing banging away at my computer late nights and weekends.
Table of Contents