this post was submitted on 03 Jul 2025
23 points (100.0% liked)
Programming
21417 readers
338 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 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's often better to split code in smaller functions tho, and give these good names.
I am probably a bit over the top with this tbh. I put everything in functions, even single-use activities like declaring initial variables at the beginning. I just do it to enable the code folding. Even though everything I do is small time and I'm sure it's not excessively burdensome on the system, it seems wasteful to me to have the computer hold a the function in memory when it's never going to get used again. So I was thinking this might be more efficient in such cases.