On Sunday, April 14, 2013 2:44:58 PM UTC-4, Reinier Zwitserloot wrote: > > > Of course, let's be reasonable here: While in theory any and all comments > are code smells, they are pretty much always the lesser evil. Anything > beyond the most academic of projects is going to have some chunk of code > which does something in a somewhat weird way for a good but not immediately > obvious reason, and the right choice is definitely to add a comment to > explain what's happening. > > There are, however, algorithms that are so tuned for speed and so unlikely to be understandable by the reader that they need nontrivial comments.
Duff's_device <http://en.wikipedia.org/wiki/Duff's_device> and the Quake 3 inverse square root <http://en.wikipedia.org/wiki/Fast_inverse_square_root> algorithms are the poster chldren for necessary comments. Eric -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/javaposse?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
