I would disagree. I love to use comments to format my code and separate the sections. I think it’s so beautiful. Also I love when libraries have ASCII art in the comments at the top of the main file lol. It makes the code more fun in my opinion.
I went to college with a guy who would tear the code as art when presenting projects. His code was always beautiful. Not super functional but always beautiful. It always stuck with me. I want my code to always be functional and beautiful. Easy to read and a pleasure to work with. That’s my goal at least. Comments help with that.
Also it depends on what the code is for haha
BaardFigur@lemmy.world 11 months ago
Comment smart, don’t comment every line like this
int i = 5; // Assigns the value 5 into the varible i.
Maalus@lemmy.world 11 months ago
Comment only in extraordinary situations, when something you read can confuse someone. And by that I mean the business logic, not that you used a method that’s confusing to people since they only know the basics of the language.
Sylvartas@lemmy.world 11 months ago
Honestly, after a few years of working with juniors (and being one myself before that), I have to disagree with the last part. Sure, it’s fine for solo projects but people’s programming skills can vary heavily. I know people who will pull the wildest C++ compile time tricks you’ve ever seen but a pointer to a pointer broke their brain somehow.
stebo02@sopuli.xyz 11 months ago
I usually comment on whole groups of lines of code, so the goal of each part of the code is clear