Thread View: comp.lang.c
1 messages
1 total messages
Started by MitchAlsup
Sun, 11 Oct 2026 19:56
Re: thought on documentation
Author: MitchAlsup
Date: Sun, 11 Oct 2026 19:56
Date: Sun, 11 Oct 2026 19:56
64 lines
3168 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads