Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Code doesn't exist in a vacuum, it exists in the context of our general knowledge.

I would argue that the only comment really useful here would be one pointing to the paper/wikipedia article/whatever that explains the algorithm.

If no such article/reference exists and/or your implementation has nuances you want to explain, that's where technical documentation should come in. For instance, check the linux kernel's explanation of circular buffers and how to use them [1].

[1] https://github.com/torvalds/linux/blob/master/Documentation/...

> What does it mean to "relax an edge"? Why do we need to do it V-1 times? Does order matter?

These are questions related to understanding the algorithm, not the implementation. There are much better ways to convey that information (including examples, diagrams, lengthy explanations, etc.). Trying to convey that information through comments in an implementation is an exercise in __not__ using the best tool for the job ;)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: