Sie sind auf Seite 1von 12

Best Practices in AS400 coding

Sponsored by www.AS400Tutorial.com

Best Practice #1
Design:
Scalability:
Eg: Defining a master variable length keeping mind the organizations future scalability. This avoids field expansion projects later.

Modularity:
Split the program logic into a list of programs/modules. Then craft the design to have the modules beautifully interact with each other to serve the main purpose. (The word beautiful has been used here on purpose)
www.AS400Tutorial.com

Best Practice #2
Coding: Variable naming convention
Every organization has its own standards, in absence of which you can follow below:
Work variables prefix W_ Eg: W_Count Arrays prefix Arr_ Data structures DS_ Subroutines prefix $ Meaningful names such as $CalcUnitPrice
www.AS400Tutorial.com

Best Practice #3
Coding: Aesthetics
Document heavily
Document the code as heavily as possible. Before every variable, every subroutine, every business logic.

Use coloring
Differentiate the comment lines with white color. Helps enhance the looks and aesthetic aspects of the code.

Use indenting in free form coding Use tags for changes to an existing program
www.AS400Tutorial.com

Best Practice #4
Coding: Performance
Move repetitive common code into a subroutine Avoid the use of GOTO as much as possible Consider performance issues while using embedded SQL and file reads. Use the correct type of joins and logical will boost performance.

www.AS400Tutorial.com

Best Practice #5
Coding: Backups
Take backup Take backup Again, always, always, take backup Talk to your data center to see if there is a full or an incremental backup daily. If not assign someone to take a backup of the source physical daily.
www.AS400Tutorial.com

Best Practice #6
Coding: Review
Use code review checklists Be as pessimistic as you could while reviewing Consider performance issues in the long run Call a stick, a stick. If the coding is not upto your organization standards, feel strong enough to voice your comments.
www.AS400Tutorial.com

Best Practice #7
Coding: Extras?
Avoid gold plating. Period. Deliver only whats being requested in the requirements. Make sure every line of code directly or indirectly traces back to an approved requirement.

www.AS400Tutorial.com

Best Practice #8
Unit testing:
Write unit test cases before coding. This ensures we have clarity on whats going to be coded and reduces errors, saves time Ensure each and every line of coding is tested. Any given added/modified line of code must be traced to a unit test case.
www.AS400Tutorial.com

Best Practice #9
Stabilized code (after CUT)
Once coding and unit testing (CUT) phase is over, dont modify the code unless its a part of QA or UAT defect. Should a defect found internally by dev team, not a part of QA/UAT, a code change must happen only after its approved by the project manager/lead. At this point, keep code changes to a very minimal.
www.AS400Tutorial.com

Best Practice #10


Change control processes
Check with your organization administration on the change control tool being used.
Eg: Turnover, Aldon etc.

Usage of change control tool not only automates a plenty of tasks but also serves as a big relief when it comes to roll back or searching for previous versions of archived sources.
www.AS400Tutorial.com

Next steps: - Implement these best practices in your organization - Share your best practice with us at info@as400tutorial.com - Sign up to receive similar useful material at http://as400tutorial.com/join
www.AS400Tutorial.com

Das könnte Ihnen auch gefallen