Desktop version

Main > Knowledge Base > Best practices > Code conventions > Using 1C:Enterprise script clauses > Using duplicate script fragments > Best practices > Code conventions > Using 1C:Enterprise script clauses > Using duplicate script fragments > Best practices > Code conventions > Using 1C:Enterprise script clauses > Using duplicate script fragments

Using duplicate script fragments

This article describes the standards that apply to duplicate script fragments. All of the listed recommendations are mandatory unless noted otherwise.

1. Duplicate script is defined as script fragments or entire procedures or functions copied during the implementation of functionality that has the same logic as another functionality available in the configuration.

Using duplicate script fragments might cause the following issues:

The script is often duplicated because the original fragment cannot be accessed (for example, the required fragment is located in a form module and therefore cannot be accessed from another form).

We recommend that you avoid duplicating script fragments whenever possible. It is usually done by refactoring the existing script and moving procedures an functions that you want to reuse from form and object modules to common modules.

2. Remember that duplicating script fragments is acceptable and recommended if future development will lead to significant changes between the original and duplicate script.

Next page: Using global variables in modules





© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.