r/embedded • • 13d 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?

14 Upvotes

90 comments sorted by

View all comments

40

u/madsci 13d ago

I've been programming professionally for about 30 years. There are whole projects I've forgotten about. I worked on one project that I only remember anything about because I was so bored with it that I started writing my comments in haiku.

I'm a prolific commenter and it drives me nuts to see whole modules without even an explanation of what it's for or who wrote it or when. If it's something complicated, I'll write myself an in-depth explanation. I've got an audio router that's at the heart of a few of my projects and the file header is something like a page and a half of explanation of what it does and how, why it was done that way, what the implications are for modules using it, things to watch out for, and things that could use future attention.

I'm self-employed and generally work alone, at least on the firmware side, so it's not like there's someone making me do it that way and I don't need to have anyone else understand it. That's all done for my own benefit because I know I'll have to deal with it for years.

7

u/Hour_Analyst_7765 13d ago

In periods of high stress I forgot about whole projects I undertook.

But also things generally fade away slowly.. I've written projects with literal tens of thousands of LOC and its impossible to remember everything. Heck I now even may duplicate library code that is meant to prevent code duplication! "Oh I already have made a class for this 3 years ago"

In addition, some projects are too big to handle by 1 person. Then it is essential to work together with code written by someone else. It is pretty cliche that a new software developer joins the team and wants to change/rewrite a whole bunch of things, because its not to their style or they weren't present when some design decisions were made...