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

What are you guys think about these 'comments are more important than code' languages/dialects. I'm kind of sceptical because comments can lie but code cannot.


It depends on how much you must work with other people on the code.

Sometimes it's helpful to think about your code as if you are writing it for other people -- which you are, even if that person is you in the future. The choices you make can result in the difference between a love letter and hate mail, even if it does the same thing in the end.

I kind of like the idea of emphasizing the comments in this way, turning the source file into a document, but I have never personally used anything like it. So it feels both kind of interesting/attractive, but also weird.


Interesting. Considering that, I think that it is a fundamental problem of current programming languages that you cannot address both the computer and the human in the language itself. (comments are an escape mechanism)


and my comments are sometimes about what was tried but didn't work, or alternate ideas that were considered, along with commented out code and examples.


Yeah, comment-centric languages are not my preference, as over-commented code tends to happen way more often.


I find I have to comment quite a bit with JS because so much can be left up to interpretation, even in the code. It's the only time I wish there was some manner of type safety in JS, even if only in expression -- it sucks when an out-of-date comment gives the wrong type of an incoming param, and it's not until you actually step through that you see that.


You might like Microsoft's TypeScript then. It's a JavaScript superset adding ES6-style classes and modules, and optional static typing.


Comments blend in with the code too much for me.




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

Search: