How do you eat yours?
I was staring at a lot of code last night and thinking, how is everyone dealing with AS2?
By this I mean, we are all coming from different backgrounds, personally I've taken the C route and stayed fairly procedural until the last couple of years, but others have come from C++ and Java and brought with them many OO practices.
The question is, when it comes to coding, what's your style? I hope this proves to be of interest to others like me, curious of "what is the best way to code in AS2?"....
Here's my answer to kick things off (if it's bad, just tell me I won't be mad !):
- I always no longer use "this" (as in AS2 it is implicit as in Java) to access properties in a class as I feel it is still easily readable if the classes are abstracted enough. (Not sure if there are speed issues as with _global?). Obvious exceptions to the rule are when the method parameter has the same name as a class's property, this.property = property; then works great
- I place all public and private properties at the start, before the constructor. (This seems to contradict MM's latest classes, such as Remoting AS2)
- I only use getter/setter methods when something else (other than getting/setting) is done within the method.
- I always use _array _mc etc to speed up my coding by 2x
I've noticed on recent MM code the complete reverse is for that first point, Any comments?
If this even get's 1 reply, that will be great!!
* Also with games, how do you set yours up? I like to create a Game class extending MovieClip that has an onEnterFrame loop check the "gameState" every frame with a switch statement and call the relevant methods based on the state, e.g. Logic/Move/Render...
Blog: http://www.richardleggett.co.uk | If your happy with the help, let us know about it
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Eat 3D||m. allen west||3D Programming||1||05-21-2009 11:45 AM|
|asp problems||havey||Server Side||3||01-14-2004 01:00 PM|
|eat this!!||veejay||Cool Sites||3||01-19-2001 10:43 AM|