


This post represents my personal opinion; sometimes it makes sense, often not. I reserve the right to edit/delete offensive comments, but I wouldn't mind a couple of politically incorrect statements here and there.
Everyone seems to know the feeling of being lost knee deep in a mess of code.
By using naming conventions you can help reduce the clutter….or at least organize your variables.
Here are some improvements that may help to keep your sanity.
1st Line: wrong way
2nd Line: right way
Numbers: use “num”
var thing:Number = 1; var numThing:Number = 1;
Strings: use “str”
var thing:String = "hello"; var strThing:String = "hello";
Booleans: use “bol”
var thing:Boolean = true; var bolThing:Boolean = true;
Arrays: use “arr”
var thing:Array = new Array(); var arrThing:Array = new Array();
Object: use “obj”
var thing:Object = new Object(); var objThing:Object = new Object();
MovieClips: use “mc”
var thing:MovieClip = new MovieClip(); var mcThing:MovieClip = new MovieClip();
Bitmaps: use “bmp”
var thing:Bitmap = new Bitmap(); var bmpThing:Bitmap = new Bitmap();
Obviously there are many more classes/etc but you get the idea. By always prefixing your variables you will narrow down the possibilities of creating an error…. or at least it does for me
Feel free to comment or make even better suggestions
Leave a Reply