Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Our favorite language allows us to implement the same code in a few different ways. Because of that, it becomes tough to search and find the target code only with regular expressions. I'd like to present fast, a searching DSL that can help you build complex searches directly in the AST nodes as regexes does for plain strings. The presentation will be a live coding tour of how to use the tool and create your searching patterns. I'll also show how to manipulate the code in the target AST nodes, allowing us to refactor the source code in an automated way. I'll share a few funny stories about how I refactored thousands of files in a week.
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
### Summary In the video "Live coding: Grepping Ruby code like a boss" by Jônatas Davi Paganini, presented at RubyKaigi Takeout 2020, the speaker discusses the challenges of searching Ruby code and introduces a tool called Fast, which simplifies creating complex search patterns using the Abstract Syntax Tree (AST). The talk emphasizes the importance of refining code searching methods to enhance coding practices in Ruby. #### Key Points Discussed: - **Introduction to Fast**: Jônatas presents his personal project, Fast, designed to implement node patterns for easier code searching in Ruby. - **Limitations of Traditional Tools**: Popular tools like grep, ag, and rg have limitations when it comes to searching Ruby code, often yielding confusing results, especially when searching for specific content such as method definitions or comments. - **Advantages of Fast**: Fast allows for specific matches with clear syntax-highlighted output, making it easier to traverse the code structure and find relevant nodes, such as method definitions and class structures. - **Creating Custom Patterns**: The presentation covers how to define search patterns within Fast using command line access, showcasing methods like type and children for better search context. - **Parser Rewriter Functionality**: Jônatas explains how Fast can automate refactoring processes through its parser rewriter, making it easy to replace patterns and manage code efficiently. - **Real-World Example**: He shares an amusing example involving a "waiter" library to illustrate how to manage execution times in tests and enhance test coverage through minor adjustments. - **Automation of Code Integration**: Fast simplifies the process of removing methods and searching patterns to identify weaknesses in existing code. - **Collaboration with Tools**: Using existing patterns from community tools like rubocop can facilitate additional refactoring efforts while promoting a collaborative learning environment. - **Conclusion and Takeaway**: The talk concludes by highlighting the need to refine search strategies in Ruby, ultimately aiming to empower developers with tools that enhance coding practices and uncover weak points in code. ### Conclusion Jônatas Davi Paganini provides valuable insights into refining search capabilities in Ruby through the Fast tool, urging developers to leverage sophisticated techniques and automated solutions for better code management. The overall emphasis on clear, practical examples serves to empower viewers with the knowledge needed to improve their coding workflows.
Suggest modifications
Cancel