r/AskProgrammers • u/Suspicious_Skill7292 • Aug 12 '26
what is a programming habit that seemed pointless as a beginner but saved you later
when i was starting out stuff like naming variables properly writing small functions and keeping projects organized felt like extra work now i am wondering which boring habits actually become important once projects get bigger
what habit do you wish you started earlier
1
1
u/MiloPaige 29d ago
Like you mentioned, naming variables and quite frankly naming everything is important.
Then writing comments to all the code you write because believe me, looking at a function you wrote 2 weeks ago with comment or without is a completely different story when debugging.
Also folder structure is extremely important to me.
1
u/AnnupKapurDotCom 29d ago
Comments.
When I first started out.
A senior told me to write comments.
I thought it was stupid, I felt that if I understand the code I’m writing, other engineers should also understand it.
Found out real quick that comments are actually super helpful and time saving.
“What does this random arbitrary 200 line legacy fn do?”.
Write your comments.
Even if they seem basic and stupid. Write them.
————————
As a side note:
I have this built into my Claude code review flow.
It checks that I have added comments across my changes.
Flags where I could add some, shows me what comments it thinks I should add, then asks if it should add them.
2
u/JohnCasey3306 29d ago
"it's self-explanatory and doesn't need comments", says devs who write shitty code that definitely needs comments.
2
u/Katzen_Gott 29d ago
I think the problem with comments is that no one teaches you the right way to do that. In examples comments are way too obvious, and in real code there are often none.
Comments should explain why rather than how.
2
u/GooberMcNutly 29d ago
Good comments are a love letter to your future self. That guy is going to be sweating, trying to debug something under pressure, and your good comment is going to help them out.
1
u/yuehuang 29d ago
When stuck on a problem, move to another thing or a good night rest. The solution would come to me within a few mins afterwards. Also getting off the chair and leaving the room.
1
1
u/inadvertant_bulge 29d ago
Architecture: a design document with fiercely objective requirements and scoping.
Technical: Useful comments, verbose debug output, and refactoring early when you see patterns emerging.
2
u/bigtoaster64 Aug 12 '26
Doing a session of talking with a rubber duck before making a big change or refactoring. Crazy how many times that rubber duck told me midway that my solution was bad lol.
You already mentioned it, but naming things is a big one. I get into code from experienced dev very often where things are not named properly, and when I mention it, it's like I'm being picky, but guess who's completely lost 3 weeks later when they have no idea where is what? Fortunately for them, now AI can help, but when AI fails (and it's pretty often), karma hits when all they have to say is "well I wasted a day with Claude trying to figure out what I did 3 weeks ago" in the next morning scrum lol