Overview and Recommendations
Configuring Projects for Compiling
Making the best possible use of the BASIS IDE and its compiler features sometimes requires changing the configuration of a software development project. The IDE is a flexible and adaptable tool that handles many different types of projects and ways of doing business. To gain maximum benefit from the IDE, follow the general recommendations listed below:
-
Maintain separate versions of source text and tokenized files. This is the most critical recommendation. It will be impossible to properly use a source code Version Control System (VCS) if text and compiled Business BASIC files are considered interchangeable, since change tracking is text-based and cannot work with binary data. The IDE includes separate tools for working with text versus binary data. Text files are meant to be edited, modified, and archived, while compiled token files are meant to be executed, tested, and debugged. Business BASIC traditionally blurred those distinctions.
-
Implement a standard file naming convention. A standard file naming convention goes hand-in-hand with separating source and tokenized files. It is recommended that source text files use a standard file extension, such as .src, and compiled files use another, such as .bbj or .bbx. Pure data files should be given an extension such as .dat. No Business BASIC file, text or tokenized or data, should ever be created without an extension. File extensions should never be shared between different types of files. Standardized extensions make it possible to tell what a file represents and where it belongs by simply looking at its name. All the extensions used for Business BASIC files should be registered, which makes it possible for the IDE to display a type-specific icon by the name of the file in the Explorer. A small number of standard file extensions are easier to register in the IDE and more efficient for the IDE to process.
Furthermore, it is not always practical to apply such a naming convention to an existing legacy software application that formerly took advantage of Business BASIC's lack of traditional standards. However, the IDE can still work with the legacy application. In fact, after registering all of the extensions for application to the applied to Business BASIC files, the IDE still distinguishes between text, tokenized, and data file types - regardless of their file extensions or location. See the Configuring a Legacy Application for additional information. -
Implement a standard directory tree structure. A well-conceived and simple directory structure contains the files belonging to a development project. Because the Version Control System will mirror this structure, it must be extensible and adaptable, but robust enough to not require constant revision. A good tree structure groups files of the same type together in the same directory. For example, a "resources" directory that stores images and other GUI resources, a "data" directory for pure data files, a "lib" directory for method libraries or .jar files, and "doc" directory for documentation and help files.
One might ask if text and tokenized files should be kept together in the same directory, or is it best to keep them in separate directories? There are pros and cons to each situation. If the two types have different file extensions, and the extensions are registered as BBj Object Types in the IDE Configuration ->System ->Object Types ->BBj Files option, then they will have different names and different icons. They are easily distinguishable, even if kept together in the same directory. Storing both types together is more convenient for debugging BBj code, since the breakpoint .bpf files will be available to both the Source Editor and the Debugger. If the tokenized files are kept in different directories, a .bpf file created by the Source Editor will have to be manually copied to the location of the tokenized files before the Debugger can access it, and vice-versa. However, this consideration does not apply when developing BBx PRO/5 or PROGRESSION/4 code, since the Debugger is connected only to a BBj interpreter. On the other hand, keeping source text and tokenized files separated in different trees may make the packaging and deployment of the application easier. In addition, a segregated tree can look cleaner and seem more manageable with a VCS. -
Avoid mixingBusinessBASIC versions within a single NetBeans Project. Compiling in the IDE depends on the type of compiler selected in the Business BASIC Compiler Types option. It is possible to forget about setting this option, which may result in the creation of tokenized files of the wrong type in the wrong location, or syntax errors in the output, or other subtle problems. Generally speaking, it is not a good idea to mix PRO/5 or PROGRESSION/4 files with BBj files in the same directory or NetBeans Project. If using the IDE to develop more than one type of Business BASIC, invoke the Project Manager from the Project menu and create new NetBeans Projects to contain exclusively BBj or PRO/5 or PROGRESSION/4 directories and files.