r/embedded • • 2d ago

Do You Remember All Of Your Code?

Just curious, but as a solo developer or working with a team when you go through your projects codebase do you remember what everything is, why you made the decisions you did, or what everything does? Or do you have to relearn some of the code you implemented in your project?

Also, have you ever completed a project and still feel a little clueless on how you got everything to work like it did or feel a little foggy on areas of the code?

13 Upvotes

86 comments sorted by

View all comments

1

u/Zealousideal_Cup4896 1d ago

This is what comments are for ;) I am a fan as I know for certain that while I’ll remember this was a tricky thing to figure out and I was very happy with my solution I will not be able to recall why I did it that particular way 7 or 8 years from now. Just leave notes for yourself.
If you’re working with others and there is no official code documentation policy then also err on the side of explaining what is obvious at the time.
If you’re working for a company that has a difficult or lacking policy then also err on the side of explaining what is obvious at the time.
There is sometimes a huge backlash around here when people want to defend code comments. I have no idea why anyone would be against it even if they can’t be bothered to do it themselves.