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

That's why god invented comment blocks. But some people view them as code smell, which i find very strange. And no, good naming is not always enough.


So you're saying it's a good idea to write what your types are in your code, but rather than writing them in a form that can be automatically checked by a computer and used for code completion and refactoring, you prefer to write them in a comment?


No, I said no such thing. If you happen to be in a dynamic environment, then yes, I see no foul in describing inputs to a function inside a comment above function declaration. Use comments to describe your intents on non trivial parts of your code. There is no amount of code readability that will help your colleague, if she doesn't understand your thought process at the time of writing the code.


"not always enough" is still better than "none". This feels like a classic "good being the enemy of the perfect" issue.




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

Search: