4 ms·
All of the "comments are useless because they get out of date" folks should look at this code, which is still comprehensible 40 years later because of the comme
by notacoward 5y ago
All of the "comments are useless because they get out of date" folks should look at this code, which is still comprehensible 40 years later because of the comments.
- gpvos 5y agoWell, they get out of date because the code around it changes. If the code doesn't change either... I do agree with you though that commenting is a good thing.
- kwertyoowiyop 5y agoUpdating comments as needed is just something I consider part of being a professional programmer.
- JohnBooty 5y agoThis is why I've always been an advocate of inline code comments. With just the slightest amount of professionalism, you can keep them up to date, and only a real psychopath would update code without updating the comments directly above it. (So, of course, 50% of programmers don't...)
- TedDoesntTalk 5y agoI can’t count the number of PRs I’ve rejected because code was changed but the corresponding inline comments were not.
- kwertyoowiyop 5y agoThank you for being part of the professional 50%!
- ejb999 5y agoI couldn't agree more - and think it is asinine to tell developers to not comment code; most of the comments I write, are for me as much as for the next person who works on it. I find them invaluable. Recent contract at a big Fortune50 company, and they forbid developers from using comments - "any code that you think needs some explanation should be put in a separate readme file in a 'docs' directory off of the root" - how can that be better, or more useful, than a couple of lines of comments right above the code in question? They didn't want us to use comments, because they were afraid the code would change, and the comments would become out of date - so put those comments in a separate file, that almost nobody will remember to read, much less update, and that would solve the problem. You can't make this stuff up, utter insanity.
- davegauer 5y agoHeh, now imagine that knowledge is not in README files, but in a certain popular slow WYSIWYG SaaS document product.
- wvenable 5y ago75% of assembly programming is writing comments.
- pjmlp 5y agoAnd figuring out meaningful jump target labels. :)
- jaxrtech 5y agoAgreed, commenting assembly is bit different "environment" to explain the "why?". You're explaining why you're putting a value in a register vs why you're calling some particular API or whatever in a higher-level language. And then you have COBOL...