Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hasu23186yI am guilty of similar things although not as bad as you describe. It feels so hard to remove functions, even though I know that they are on Github and I can restore them if needed be...
-
nnee4676y@prvInSpace @hasu why?
All that comes to mind is because of insecurity. In case new code would be worse or wouldn't work and you forgot how to use git at the same time. -
Kaji20976yIt’s not *necessarily* a bad practice. I do this when I want to try a diferent method of achieving an end, but want to refer to the existing work I’ve done (though usually instead of commenting out I’ll just duplicate the element as function_old() or file_old.php).
Now, if it remains in once the tests are done and rolling out to Production, *then* we have a problem... -
hasu23186y@nnee partially insecurity yes. I tend to keep old functions for reference of approaches I tried, or as a reminder on how to use things. I remove them once I'm really sure I don't need them anymore. Sometimes i like to keep them to compare different approaches.
And no, i cannot just google them. Research code. So not many examples given.
I ended up having a file with all of the ones i think of usefull for experimenting and testing. -
rant1ng44626yI used to do this but the more I leaned design patterns and refactoring techniques the more confident I became with with new functions I was writing replacing old ones.
Basically if you code modular enough, all your methods are so small it makes this kind of thing pointless.
Related Rants
-
Angry21The first time I realized I wasn't as good as I thought I was when I met the smartest dev I've ever known (to ...
-
Flink9122Professor: "Who here regularly backs up all their data?" *Some people raise their hands* Professor: "Who has a...
-
sagemaker33I was looking for about a month for a laptop. Then on this one magical day I open kijiji and see a Toshiba Thi...
I have a friend which have a hoarding disorder when it comes to coding. Here are some of the things he does:
1: If he rewrites, remove, or in any other way refactor a function, then he keeps the old one in the file commented out.
2: If he deletes a class then he takes the code and paste it into a class that he have just for old code. AN ACTUAL CLASS! Not just some random text file somewhere. Even though it is commented out, he leaves it so that you can initiate his garbage.
3: In point 1, the code is not pasted on the end. It inside all the other actual code.
So if you try to help him with something, then you have to dig through a mountain of shit just to find some code.
rant
old code
story
terrible reformatting