Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All syllogisms have three parts, therefore this is not a syllogism.


devel / comp.lang.mumps / Re: Routine comment/documentation Standards?

SubjectAuthor
* Routine comment/documentation Standards?Christoffer Engman
`* Re: Routine comment/documentation Standards?ed de moel
 `* Re: Routine comment/documentation Standards?Christoffer Engman
  `* Re: Routine comment/documentation Standards?David Wicksell
   `* Re: Routine comment/documentation Standards?Christoffer Engman
    `- Re: Routine comment/documentation Standards?K.S. Bhaskar

1
Routine comment/documentation Standards?

<6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=543&group=comp.lang.mumps#543

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:2948:b0:765:8643:12f3 with SMTP id n8-20020a05620a294800b00765864312f3mr22770qkp.8.1689878366545;
Thu, 20 Jul 2023 11:39:26 -0700 (PDT)
X-Received: by 2002:a05:6808:1827:b0:3a3:d677:6c78 with SMTP id
bh39-20020a056808182700b003a3d6776c78mr1022248oib.2.1689878366296; Thu, 20
Jul 2023 11:39:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 11:39:25 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=31.209.43.228; posting-account=3vkttgoAAACLVZQ2ctfJZRR-9SSBmxFY
NNTP-Posting-Host: 31.209.43.228
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
Subject: Routine comment/documentation Standards?
From: snuffish90@gmail.com (Christoffer Engman)
Injection-Date: Thu, 20 Jul 2023 18:39:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1925
 by: Christoffer Engman - Thu, 20 Jul 2023 18:39 UTC

Hi! Im wondering if there`s any "best-practices" when it comes to comment/document your routines etc?

Im trying to figure out a standard for my-self (and our team) which is the best approach.

This is an example draft of a routine comment-block. I have tried to include some varieties of input-params since the Routine can do a-lot of different things depending on what the user is trying to solve.

FRAME(TITLE,WIDTH,CONTENT,DELIMETER,ORDER)
N (TITLE,WIDTH,CONTENT,DELIMETER,ORDER)
;
; Render a Window Frame
;
; @param TITLE {String} The title of the Frame (default: "")
; @param WIDTH {Integer} The width of the frame (default: 50)
; @param CONTENT {Array|String} The content of the frame
; @param DELIMETER {String} The delimeter if CONTENT is a {String} (default: "\n")
; @param ORDER {Char} The order of the frame [Upwards = "U", Downwards = "D"] (default: "U")
;

Re: Routine comment/documentation Standards?

<7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=544&group=comp.lang.mumps#544

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:28d6:b0:767:16e2:7c94 with SMTP id l22-20020a05620a28d600b0076716e27c94mr95965qkp.8.1689881214097;
Thu, 20 Jul 2023 12:26:54 -0700 (PDT)
X-Received: by 2002:a05:6808:2128:b0:3a4:1265:312d with SMTP id
r40-20020a056808212800b003a41265312dmr1009590oiw.5.1689881213892; Thu, 20 Jul
2023 12:26:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 12:26:53 -0700 (PDT)
In-Reply-To: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=71.174.62.16; posting-account=j7lJmQoAAADTx0Apfk15DZ7D0qlYy4zv
NNTP-Posting-Host: 71.174.62.16
References: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com>
Subject: Re: Routine comment/documentation Standards?
From: eddemoel@gmail.com (ed de moel)
Injection-Date: Thu, 20 Jul 2023 19:26:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1885
 by: ed de moel - Thu, 20 Jul 2023 19:26 UTC

When it comes to comments, I always am reminded of a snarky observation by one of my professors in college:
"If the code and the comments disagree, then both are probably wrong..."

That aside: I have seen too many comments that just replicate the code. That is a waste of bandwidth.
Comments should explain WHY you're doing the things the way you chose.
So: explaining the meaning of parameters, and their ranges of acceptable values is a GOOD thing.
But, such a comment that just says "A string between 5 and 20 characters" is a waste of effort.

In the above example: width of the frame; default 50... what's missing is "in which units?" What is "too small"? what is "too big?"
and so on... I'm sure you get the idea.

Just my $0.02,
Ed

Re: Routine comment/documentation Standards?

<1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=545&group=comp.lang.mumps#545

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:622a:1a0b:b0:404:284d:d6c5 with SMTP id f11-20020a05622a1a0b00b00404284dd6c5mr269qtb.11.1689886123476;
Thu, 20 Jul 2023 13:48:43 -0700 (PDT)
X-Received: by 2002:a05:6870:d89c:b0:1ba:7bf5:67cd with SMTP id
dv28-20020a056870d89c00b001ba7bf567cdmr1117481oab.11.1689886123123; Thu, 20
Jul 2023 13:48:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 13:48:42 -0700 (PDT)
In-Reply-To: <7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=31.209.43.228; posting-account=3vkttgoAAACLVZQ2ctfJZRR-9SSBmxFY
NNTP-Posting-Host: 31.209.43.228
References: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com> <7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>
Subject: Re: Routine comment/documentation Standards?
From: snuffish90@gmail.com (Christoffer Engman)
Injection-Date: Thu, 20 Jul 2023 20:48:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Christoffer Engman - Thu, 20 Jul 2023 20:48 UTC

On Thursday, 20 July 2023 at 21:26:55 UTC+2, ed de moel wrote:
> When it comes to comments, I always am reminded of a snarky observation by one of my professors in college:
> "If the code and the comments disagree, then both are probably wrong..."
>
> That aside: I have seen too many comments that just replicate the code. That is a waste of bandwidth.
> Comments should explain WHY you're doing the things the way you chose.
> So: explaining the meaning of parameters, and their ranges of acceptable values is a GOOD thing.
> But, such a comment that just says "A string between 5 and 20 characters" is a waste of effort.
>
> In the above example: width of the frame; default 50... what's missing is "in which units?" What is "too small"? what is "too big?"
>
> and so on... I'm sure you get the idea.
>
> Just my $0.02,
> Ed

Yeah, you got a point there. The M-Unit tests actually explains more about what the routine does than the actual routine itself.
The example I posted above is a pure example of which ways the routine could be used. At the moment I pretty much write an "documentation essay" of some routines that I KNOW I will forget how it even works after a year - since Mumps-code is really "cryptic" sometimes and really hard to understand what it does from the get-go.

But some M-Unit Tests is a good idea for "documentation-purposes" and also to maintain the functionality of the routines, so nothing breaks in the future.

I also strive to build more "Generic" Util routines that can be re-used in other places since it goes against my philosophy that a routine/function/whatever is only being used once and never again.

Re: Routine comment/documentation Standards?

<77cc3bc0-c280-4b2a-a9ff-6fa5d99cb14an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=546&group=comp.lang.mumps#546

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:6001:b0:763:ce7e:f280 with SMTP id dw1-20020a05620a600100b00763ce7ef280mr416qkb.11.1689895638725;
Thu, 20 Jul 2023 16:27:18 -0700 (PDT)
X-Received: by 2002:a05:6870:76aa:b0:1b0:2b6c:1e88 with SMTP id
dx42-20020a05687076aa00b001b02b6c1e88mr221362oab.10.1689895638277; Thu, 20
Jul 2023 16:27:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 16:27:17 -0700 (PDT)
In-Reply-To: <1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:8c1:8083:7060:31e4:b2dc:c712:d72f;
posting-account=PsiyswoAAAC8oeIre1Ec56jiRFgjerM6
NNTP-Posting-Host: 2601:8c1:8083:7060:31e4:b2dc:c712:d72f
References: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
<7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com> <1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <77cc3bc0-c280-4b2a-a9ff-6fa5d99cb14an@googlegroups.com>
Subject: Re: Routine comment/documentation Standards?
From: dlwicksell@gmail.com (David Wicksell)
Injection-Date: Thu, 20 Jul 2023 23:27:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1767
 by: David Wicksell - Thu, 20 Jul 2023 23:27 UTC

Hello Christoffer,

I used an approach similar to yours, inspired by JSDoc, in a routine I wrote, that might give you some ideas.
I'm sure there is plenty of room for improvement, but I'll post the link if you want to take a look and maybe it
will help. https://github.com/dlwicksell/nodem/blob/master/src/v4wNode.m

There is certainly no standard in the M community, and best practices will vary. Good luck!

David Wicksell
Fourth Watch Software LC

Re: Routine comment/documentation Standards?

<935ea95a-5e9f-4516-b640-7dd9452c3646n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=547&group=comp.lang.mumps#547

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:ac8:7dcb:0:b0:404:eea2:dce7 with SMTP id c11-20020ac87dcb000000b00404eea2dce7mr1902qte.9.1689899785692;
Thu, 20 Jul 2023 17:36:25 -0700 (PDT)
X-Received: by 2002:a05:6870:b7b1:b0:1b0:239b:8dfe with SMTP id
ed49-20020a056870b7b100b001b0239b8dfemr470291oab.10.1689899785159; Thu, 20
Jul 2023 17:36:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 17:36:24 -0700 (PDT)
In-Reply-To: <77cc3bc0-c280-4b2a-a9ff-6fa5d99cb14an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=31.209.43.228; posting-account=3vkttgoAAACLVZQ2ctfJZRR-9SSBmxFY
NNTP-Posting-Host: 31.209.43.228
References: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
<7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com> <1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>
<77cc3bc0-c280-4b2a-a9ff-6fa5d99cb14an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <935ea95a-5e9f-4516-b640-7dd9452c3646n@googlegroups.com>
Subject: Re: Routine comment/documentation Standards?
From: snuffish90@gmail.com (Christoffer Engman)
Injection-Date: Fri, 21 Jul 2023 00:36:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: Christoffer Engman - Fri, 21 Jul 2023 00:36 UTC

On Friday, 21 July 2023 at 01:27:19 UTC+2, David Wicksell wrote:
> Hello Christoffer,
>
> I used an approach similar to yours, inspired by JSDoc, in a routine I wrote, that might give you some ideas.
> I'm sure there is plenty of room for improvement, but I'll post the link if you want to take a look and maybe it
> will help. https://github.com/dlwicksell/nodem/blob/master/src/v4wNode.m
>
> There is certainly no standard in the M community, and best practices will vary. Good luck!
>
> David Wicksell
> Fourth Watch Software LC

Thanks! Now I have a little more to take inspiration from. Thanks again! :)

Re: Routine comment/documentation Standards?

<e48c6b0c-3f3d-4084-a7f8-ecf4f8360618n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=548&group=comp.lang.mumps#548

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:ae9:df87:0:b0:768:4206:c616 with SMTP id t129-20020ae9df87000000b007684206c616mr1044qkf.4.1689902577816;
Thu, 20 Jul 2023 18:22:57 -0700 (PDT)
X-Received: by 2002:a05:622a:610:b0:3ff:3725:1f24 with SMTP id
z16-20020a05622a061000b003ff37251f24mr1838qta.4.1689902577450; Thu, 20 Jul
2023 18:22:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 20 Jul 2023 18:22:57 -0700 (PDT)
In-Reply-To: <935ea95a-5e9f-4516-b640-7dd9452c3646n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.36.235.25; posting-account=zTPg1AoAAABx_LtAQ3dW6FBnU1dwmSvl
NNTP-Posting-Host: 108.36.235.25
References: <6c2a2df2-1012-4d6b-9ebf-74a6c49e10c2n@googlegroups.com>
<7b155826-a006-484e-8a3f-7333d469897bn@googlegroups.com> <1fb0ec40-ad52-4509-8bef-d7c922ef3b64n@googlegroups.com>
<77cc3bc0-c280-4b2a-a9ff-6fa5d99cb14an@googlegroups.com> <935ea95a-5e9f-4516-b640-7dd9452c3646n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e48c6b0c-3f3d-4084-a7f8-ecf4f8360618n@googlegroups.com>
Subject: Re: Routine comment/documentation Standards?
From: ksbhaskar@gmail.com (K.S. Bhaskar)
Injection-Date: Fri, 21 Jul 2023 01:22:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2516
 by: K.S. Bhaskar - Fri, 21 Jul 2023 01:22 UTC

On Thursday, July 20, 2023 at 8:36:26 PM UTC-4, Christoffer Engman wrote:
> On Friday, 21 July 2023 at 01:27:19 UTC+2, David Wicksell wrote:
> > Hello Christoffer,
> >
> > I used an approach similar to yours, inspired by JSDoc, in a routine I wrote, that might give you some ideas.
> > I'm sure there is plenty of room for improvement, but I'll post the link if you want to take a look and maybe it
> > will help. https://github.com/dlwicksell/nodem/blob/master/src/v4wNode.m
> >
> > There is certainly no standard in the M community, and best practices will vary. Good luck!
> >
> > David Wicksell
> > Fourth Watch Software LC
> Thanks! Now I have a little more to take inspiration from. Thanks again! :)

Software maintainers really need to read the code to understand it, not read the comments. That said, comments about what the programmer intended to achieve are beneficial. For what it's worth, https://gitlab.com/YottaDB/Util/YDBAIM/-/blob/master/_YDBAIM.m is some code that I wrote recently.

Regards
– Bhaskar

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor