4 ms·
I'm sorry, but a code comment does not demonstrate lack of expertise, although such a perspective certainly brings your own expertise into question. Perhaps we
by soulofmischief 2y ago
I'm sorry, but a code comment does not demonstrate lack of expertise, although such a perspective certainly brings your own expertise into question. Perhaps we should all assume a little less?
- ttyprintk 2y agoI think it does, objectively. In a pull request, I’d comment: “You imported pandas with an abbreviation. You economize the variable name `df` instead of dataframe. Those anticipate a reader who already knows when to chose the read_csv method.”
- soulofmischief 2y agoIf you are in charge of reviewing someone's pull request and ensuring they adhere to specified company guidelines, you can do whatever your organization wants. Outside of that though, you lack the authority to tell programmers how many comments are too much. I too know how to write self-documenting code, but that doesn't mean your code should have no comments or shouldn't be liberally commented.
- ttyprintk 2y agoGP mentions that this is a textbook unnecessary comment and I would beware any textbook and professed expert that disagrees. Whether a LLM coding model demonstrates understanding of unnecessary comments might be interesting, as would any differentiation in quality if my prompt asked for more or fewer lines of comments.
- soulofmischief 2y agoAnd I would beware any professed expert who has such a oversimplified heuristic of what makes a good engineer. > Whether a LLM coding model demonstrates understanding of unnecessary comments might be interesting I think it would be an interesting experiment, that sounds like a great idea for you to pursue. Make sure to sample a wide variety of models, and include a caveat that LLMs are not a source of truth regarding such matters, as they are simply providing probabilistic text completions based on prior training data.
- UncleMeat 2y agoYes it clearly does. A comment that is 100% noise and adds no value whatsoever to the codebase demonstrates a lack of expertise. I would expect undergrads and very junior engineers to write comments like this and then very quickly stop when told why these sorts of comments are a straightforwardly bad thing. Comments are good. I am a huge proponent of more comments over fewer comments. I have written functions where 80% of the lines are comments. But this is a bad comment for very simple to understand reasons.
- paulyy_y 2y agoYou'd get the spirit roasted out of you at any FAANG (at least, back when people gave a shit) if you ever sent out a change review with such a dumbass comment.
- soulofmischief 2y agoI have no problem adapting to style guidelines of specific codebases I contribute to. It would, however, behoove you to have similar respect for other coding styles which have zero impact on the quality of code itself and serves a particular purpose for a particular kind of person who might not particularly care what someone at a FAANG (lol appeal to authority) thinks about their code style.