6 ms·
Automating Dead Code Cleanup
- faizshah 3y agoAny 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.
- _f9cu 3y agoHere you go https://github.com/facebookarchive/codemod https://github.com/facebookarchive/codemod
- omoikane 3y agoRelated: https://news.ycombinator.com/item?id=35755841 https://news.ycombinator.com/item?id=35755841 - Sensenmann: Code Deletion at Scale
- readthenotes1 3y ago100m 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.
- lvturner 3y agoI once worked for a company who referred to the task as "Savage Optimization" -- really like that phrase. Edit: Savage in this context can be read as "Very Extreme"
- yoazmenda 3y agoIn 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
- _f9cu 3y agoI'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.
- philbo 3y agoMy 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 https://www.youtube.com/watch?v=29UXzfQWOhQ
- Tade0 3y agoSo if I understand this correctly a method suspected to be dead is flagged with a "tombstone" with a date that appears in the logs and removed past a certain age?
- Uptrenda 3y agoLove 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%.
- DonHopkins 3y agoThe silly things that you choose to let trigger you reflect your intolerance and bigotry. One of the many benefits of representing people of different races is that it infuriates and tricks hateful irrational racists like you into revealing themselves for who they really are. Thanks for letting us know! Now we'll be sure to downvote, report, and ignore all your other worthless comments and opinions in the future. I'm sure your persecution complex and victimhood fetish will enjoy the consequences of your own words and actions.
- Uptrenda 3y agoNo, I stand by what I said and it isn't racist. Though I can see why you think it is. I don't have a problem with black people in tech. But trying to paint a false image to make something seem different to reality? Yeah, that's fucked up. If we based our idea of the world on corporate branding and libtard double-speak it often shoots us in the foot. For example, these images suggest a perfect harmony of black and white representation in tech. Given that this is the case: why do we need to focus on hiring more under-represented minorities? If the world is already perfect (and yeah - tech people love this) why do anything? It feels just as good to say it is and do nothing.
- wenebego 3y agoIf they didnt include a black person, wouldnt that also be false image because not all people in tech are white? Im sure you would be just aa upset in that case, right?
- DonHopkins 3y agoI bet he thinks it's impossible for Floyd-Steinberg error diffusion dithering to represent a picture that is not completely black or white. Floyd–Steinberg dithering: https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dither... Ditherpunk — The article I wish I had about monochrome image dithering: https://surma.dev/things/ditherpunk/ https://surma.dev/things/ditherpunk/
- DonHopkins 3y agoNow we just need AI that deletes dead comments.
- tessierashpool 3y agoaka comments
- DonHopkins 3y agoI could also use some help killing code that's almost dead, but keeps coming back to life!
- JonChesterfield 3y agoThis 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.
- dep_b 3y agoInteresting 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.