So I noticed this a lot with AS2 but with AS3 I see it more and more. My first instinct is to attribute this “trend” to a lack of formal training when it comes to programming but this practice is so wide spread that I think I must be missing something.
Coming from a C/C++ background I have a very strict understanding of what a class is, what it does, and how it’s used. When I create a class it is an object with it’s own properties and methods. There is then a driver which is the actual program which makes use of my classes.
The word of the day is encapsulation.
A few times now I’ve received FLA files which have one or two lines of Actionscript in them. Instead of acting as a driver, the FLAs are basically just a library container with classes assigned to movieclips in the linkage. These designers then attempt to drive the entire program through their classes and very often achieve some visually impressive results;however, the bottom line is that they have managed to take an object orientated form of coding and reverted to procedural code. What was the point of the class then? It’s no longer a class if it’s the basis of your entire program. It’s no longer an elegant piece of portable code that you can reuse if it has been come the entire project. Now it’s just a template I guess.
This has been throwing me off for a while. Why do I see this over half the time? What is the benefit of coding like this?