[email protected] wrote:
> > > > - line 419: why define a function just to set one variable, once?
> > >
> > > This is a Heaviside step function. It made sense to me to write this as
> > > a function.
> > >
> > > http://en.wikipedia.org/wiki/Heaviside_step_function
> >
> > Doesn't look like what you've defined, which has a plateau at some level
> > (not 1), and then drops back to 0 later. But if it's a variation, it might
> > be useful to put a comment saying why you've chosen to do it this way.
>
> It was initially 0 -> fixed value, but after some testing we decided to
> make that value decrease as the host got more use. I'm still not sure I
> understand this objection, though. There are functions within functions
> in many different places in our code. I thought it was easier to see
> that this was a function, and a term in the quality equation, when
> written the way that it is.
It's not really an objection, but if it were, it would be that it seems a
bit odd to define a function to use precisely once, rather than just doing
the variable manipulation in-line. If it makes sense to encapsulate it as
a function -- which it seems to me it does, if it is this common function
-- then that's fine, but either give it a name that's tells us what it is
("Oh, that's a heaviside step function, I know what that does (or can look
it up") or tells us in a comment. As it is "H_whatever" adds no
descriptive value. But if you do reference Heaviside, then please explain
why it's not exactly that -- including both the different step value and
why there are two steps instead of just the one.
Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss