Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2016 - Deletion Driven Development: Code to delete code! by Chris Arcand Good news! Ruby is a successful and mature programming language with a wealth of libraries and legacy applications that have been contributed to for many years. The bad news: Those projects might contain a large amount of useless, unused code which adds needless complexity and confuses new developers. In this talk I'll explain how to build a static analysis tool to help you find unused code and remove it - because there's no code that's easier to maintain than no code at all!
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk "Deletion Driven Development" at RubyConf 2016, Chris Arcand discusses the importance of removing unused code to simplify and enhance the maintainability of Ruby applications. The primary theme revolves around the development of a static analysis tool intended to identify dead or uncalled methods within codebases, illustrating that the most maintainable code is the code that doesn’t exist. Key points of the discussion include: - **Understanding Legacy Code**: As Ruby has matured, many applications have accumulated unnecessary code which complicates maintenance and confuses new developers. Arcand emphasizes the need to tackle this cruft. - **Reasons for Unused Code**: Unused methods often arise from over-engineering, poor coding practices, or simply from being refactored out over time. This creates a burden in understanding and maintaining the code. - **The Dangers of Unused Code**: Arcand highlights that unnecessary methods introduce complexity, increase maintenance effort, and create uncertainty in code comprehension, which can slow down development. - **Static Code Analysis Approach**: The talk details how to build a static analyzer that can identify potentially uncalled methods by parsing Ruby code into a data structure that can be reasoned about, using concepts like context-free grammar and parsing trees. - **Implementation Example**: Arcand walks through an example of employing Ruby Parser to transform Ruby code into a nested list (S-expression), which is then processed to track method definitions and their locations. - **Developing the Dead Method Finder**: After tracking method calls, the dead method finder computes which methods were never called and thus can be classified as potential candidates for deletion. - **Encountering Edge Cases**: While demonstrating the dead method finder, Arcand notes several edge cases involving attribute accessors and Ruby DSL methods, pointing out the complexity of accurately identifying unused code. - **Tools and Resources**: Arcand introduces a Ruby gem called "DeBride," which extends the capabilities of the static analysis tool discussed and facilitates the detection of dead code further, highlighting its utility in maintaining clean codebases. The main takeaway from Arcand’s presentation is the encouragement to minimize complexity in applications by removing unnecessary code. It aligns with the motto that "No code is faster, has fewer bugs, is easier to understand, and is more maintainable than no code at all," suggesting that developers should actively seek opportunities to delete unnecessary code for better maintainability and clarity in their projects.
Suggest modifications
Cancel