Marc Reynolds, with experience in the medical industry, discusses the challenges and benefits of modularizing Rails with Packwerk. He explains how Doximity implemented it, fosters communication between teams, and addresses organizational structure. The importance of clear interfaces and maintaining a clean code base for companies experiencing growth is highlighted.
Modularizing Rails using Packwork helps enforce boundaries between modules, enhance code clarity, and promote inter-team communication.
Implementing Packwork gradually and incrementally in a large codebase can improve the onboarding experience, maintain a clean codebase, and facilitate inter-team collaboration.
Deep dives
Modularizing Rails for Code Organization and Clarity
Modularizing Rails is about breaking up a large Rails application into smaller, more discoverable modules. Mark Reynolds, an engineering manager at Doximity, shared his experiences with Rails modularization at Rocky Mountain Ruby. By using Packwork, a static analysis tool, they were able to identify and enforce boundaries between different modules, ensuring privacy violation free code. Packwork helped them have clear public interfaces, promote inter-team communication, and enhance code clarity. The process of modularization required breaking down the repository into smaller packages while maintaining the system's functionality and passing tests. The ownership of packages generally aligned with feature sets or specific teams, ensuring clear responsibilities and facilitating collaboration among developers.
The Benefits of Modularizing Rails within a Monolithic Codebase
Modularizing Rails offers the benefits of microservices while still using a monolithic codebase. The approach allows for a strict public interface and provides a private sandbox for development freedom. By leveraging Packwork's static analysis tool, developers can identify privacy violations and explicitly define package dependencies, fostering clarity in code organization and reducing unnecessary coupling. The modular approach enhances code cohesion within packages and promotes low coupling between them. This structure improves the onboarding experience for developers and facilitates inter-team collaboration, making it easier to spot areas of improvement and maintain a clean and efficient codebase.
Implementing Packwork and Overcoming Challenges
Implementing Packwork involves adding it to the repository and gradually moving code into separate packages based on feature sets or responsibilities. Breaking down a large codebase with hundreds of lines of code can be a daunting task, but approaching it incrementally helps manage complexity. Setting clear goal posts and celebrating milestones throughout the process ensures steady progress. Packwork's static analysis tool reveals privacy violations and helps establish clear public interfaces. Adjustments in the package structure may be necessary during the process, based on feedback and clarity gained. By addressing pain points and facilitating communication between developers, the Packwork implementation can improve the onboarding experience and maintain a clean and scalable codebase.
Maintaining Clarity and Flexibility with Packwork
Packwork provides a low-touch, static analysis tool that supports continuous integration processes. It analyzes package dependencies and privacy violations, ensuring adherence to public interfaces and fostering explicit communication between developers. Packwork promotes effective collaboration between teams, especially in cases where multiple teams may own and contribute to specific packages. By establishing clear public interfaces and allowing freedom within packages, code cohesion and low coupling can be achieved. Regularly updating package ownership and addressing pain points can help maintain a clear and comfortable development environment, facilitating better code management, bug identification, and smooth software maintenance and growth.
Marc has been building software for more than two decades, with a particular focus on the medical industry. He’s currently working with Doximity to create tools that make doctors’ lives easier. As an Engineering Manager, one of his primary focuses over the last couple years has been to figure out how to reduce unnecessary code coupling and make the lives of Doximity developers easier. He recently shared his experience with rails modularization at the Rocky Mountain Ruby conference.
In this episode, we talk about Packwerk, it's challenges and benefits, and how Doximity was able to modularize their monolith.
As an Engineering Manager or an engineer, too much of your time gets sucked up with downtime issues, troubleshooting, and error tracking. How can you spend more time shipping code and less time putting out fires?
Honeybadger is how. It’s a suite of monitoring tools specifically for devs.
Get started today in as little as 5 minutes at Honeybadger.io with plans starting at free!
Discourse
Discourse is open source and is trusted by more than 20,000 online communities including some of the largest companies in the world
By harnessing the power of discussion, real-time chat, and AI, Discourse makes it easy to have meaningful conversations and collaborate with your community anytime and anywhere.
Are you ready to create a community? Visit ~discourse.org/rorp~
to get one month free on all self-serve plans. Whether you’re just starting out or want to take your community to the next level, there’s a plan for you.
Get the Snipd podcast app
Unlock the knowledge in podcasts with the podcast player of the future.
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode
Save any moment
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Share & Export
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode