pühapäev, 5. mai 2013 23:06.05 UTC+3 kirjutas Reinier Zwitserloot: > > Ah, but tests are testable (the code tests the tests and the tests test > the code; if your tests have a bug in it, they will fail, you will figure > out it's not your code, and thus, your test). Put differently, if your test > becomes 'out of date', you will notice. If a comment becomes 'out of date', > it'll remain there and just confuse the heck out of any future readers. > > Ah, but tests only answer to the questions "What" and "How". Comments should provide the answer to "Why". This is specially important for domain model classes, but also to some really complex business rule implementations, where mere code and tests are not really enough...
> You're basically advocating comments that are like '// add 1 to a'. Which > I think we can all agree is not, in fact, a good idea. > > BS! This is a deliberate hyperbole. Nobody claims that you need to comment the obvious stuff... It is just the definition of "not obvious" that is unclear -- 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 javaposse+unsubscr...@googlegroups.com. To post to this group, send email to javaposse@googlegroups.com. Visit this group at http://groups.google.com/group/javaposse?hl=en. For more options, visit https://groups.google.com/groups/opt_out.