Automating Dead Code Cleanup

  • Related: https://news.ycombinator.com/item?id=35755841 - Sensenmann: Code Deletion at Scale

  • My favourite technique for tackling dead code is something I saw in a lightning talk at Velocity Conf years ago. I've introduced it at three different companies now, it's worked well in all three places and I'm always surprised it isn't more widely known/discussed (afaik).

    This was the talk: https://www.youtube.com/watch?v=29UXzfQWOhQ

  • This is a really interesting application of tooling. Especially since it's cross language, though it sounds like they've punted on strings passed to eval.

    I'm curious what stops tests being considered dead and eligible for deletion. If you just excluded the directory called 'test' or similar you'd miss code that is dead other than uses from test code, which is probably a fair approximation to all "dead" code.

  • In other words, they built a code-aware system that both statically and dynamically which can format all the code at scale, delete code, etc...

    If there is ever an AI sophisticated enough to write a new feature, I believe this is the way it will "look" at the code and re-write it

  • Any details on CodeModService? I’m curious cause I was just reading about Rosie from google.

    There’s not really much public info on large scale code mod tools.

  • Interesting stuff. I'm always struggling to find dead code in Xcode projects as there's very little refactoring tooling compared to bigger IDE's like the classic Visual Studio on Windows or JetBrains products. I miss seeing dead code as greyed out. Them mentioning Objective-C gives me some hope.

  • I'm trying to solve automatic code refactoring for frontend.

    Theory - Frontend is a giant tree of combination of component's variant of show or hide.

    With that fact, I' was attempting to create a code base scanner to automatically convert the code into such configurations.

    This article gave me lot of hopes.

  • 100m lines removed!

    That's a lot of "developer productivity"...

    This makes me kind of sad, removing dead code was one of the joys of the job.

  • Now we just need AI that deletes dead comments.

  • Love the pic of the black and white dev. Got to have that diversity, baby! Doesn't matter that only 8% of tech employees are black. No, in corpo-magic-fucking-pixie-bullshit-land they make up 50%.