I just finished watching David Byers' (<@U0EAA1CTV...
# cfml-general
b
I just finished watching David Byers' (@pegarm) presentation on improving legacy code and am feeling just a tad cough overwhelmed because the code base I have to work on is all of those things he mentioned except for a dev/test/prod environment. So where does one start? I've been documenting things as I go along, but what's the low hanging fruit? Incorporating a code repository? A framework? Something else? I'm a dev team of one for now if that's a factor at all. Or doesn't it matter? Just pick one and go forth? And yes, I'm also a legacy developer. I learned CF the first time in 2000.
f
Having a code repo / version control should be the first step IMHO - this makes it much easier to refactor, or delete unused/unnecessary code without worrying about backups, etc
Once that is setup you can delete all those index2.cfm and index_old.cfm files 😁
d
^^^ This, absolutely. Without source control, you don't know what changed or when or why or who did it to ask them about it, which makes tracking down new weirdness much harder. Source control also makes it feasible to have separate dev, test, and production environments with appropriate code in each of them.
b
One of the previous developers had a system where they would replicate the entire code base for a given app in a "deploy" folder along with the date. So each time I try to search the code for something I get multiple hits from all of those deploy folders. Enough to drive you crazy. And no, I'm not emotionally ready to delete them all yet. lol
f
The corollary to that approach with version control in place is to tag a commit, you can tag
deploy_2022_07_27
and be able to pull back that exact version of the code.
It can be overwhelming to setup version control though… especially if you start reading about gitflow, etc - if you are a one developer you don’t need a complicated workflow, just start by committing to main
p
100% Agree with Pete. Source control is paramount to cleaning up old code bases. Pare that legacy codebase down to something more manageable once the repo is set up and kill any cruft in the code base.
<kidding>
Actually. Screw it.
</kidding>