Maybe another feature for a methodology is to break your code up into categories..

In Flash I have the following, but follow a similiar concept when working with CFMX (I pinched it from Spike, so KUDOS to the irish man!)



/**---------------------------------------------------------------------------
      CONSTRUCTOR

---------------------------------------------------------------------------*/
  function className() {

}

In AS2.0 I generally put my constructor code here along with my init() methods. Also a components propertys here aswell.

/**---------------------------------------------------------------------------
Management Methods
---------------------------------------------------------------------------*/
Usually all set/get/create methods go here. getMonkey(), setAMonkeyToFly() etc..


/**---------------------------------------------------------------------------
Process Methods
---------------------------------------------------------------------------*/
internal sub-logic here, usually things like "draw(), layoutUI()" etc. In CFMX terms, you could put stuff like convertUSDtoAUD() or something like that.


eg:
_doMonkeyFly();

/**---------------------------------------------------------------------------
      Event Methods
---------------------------------------------------------------------------*/

If you use Mach-ii i guess you could use a "event" style approach, but in regards to Flash etc, i usally put all event methods here. onResult(), _onMouseOver()

/**---------------------------------------------------------------------------
Misc (To weird to be pigeonwholed)
---------------------------------------------------------------------------*/
Really abstract methods that either cross-over into all categories or just obsecure (never really found a use yet, but reserved for future).




Now, not saying you have to follow exact suite, this is merly an example of how to structure ones code so that it can easily navigated around. I typically also split each category into two sub-categories (Private, Public, Remote) so that you can follow a pattern of approach. Great for things when you need to quickly navigate through tonnes of code.

Its worked for me personally and has allowed me to keep things nice and clean.

Regards,
Scott Barnes
-
http://www.mossyblog.com
http://www.bestrates.com.au

Taco Fleur wrote:

It looks more like a coding standard than a methodology ("use a coding standard" can be part of a methodology).


meth.od.ol.o.gy
A body of practices, procedures, and rules used by those who work in a
discipline or engage in an inquiry; a set of working methods: the
methodology of genetic studies; a poll marred by faulty methodology. The study or theoretical analysis of such working methods. The branch of logic that deals with the general principles of the formation
of knowledge. Usage Problem. Means, technique, or procedure; method.


Specifying naming conventions and indentation is more of a religious issue than almost anything else and some of your recommendations are very controversial (specifying "tbl" as a naming prefix for tables, for example).


"tbl" I had to think about that one for a long time, for a while I did away
with it, but then I found it worked better with the prefix, simply so its
clear in the SQL statements what a table is, I know you can figure that one
out by looking hard enough, but this way I can see it immediately. Besides a
lookup table is prefixed with "lkp"..


The most important thing when developing is code is not *which* coding standard you use but simply that you are *consistent* across all of your code - and obviously it's better if you document that consistency (as your own coding standard).


Agreed, it does not matter to which standard someone adheres to, as long as
the standard is consistent throughout the team, and whoever else works with
your code. Or do you think that one person using one standard on a project
and another person using another standard is acceptable and works well?
I don't know about yourself, but it annoys the hell out of me, and slows
down my work drastically when I have to work with inconsistent naming, upper
lower lower upper upper, no tbl prefix, tbl prefix, and I usually convert
the code I have to work with to the standards I am used to, simply because
it speeds up my work.



For comparison, you might like to read the Macromedia Web Team's coding guidelines (and their Mach II Development Guide):
http://livedocs.macromedia.com/wtg/public/


I will have a look at it.


These can be downloaded and used as a basis for your own coding standards and modified as you wish (as long you retain an acknowledgment that it is based on the Macromedia guidelines).

Sean A Corfield -- http://www.corfield.org/blog/

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
-- George Bernard Shaw


You are very subtle!

However I an not trying to adapt anyone to my own standards, I am presenting
something I think is worth while having a look at. When I started out, I
worked with Fusebox, unfortunately it did not quite work like I wanted it to
work (not to say it wasn't good, just not for me) after that I sort of
adapted my own way of working, by trail and error. If you don't mind I'd
like to make it publicly available and have it to help anyone that it can,
as I said any constructive (Serving to improve or advance; helpful)
criticism is more than welcome, but I really have not received any so far
;-))

Thanks




-- Scott Barnes http://macrofun.pvpers.com


--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to