this post was submitted on 14 Nov 2023
51 points (93.2% liked)
Programming
17378 readers
213 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This sounds to me like you could benefit from mentally using the information hiding principle for your functions. In other words: Outside of the function, the only thing that matters is "what goes in?" and "what comes out?". The implementation details should not be important once you're working on code outside of that function.
To achieve this, maybe you could write a short comment right at the start of every function. One to two sentences detailing only the inputs/output of that function. e.g. "Accepts an image and a color and returns a mask that shows where that color is present." if you later forget what the function does, all you need to do is read that one sentence to remember. If it's too convoluted to write in one or two sentences, your function is likely trying to achieve too much at once and could (arguably "should") be split up.
Also on a different note: Don't sell your ability to "cludge something together" short. If you ever plan to do this professionally or educationally, you will sadly inevitably run into situations where you have no choice but to deliver a quick and dirty solution over a clean and well thought out one.
Edit: typos
I have the same problem as OP, and this is how exactly how I cope! If the details are irrelevant, than you don’t need to keep them in short term memory