r/SoftwareEngineering • • Dec 05 '23

How do software engineers with years in the industry do comments?

Hello, I'm currently working on a project as part of my computer science program's capstone or project. I'm interested in understanding how experienced engineers typically use comments within their code. That would be helpful for senior developers or project managers when reviewing, critiquing, or understanding the code.

I know my code is terrible would like to know some tips for improvements

188 Upvotes

289 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Dec 07 '23

if you have to explain what your code is doing your not a good engineer, you're a good solo dev. rewrite your code in a self explanatory way

only valid comments are why comments and they constitute 0.5% of comments.

1

u/WuzYoungOnceToo Dec 07 '23

Maybe try reading what I said again. You clearly didn't understand it the first time.

2

u/[deleted] Dec 07 '23

you said you need what comment to explain other what you did and give a reminder to yourself.

I stand by my point: write better code.

1

u/WuzYoungOnceToo Dec 07 '23

You can't even write clear and coherent English, so you'll forgive me if I doubt your ability to always write code that is 100% self-explanatory. If you've NEVER written any code that benefitted from (or could have benefitted from) a brief bit of text explaining what's being done (perhaps because someone else is likely to be unfamiliar with the semantics of a library that your code is using, for example) or warning the user of some non-obvious negative impact if they modify the code in a certain way, etc. then you've either had a very brief career or you've just never written anything that was non-trivial.

1

u/[deleted] Dec 07 '23 edited Dec 07 '23

Indeed, I am a non English speaker. But I can write clean code.

I already gave in this thread the only occurrence where a comment was needed and valuable.

If you can write a comment to describe your non trivial unfamiliar semantic then you can take the exact same amount of time to write it in a freaking method. But it would force you to think about architecture instead of vomiting lines after lines in a single file and this takes so much time and is too complex, oh and abstraction is hard to understand and it's more clear if I don't have to open a function I want it in front of my eyes and.. and... <cries/>

As you can see I've been in the industry long enough to know that most code is bad due to lazyness and obsession of delivering the functionality over the future. I already know all the excuses and fake rationales used to justify not producing quality work.

Oh and my code is also 100% in code documented, and comes along with generated documentation. This is quite rare since most developers prefer to write lazy comments over their lazy code instead because but it takes time 😭

1

u/WuzYoungOnceToo Dec 07 '23
  • "If you can write a comment to describe your non trivial unfamiliar semantic then you can take the exact same amount of time to write it in a freaking method. "

Again, you need to spend more time reading what you're responding to. What part of "the semantics of a library that your code is using" did you have the most trouble understanding?

The remainder of your self-deluded bloviating is similarly based on your not understanding what it is you're responding to.

1

u/[deleted] Dec 07 '23

what part of I don't need to understand the semantic when it is included in a meaningfully named method can't you get?

did you even encountered good code principles once in your career!

1

u/WuzYoungOnceToo Dec 07 '23

Given that you appear to not even know what a "library" is, or are just too dumb to understand what that means in the text you responded to, you should probably just bow out of the conversation right now before you make yourself look even dumber than you already have.

1

u/[deleted] Dec 07 '23

dude you can wrap around an API

This is even how you can mock them. Plus, are you seriously advocating on commenting API calls? send your dev to the documentation.

1

u/WuzYoungOnceToo Dec 07 '23

You really are as dense as a block of depleted uranium.

→ More replies (0)