Over the past few months we’ve been really focused on growing the PubGears business (and team).
For my part of that, I’ve been building out new features, products, and systems while also cleaning up a lot of dead, bloated, or soon-to-be deprecated code.
Since the early days, from tech. view, we’ve mostly been an ad-hoc kind of company with very limited specifications or project plans…and our code *very* much reflected that.
The challenge, from a tech. perspective, has been to build out and introduce new systems and processes without breaking or slowing down the production stuff (or at least as little as possible)…though we are getting through it all better than expected (by me), the transition stage has been ‘bumpy’ to say the least.
Anyway - one of the things I’ve been really focused on throughout this work is in cleaning up all the code. This means refactoring a lot of existing code, removing un-used and un-needed code, and of course implementing a more strict style/rule guide to work from going forward.
But to accomplish this means combing through hundreds of files and thousands of lines of code…and so I’ve been tackling bits and sections at a time as I can…and I think we’ve made great progress with this approach…but it felt like there were probably still a whole bunch of things now hanging around in the code that really aren’t used any more. But how can I be sure?
My solution was to write a quick hack that can parse through all the code in my project…build up at list of methods that are defined…and then report back to me about which files are calling which methods and even more importantly, which methods do not appear to be called by anything within my code.
For a quick hack, it seems to be working *really* well for my initial needs…and so I have decided to put it out on GitHub as it’s own project ( you can check it out at https://github.com/Falicon/ScrubReport ).
For the initial release, it really just focuses on my one little use-case/need…but there’s a good chance I’m going to expand upon this for some of the other code clean-up things I like to do with various projects (I’m a bit anal about code formatting and organization, because it helps me work/debug MUCH faster).
So - if you’re a dev (especially a Python one) and have a few free seconds, I would love to have you check it out, dump some thoughts, or even better - contribute some ideas/suggestions!
This post has received 50 loves.
Kevin has a day job as CTO of Veritonic and is spending nights & weekends hacking on Share Game Tape. You can also check out some of his open source code on GitHub or connect with him on Twitter @falicon or via email at kevin at falicon.com.
If you have comments, thoughts, or want to respond to something you see here I would encourage you to respond via a post on your own blog (and then let me know about the link via one of the routes mentioned above).