Should You Write Comments in Your Code?

preview_player
Показать описание
Should you write code comments or have your code explain itself?

📣 Follow Coding in Flow on social media:
Рекомендации по теме
Комментарии
Автор

I only write comments in rare cases where it’s doing something particularly business logic specific. Descriptive function names help me. Even if they get a bit long.

prateeksaraswat
Автор

I never watch any of your videos, the only ones that I've watched is the series on how to make a 2D game. Thank you so much for getting me into unity. I now fully know how to code, and I'm making a PS1 style game.

Haffey.z
Автор

I think comments should be updated along with code

alastairtheduke
Автор

Great points. 99% of the time comments can be replaced by intelligently named variables and functions. If that doesn't work, then you are likely doing something stupid and need to rethink it... If it isn't obvious WHY you are doing something, then that is a possible situation for a comment.

ubersticks