-
Notifications
You must be signed in to change notification settings - Fork 1
Find/Define - Documentation standards for COBOL #1
Comments
What we generally do is, after the identification division to have a program overview on what the code does for 4-5 lines. After which we have some documentation of how the code processes data like how it starts, business logic on what is added, checked, changed and removed from the input files or verified against a table, calls to any subprograms. Basically, a step by step by view on what the code does. After which we outline what the input, output files are and what tables/DBs are used in the code. After this, we add a program maintenance log, where we specify each release, developer, and release notes. Additionally, if the code is really complex and long. We tend to add a couple of lines before each paragraph starts to understand what the subsequent para does. Hope this helps. |
@aswinvenkey Thanks for your feedback! I have some follow-up questions. Do you add specific comments to data storage and fields, describing what they are? Is there any standard for commenting on the source code (besides starting at col 7 with an asterisk)? For instance, in java, to be considered a Javadoc comment it has to start with If it is not that much, I would appreciate it if you could share a sample on how you usually do comments on a "real" COBOL source code. |
@brunopacheco1 Answering, the data storage field question usually we don't since the fields are self explanatory and according to principles of well structured cobol code they have to be meaningful as to what they contain. Regarding, different ways of adding documentation I would say no to that too! Cos, whatever documentation we do we just do it with an asterisk but sometimes we do add a full line of asterisks before and after the comments but that is just for formatting and readability. But there could be other shops/developers who might have different ways of adding documentation. Sure, I'll share one across to your email id tomorrow. |
In my experience we have the flowerbox. It looks like this:
Then the number in column 1-6 or 72-80 is used as change number |
@brunopacheco1 @jellypuno just conveyed what I was trying to say with so many lines.😂😂😂 |
@aswinvenkey @jellypuno Thanks again for your feedback. Are these flowerbox comments placed before or after the Would you also consider commenting variables and functions when it's needed? I mean, sometimes it is not possible to synthesize the meaning of a variable or a function in a short name. And the idea of documentation is rather to be as more explicit as possible to ease the reader's understanding, even sometimes with samples or possible exceptional flows. What do you do in this kind of situation? |
@brunopacheco1 we generally place these comments after the |
I just found this link where some standards are suggested and one is about having these flower boxes before each paragraph, with some description and paragraph calling chain. Do you do it similarly? |
@brunopacheco1 yes we do that flower box for each paragraph with the description but we don't do the para calling chain. But maybe that's just because we're too lazy 😂 🤣. But it does sound useful and can eliminate some analysis time. |
@aswinvenkey @jellypuno Would you say that this sample is reasonably documented? Perhaps would you do it in a different way? |
I think this is more than sufficient as for documentation, but generally, some programs tend to go a bit more complex. So, in this case, yes I understand that the paragraph flow description after the identification division also serves as a program overview but in more complex cases I believe having a couple to lines to just know what the program does. And also, when input files, tables, adabas files are involved we tend to add that as separate sections in this flowerbox. |
@aswinvenkey I got it, and it makes sense if you have flowerboxes over paragraphs, perhaps this initial list of paragraphs is useless and could be built automatically anyway. |
@aswinvenkey @jellypuno Could both of you share some code sample with comments/flowerboxes? I think I've got something to start working on, but it would be great if I have more code scenarios, preferably more complex cases and not coded by me. |
@brunopacheco1 sure! I'll check for cases like that. but it might take a while and I have to figure out how to give you the code without breaking some kind of NDA.😂 🤣 |
Backward compatibility is good and COBOL comments might be helpful for maintenance of the legacy code. Successors
@brunopacheco1 may I have contribution rights to your project? |
@OlegKunitsyn You are right, I was thinking to go to that direction, but I was just checking out with @aswinvenkey @jellypuno what they usually do, in order to find something in between, to be more appealing. So my idea was to combine this flowerbox standard with tags or annotations, to simplify the matching process. |
@OlegKunitsyn the tool is already going through the code looking for modules and functions and all possible coboldoc comments. I just followed this pattern, but perhaps that is not the usual approach, where did you get it from? I also thought it could be open, which means the CLI tool would have options to extend this step in the parsing process. |
A Javadoc fantasy. :) I'll change that to standard coboldoc specs, anytime. We don't need to invent the wheel, I think. Any existing specs and open-source implementation of the tools for typed language is a good starting point. I vote for https://en.wikipedia.org/wiki/Javadoc, having few basic tags at the beginning. |
@brunopacheco1 The COBOL Programming course has COBOL programs with reasonable comments. I think it looks good. |
Hey you. I believe I've got an MVP for the documentation generator. Please, fill free to have a look at it and comment out. |
1.0.4 fails
|
I have to spend more time investigating it, but this problem looks something related to the environment you are using. For some reason, it is not finding correctly the files. I pushed a new version with some changes but it looks like on Linux it is working correctly, but not on Windows. |
|
Seems the package was packed incorrectly. |
Hey, thanks for the support. I was missing a .npmignore file. When running npm publish, the process was checking out the .gitignore, which was ignoring the transpilation output folder. |
It works now. Thank you! |
What do you think about line-breaks (2 spaces at the end of line in Markdown)? |
Yes, I thought about that before, but then there may be a situation where those lines should be merged instead. If you put deliberately a |
True. And br is visible in the docblock in the COBOL file. We need an
invisible linebreak...
…On Mon, 17 Aug 2020, 22:52 Bruno Pacheco, ***@***.***> wrote:
Yes, I thought about that before, but then there may be a situation where
those lines should be merged instead. If you put deliberately a <br>? I
believe the tool is not escaping HTML.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAV4WDFZSWU3X3IBB35B7NDSBGJ7BANCNFSM4PMB3ZFQ>
.
|
Envyr ICOBOL uses
|
isCOBOL uses Javadoc. Attached example demonstrates a documentation via OOP statement, shared by Veryant. |
IBM Z Open Editor inserts this snippet:
|
Fujitsu NetCOBOL uses free-text comments: ExlService adopted NetCOBOL to the format based on |
@brunopacheco1 , @OlegKunitsyn - Question. When I build and install a "local" version of coboldoc, I get the following.. is there something else I need todo (or install)?
|
Have you seen https://rosettacode.org/wiki/Documentation#COBOL |
MicroFocus
|
RechInformatica rech-editor-cobol, https://github.com/RechInformatica/rech-editor-cobol/blob/master/src/cobol/rechdoc/CobolDocParser.ts
and then has javadoc style identifiers eg: @param, @return, @throws, @enum. |
Auto-doc |
Before really coding how generate documentation, it is quite important to check with COBOL developers how they document their code.
The text was updated successfully, but these errors were encountered: