🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #231

Re: thought on documentation

#231
From: MitchAlsup
Date: Sun, 11 Oct 2026 19:56
64 lines
3168 bytes
fir <profesor.fir@gmail.com> posted:

> see for example
> 
> 
> Paul pisze:> When you write a function like that, you should have
>  > a comment at the top of the function, defining the
>  > valid domain and range for it. It's OK for a function
>  > to be "approximate", as long as the details of
>  > "how bad is my function", are noted.
> 
> i wrote recently some winapi code and my own framework and basic 
> thoought is - as to documentation -
> 
> 
> that function should have dentoted its runtime cost - preferably in
> nanoseconds/microseconds/miliseconds in typical machine
> 
> that would help a lot and people care for documentaton but dont care for
> that and in case more complex api i used (mainly winapi or old opengl)
> it would have a LOT of sense..it even should have sense in case of clib
> 
> writing my own framework i also see this becouse some functions are
> terribly cheap
> 
> like say
> 
> void SetCameraSize(float x,float y, float z, float d)
> {
> 	camera_size_x=x;
> 	camera_size_y=y;
> 	camera_size_z=z;
> 	camera_back_depth = d;
>      camera_clip_distance = camera_size_z;
> 
> }
> 
> 
> chepest of the cheap, and some may do really weird things like some
> functions in winapi like CraateWindow literaly fire a few events that go
> thru your wnd proc (!) and if you dot know it may cause you a trouble
> 
> in turn i think many of winapi or opengl are cheapest of the cheap also 
> so its really good to know it


Go find a copy of Linpak or Livermore Loops in C or FORTRAN and read the
source code. This will give you a MINIMUM standard as to what source code
documentation needs are. Remember, you may be talking to people 100 years
in the future where terms and verbology are different than today.

Then, if you create a document for readers to use to understand the library
en-the-large, see J. M. Muler; Elementary functions; where the underlying
algorithms are discussed in complete detail. So, for example a sin(x)
function may take 25 lines of C (or FORTRAN) but it contains 100 lines of
comments, and the accompanying document takes 25 pages to full describe
that single function.

-----------------

Then learn to use the same type case that people skilled in the art use.
You can get by with all lower case in programming, you cannot in documen-
tation.
Technical Details
Message-ID: <1791748576-5857@newsgrouper.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
References: <119it31$6io2$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
From: MitchAlsup <user5857@newsgrouper.org.invalid>
Newsgroups: comp.lang.c
Subject: Re: thought on documentation
References: <119it31$6io2$1@dont-email.me>
Date: Sun, 11 Oct 2026 19:56:16 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <1791748576-5857@newsgrouper.org>
Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857
Injection-Date: Sun, 11 Oct 2026 19:56:16 GMT
User-Agent: Newsgrouper/0.9.0