Forum Post: AW: Strict mode for the ABL Compiler - Community input is requested

Status
Not open for further replies.
M

Mike Fechner

Guest
Simon, be aware. Dr. and I in agreement and Tom agreed with me as well.... at least on one post! You are in danger already, mate! Maybe the caps are orange? Von meinem Windows Phone gesendet Von: Simon L. Prinsloo Gesendet: ‎24.‎03.‎2015 07:01 An: TU.OE.Development@community.progress.com Betreff: RE: [Technical Users - OE Development] Strict mode for the ABL Compiler - Community input is requested RE: Strict mode for the ABL Compiler - Community input is requested Reply by Simon L. Prinsloo First off, the implementation. I would prefer that these be set session wide on the COMPILER handle, rather than amending the syntax of the COMPILE statement. a startup parameter can be used to set the defaults The ability to mark an option as Error, Warning or Off as per the doctor's suggestion, to which Mike agrees! The pattern I have in mind is similar to what we have with LOG-MANAGER:LOG-ENTRY-TYPES. Examples: -compilerOptions "DatabaseObjectAbbreviation:2,Deprecated:1,MissingReturn:2" COMPILER:OPTIONS = "UnusedVariables:2" It would be handy to have a method to append/update the list, e.g. in a session with -compileOptions "EnableAll:3" COMPILER:SET-OPTIONS("UnreachableCode:1,UnusedVariables:0") Will update the entry for UnreachableCode to be a warning only and remove the Unused variables option. 1. Abbreviated keywords: Bad style that does not introduce significant risk. Eclipse editor keyword expansion is sufficient. 2. Abbreviated database objects: Yes, please! Kill this ticking time bomb! 3. Fully qualified database references: NO! This introduces more work with no gain. The compile fail in any case if there is ambiguity. 4. Identify unreferenced variables and properties: Variables - YES, Properties? NO! How will you know? The object may be a complex data container used to pass as parameter.... Unless the SET (or GET) is PRIVATE with no initial value. 5. Identify unreachable code: The compiler does this already... 6. Methods and functions without a RETURN: Yes, by nature all code paths should return something, unless an error is thrown, of course. 7. Other: Buffer-Field names to be qualified with the buffer name. Warning when the global procedure/class buffer is used, unless an annotation on the procedure/class header signals the intend to use the global buffer. Waning about use of deprecated constructs, including METHOD, CONSTRUCTOR, FUNCTION, and PROCEDURE directly preceded by @Deprecated( [ Message="Some helpful message of what to use instead" ] ). Warning when a temp-table or variable is not explicitly defined as UNDO or NO-UNDO Warning if a database buffer read with no explicit lock option will result in a SHARE-LOCK Warning if a buffer's lock will downgrade to a SHARE-LOCK at the end of a transaction. 8 More Other Two header keywords, with similar rules to BLOCK-LEVEL, ROUTINE-LEVEL and USING (e.g. at the top of t he file before any other statement): OS-PORTABLE. Compiler will only accept "~" as the escape character. Use of "\" (but not "~\"), .Net classes, EXTERNAL routines (*.dll or *.so) causes a compile error, unless the statement is annotated with @OSSafe(), for cases where the programmer handles OS-specific items, e.g. @OSSafe(TRUE). IF OPSYS="UNIX" THEN OS-COMMAND ~~/scripts/doInterface.sh. ELSE OS-COMMAND VALUE(OS-GET-ENV("HOME") + "\batfiles\DoInterface.bat"). @OSSafe(FALSE). UI-PORTABLE. The compiler gives an error if the code contains any visual element, e.g. a frame, that is not portable across the UI. Special consideration is needed where output is opened to a stream (the STREM-IO frame option will most likely be key) since it should be possible to run the following regardless of the UI environment used to compile: vFile = SESSION:TEMP-DIRECTORY + "/" + GUID. OUTPUT TO VALUE(vFile): FOR EACH Customer WITH STREAM-IO: DISPLAY Customer.CustNum Customer.Name Customer.TelNo. END. OUTPUT CLOSE. Finally Mike already agreed with the Doctor twice in this thread. I fear that if it happens again, heaven will fall and we will all be walking around with blue caps! Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Top