Hacker News new | past | comments | ask | show | jobs | submit login

comments might diverge from behaviour but the code, almost by definition (modulo some crazy magic happening/broken interpreter ) _is_ the behaviour.



> code, almost by definition _is_ the behaviour.

Yes, but is it the intended and/or desired behaviour in all cases that the codepath in question will be expected to experience?

That is the problem, especially in code that deals with rare edge cases so is not run often, and/or covers many circumstances where it is right but is wrong for one set of inputs that no one thought to test before (or since that code last changes).


The best commenting system is a debugger stepping through the code. Unfortunately, I've yet to see a commenting style that is able to really document mental models about how the code works.


SEURAT is a research project that attempted this. I was a test subject for it a while back and found it pretty interesting. But its implementation at the time was an Eclipse plugin that probably hasn't been kept up todate. You can find a paper on it on the ACM digital library:

http://dl.acm.org/citation.cfm?id=1368215

I'm sure the dissertation is available somewhere on cs.wpi.edu, too.




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

Search: