Re: [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: improved client announcement mechanism

Andrew Lunn
2011-05-01T13:10:33Z

> > O.K. so there is a good reason. So maybe hint about these reasons in
> > the comment? Help the reader understand why it might happen.
>
> Ok I can add some comments more. But, should I reason as we do not have
> documentation at all? I mean, while deciding to put a comment or not..

If you want to reference to documentation, i think it should be in
kernel documentation. So i would make the documentation part of this
patch set. I.e. include a file Documentation/networking/batman-adv-tt.txt,
and reference it.

> > > Yes, memory problem. Actually it is not possible to make two passes:
> > > e.g. imagine that the set of changes is the following:
> > > - DEL A
> > > - ADD A
> > > - DEL A
> > > (ok it is probably not really common, but still possible)
> >
> > And since it will not happen to often, it is not worth the code so
> > find such situations and simply the transactions.
> >
>
> What do you exactly mean? Sorry but I didn't fully understand your
> sentence :(

You could parse the changes, DEL A, ADD A, DEL A, and optimize it down
to just DEL A. But i guess it is not worth the effort.

> I understood that I have to work harder to write comments :D

That is one approach. I often take another. Lots of very small
functions, with names which make it clear what they do. The function
names replace the comments.

This is no right/wrong, just different styles.

Andrew