Development backups and documentation
As with any system where we can do development work, paying careful attention to documentation and backing up our work is very important. Visual Studio Code provides a variety of techniques for handling each of these tasks.
The first area where we can place documentation is in line with modified AL code. Individual comment lines can be created by starting the line with double forward slashes, //
. Whole sections of comments (or commented-out code) can be created by enclosing the section with /*
... */
. Depending on the type of object and the nature of the specific changes, we should generally annotate each change inline with forward slashes rather than wherever the code is touched so that all the changes can be easily identified by the next developer who will work on this code.
Tip
The easiest way to add – and remove – double forward slashes at the beginning of the current line or for a marked range of lines is to press Ctrl + / or Ctrl + #, depending on your environment’s language.
The best documentation resides outside of our source code. Visual Studio Code has built-in support for Git, which means that we can use any source code control system that supports Git repositories, including, but not limited to, GitHub, GitLab, or Azure DevOps.
There are some great resources on how to get started with Git, such as the ones we mentioned earlier in this chapter. A good explanation of using Git source control in VS Code can be found at https://code.visualstudio.com/docs/sourcecontrol/overview.
In short, when doing development in Business Central VS Code, everything we have learned earlier about good documentation practices applies. This holds true, regardless of whether development involves new work or modifying existing logic.