Tuesday, 8 December 2009

Good programming practices for AS3

When you are coding Actionscript code it’s always good to use some coding practises to make your life simpler. Below is a list of some good coding practices that people should be aware of. If you have any suggestions leave a comment below.

Naming conventions – When you are naming a function or variable you should make sure you use a name that describes what the function or variable does.

Formatting – The layout of the code should be consistent with the whole AS file, as a badly formatted layout can be difficult to read.

Comments – Add comments to your code so it is clear exactly what your code does. If you need to return to your code after many years, you should be easily able to identity your code. Good comments also allow other users to figure out what your code does.

Reused code – Always think of ways you can reuse code. For example, a function that can be used in more than one place.

Program modular – Separate large pieces of code into smaller pieces to help with reusability. This will also help if you need to modify your code later on.

Simplify – Don’t over complicate your code. Always find ways of minimising coding. For example, if a coding activity can be accomplished with ten lines of code. Don’t write code which takes up 20 lines of code.


Suta 8 December 2009 at 16:04  

Good tips! And these could probably be applied to any computer language. Java in particular. >.<; Ugh. Hate Java.

  COPYRIGHT © 2014 · ILIKE2FLASH · Theme by Ourblogtemplates

Back to TOP