G
9

Rewriting my old PHP scripts after 3 years feels like reading a stranger's diary

Last week I cracked open a project I built in 2022 for a local bakery's order form. I had this habit of naming variables like $x2 and $tempVal, and the whole thing ran on one giant if-else block. Three years ago I thought that was slick, now I can barely trace the logic without a notepad. I spent a whole Saturday just adding comments and splitting it into functions. Funny how learning about basic error handling and version control changes your view of your own old work. Has anyone else gone back to an old project and felt embarrassed, or is that just part of the beginner loop?
1 comments

Log in to join the discussion

Log In
1 Comment
the_lisa
the_lisa18d ago
Man, that $x2 and $tempVal hit me right in the gut. I did the same thing with a little CRM tool back in 2021, and I remember being proud of a 400-line foreach loop that did everything except make coffee. Did you at least leave yourself any notes in the original code, or was it just straight vibes and hope? Because I found one comment that said "fix later" and later is now three years and a whole career change ago. That giant if-else block, did it at least have a clear default case, or did it just silently break when the input was wrong?
4