Next up is "dead code" at #pyconus
I use vulture and some decorators to mark what is public, what do you all use?
(and I'm noodling with the idea of putting an `__all__` into every `__init__.py` to track what is public. I know vulture can use an "ignore" file, but I'd rather more explicit entrypoint markers. Stuff other than vulture needs to know what is unused because it is an entry point.
♡ 1 ↻ 0Dead code's costs
- perf costs (at built time?)
- maintenance
Why
- API changes
- deprecations
- temp debuging
- redundancy
- legacy (old crap)♡ 0 ↻ 0More impacts
- attack surface
- readability problemsme: seems like some of these dead code categories are "code that should be dead"
♡ 0 ↻ 0Unused imports can increase execution time.
me: pylint/ruff protect me from this. Still no protection against libraries with lots of startup costs on `import`♡ 1 ↻ 0`deadcode` is new to me:
♡ 0 ↻ 0Facebook uses a tool called SCARF to delete dead code, tables & data automatically. Sounds risky. Maybe if it is was in a monorepo & you could assume that all the refs to the thing are in the same repo.
https://engineering.fb.com/2023/10/24/data-infrastructure/automating-dead-code-cleanup/
♡ 2 ↻ 0