From Newsgroup: comp.lang.c
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
--- Synchronet 3.22a-Linux NewsLink 1.2