A lot of us are finding that our code has become larger in AS3 than in AS2. But I wonder, how much of this is needless elongation? And are there any actual disadvantages brought about by having more ActionScript code?
I’ve got a good example to reflect on. There is a simple video game named FLUID (no link, sorry) created for a museum some ten or so years ago by Manhattan-situated GameLab, LLC. I rewrite it time and again from the ground up, because it’s a nice exercise. (I recommend it.)
This time around, I decided to compare my code’s line count with the previous version’s. There are four major changes in the latest version, which are typical at this time in lots of our Flash projects:
[LIST=1]
[]Migrated to AS3
[]Truly Object-Oriented (composed of custom classes)
[]Brings as much motion to the code side as possible (tweening)
[]Increase in eye candy
[/LIST]
You can play my last version here, and my latest version [URL=“http://www.rpi.edu/~sachsj/fluid/fluid.html”]here.
The AS2 version is about one year old, but I feel the quality of the two versions’ code are on par with each other. That is to say, I spent too much time on both of them.
So. The AS2 version is made of 525 lines of code. The AS3 version is made of 1048 lines of code, a 100% increase. I haven’t made any serious changes to the game- the two versions of the game have identical gameplay- but the code length has doubled, presumably for the four reasons listed above. Is it worth it?