Home AMXForums Archive Threads Residential Forum

What i have gathered so far...

jisaacjisaac Junior MemberPosts: 34
gentlemen,

im a few weeks away from taking another crack at the ACE programming track. In my effort to actually succeed and develop habits to write clean efficient programs, i have come up with what i see to be good programming practices across the board.

1. Subroutines:
This is another name for what is basically a macro. Mostly all multi step actions will
have one and there should be some for misc. actions such as parsing strings from
devices.

2. Que's:
Namely command Que's. Usually accomplished using some sort of array. This is akin
to what a router or switch does in a network, manage incoming and outgoing traffic.

3. Modules:
The lifeblood of programs in Netlinx. If possible write or utilize one for every device in
a system. This also makes it easier to make changes on the fly.

4. Events:
mapping of actions to button, levels or data. This has the most to do with your
touchpanels/keypads. Its good to also include page flips and pop-ups in the code
versus doing it in TPD4.

feel free to add anything to the above. The more the better. Thanks to everyone who has contributed to my threads, i really appreciate it.

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    I would modify the subroutine policy to any set of multiple actions that needs to be repeated. There is no point to calling up a subroutine on a button press, for example, that only happens on that button press and in no other place. You may as well just put it inline. The only exception I would make to that is if it's a really complex operation - in which case it does make sense to break it into a subroutine, if only to make it easier to find and edit.
Sign In or Register to comment.