@ocornut the idea that writing comments is futile because they can get out of date is just as stupid as saying “the code is the documentation”. It’s simply not true, and people who hide behind this are just trying to make excuses for their bad practices. Making code understandable to the next dev or simply yourself in 6 months is a basic part of a programmers job, and you’re not doing it properly if you skip it
Conversation
Notices
-
Embed this notice
The Seven Voyages Of Steve (sinbad@mastodon.gamedev.place)'s status on Friday, 22-Nov-2024 05:25:24 JST The Seven Voyages Of Steve -
Embed this notice
Omar (ocornut@mastodon.gamedev.place)'s status on Friday, 22-Nov-2024 05:25:25 JST Omar I believe comments are important and it's a no-no to accept that programmers won't maintain them (maybe naive of me but progs should be taught to treat them seriously if they aren't already?).
On an old game I started using _standardized_ FIXME comments to ensure they can be grepped. I still use that technique nowadays.
It's important IMHO to standardize them by e.g. subsystem rather than let everyone add their own flavor of "//!!HACK!!.
-
Embed this notice
Omar (ocornut@mastodon.gamedev.place)'s status on Friday, 22-Nov-2024 05:25:26 JST Omar When solving a non-obvious problem or using a quick hack to move forward, I almost always leave comment to explain e.g. the reason, or the potential better solution. I'm always puzzled when I see experienced coders working in large code bases who are not doing the same thing.
-
Embed this notice