<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: hexdevs</title>
    <description>The latest articles on Forem by hexdevs (@hexdevs).</description>
    <link>https://forem.com/hexdevs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F4983%2F5e53e9d1-1b2c-4226-8e94-1cac06c3a6e9.png</url>
      <title>Forem: hexdevs</title>
      <link>https://forem.com/hexdevs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hexdevs"/>
    <language>en</language>
    <item>
      <title>How to Improve Code Quality on a Ruby on Rails Application</title>
      <dc:creator>Stefanni Brasil</dc:creator>
      <pubDate>Thu, 11 Nov 2021 21:45:59 +0000</pubDate>
      <link>https://forem.com/hexdevs/how-to-improve-code-quality-on-a-ruby-on-rails-application-2on</link>
      <guid>https://forem.com/hexdevs/how-to-improve-code-quality-on-a-ruby-on-rails-application-2on</guid>
      <description>&lt;p&gt;Does it take forever to ship even small features on the codebase you're working on? Is the code hard to understand and maintain? &lt;br&gt;
Are projects always running over budget? Are you constantly sacrificing code quality and not paying down technical debt?&lt;/p&gt;

&lt;p&gt;When you change one feature, does another completely unrelated part of your app stop working? New bugs appear, even though tests never break? 🥵&lt;/p&gt;

&lt;p&gt;Those are signs that you are suffering from working on a codebase with low code quality.&lt;/p&gt;

&lt;p&gt;How can you get out of this mess? Is it possible to avoid getting into this situation in the first place? Yes, it is!&lt;/p&gt;

&lt;p&gt;By the end of this post, you'll know exactly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to improve Code Quality on a Ruby on Rails application&lt;/li&gt;
&lt;li&gt;Which Code Quality tools to use&lt;/li&gt;
&lt;li&gt;How to use the Ruby Code Quality Checklist to get out of the tar pit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is based on a talk from Ernesto Tagwerker's talk entitled &lt;a href="https://www.youtube.com/watch?v=ZyU6K6eR-_A"&gt;Escaping The Tar Pit&lt;/a&gt; at RubyConf 2019. Ernesto is the Founder &amp;amp; CTO at &lt;a href="https://www.fastruby.io/"&gt;FastRuby.io&lt;/a&gt; &amp;amp; &lt;a href="https://www.ombulabs.com/"&gt;Ombu Labs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Code Quality?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Software Code Quality means it works as expected AND it isn't a PITA to maintain it" -- Ernesto Tagwerker&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The simplest way to know if your codebase has enough Code Quality is if your team can easily add or change features without breaking &lt;br&gt;
unrelated features.&lt;/p&gt;

&lt;p&gt;And when the features do break, the test suite easily detects the problem before you even push the code to production.&lt;/p&gt;

&lt;p&gt;In summary, a quality codebase is &lt;strong&gt;easy to read, change, and maintain&lt;/strong&gt;. It also has good code coverage, and the test suite helps you improve and refactor the code, or change features with confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Improve Code Quality on a Ruby on Rails application
&lt;/h2&gt;

&lt;p&gt;There are four steps you need to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Measure and Assess Code Quality&lt;/li&gt;
&lt;li&gt;Measure Code Coverage with SimpleCov&lt;/li&gt;
&lt;li&gt;Calculate Churn and Complexity with RubyCritic&lt;/li&gt;
&lt;li&gt;Use Skunk to identify which files need urgent care&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Measure Code Quality on a Ruby on Rails Application
&lt;/h2&gt;

&lt;p&gt;You don't necessarily need a tool to assess Code Quality, and there is no silver bullet. You'll always need to evaluate what the data means. The tools help guide you so you can make the best decisions by yourself 💫&lt;/p&gt;

&lt;p&gt;Below are some tools and services to quickly assess code quality. You can use paid services such as CodeClimate, Codacy, and CodeScene to give you some measurements and reports.&lt;/p&gt;

&lt;p&gt;Or, use open sources tools to help you perform static code analysis, calculate code coverage and point out code smells and refactoring opportunities.&lt;/p&gt;

&lt;p&gt;Here's a list of tools you can use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ruby-doc.org/stdlib-3.0.2/libdoc/coverage/rdoc/Coverage.html"&gt;Coverage&lt;/a&gt;: Ruby's built-in tool that provides coverage measurements for Ruby.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simplecov-ruby/simplecov"&gt;SimpleCov&lt;/a&gt;: a code coverage analysis tool for Ruby.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/whitesmith/rubycritic"&gt;RubyCritic&lt;/a&gt;: a gem that wraps around static analysis gems such as Reek, Flay, and Flog to provide a quality report of your Ruby code.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/fastruby/skunk"&gt;Skunk&lt;/a&gt;: a tool that helps you find the most complicated parts of your application that also have low code coverage.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rubocop/rubocop"&gt;Rubocop&lt;/a&gt;: a Ruby static code analyzer and formatter, based on the community Ruby style guide. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Calculate Code Coverage With SimpleCov
&lt;/h2&gt;

&lt;p&gt;Use &lt;a href="https://github.com/simplecov-ruby/simplecov"&gt;SimpleCov&lt;/a&gt; to generate a report of how many statements are covered by your test suite. It won't assess the test suite quality, though.&lt;/p&gt;

&lt;p&gt;It will affect your test suite performance, so make sure to only run it when necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Measure Code Quality With RubyCritic
&lt;/h2&gt;

&lt;p&gt;Ernesto recommends &lt;a href="https://github.com/whitesmith/rubycritic"&gt;RubyCritic&lt;/a&gt; because it's a gem for assessing code quality that it's still actively maintained.&lt;/p&gt;

&lt;p&gt;RubyCritic provides a score based on churn and complexity. These metrics help you identify files that are great candidates for refactoring.&lt;/p&gt;

&lt;p&gt;Check out the talk at the minute &lt;a href="https://youtu.be/ZyU6K6eR-_A?t=1067"&gt;17:47&lt;/a&gt; to see how Ernesto analyzes the report generated by RubyCritic:&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Find Code Smells and Calculate SkunkScore with Skunk 🦨
&lt;/h2&gt;

&lt;p&gt;A SkunkScore is an assessment combining code smells, code complexity, and code coverage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/fastruby/skunk"&gt;Skunk&lt;/a&gt;'s main goal is to serve as a compass for the first steps in your refactoring adventure. Focus on the files with a high skunk_score with a decent code_coverage score. That means you can get started with files that have code quality problems but also have tests, which makes this step easier.&lt;/p&gt;

&lt;p&gt;Make sure to add a reminder to add more tests to the other files with high skunk_score and low code_coverage 📌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: When working on new features, run &lt;code&gt;$ skunk -b main&lt;/code&gt; against your feature branch to give you an idea of the features you're adding are improving or decreasing the code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ruby on Rails Code Quality Checklist
&lt;/h2&gt;

&lt;p&gt;Now that you have gathered the code quality data, use this checklist to start moving out of the tar pit 🏊‍♀️&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Delete unused files with Coverband 🪦
&lt;/h3&gt;

&lt;p&gt;The best code is no code, right? Dead code is code that is never executed and is just filling up space. In larger or older applications, dead code can be a very common thing.&lt;/p&gt;

&lt;p&gt;Find dead code with &lt;a href="https://github.com/danmayer/coverband"&gt;Coverband&lt;/a&gt;, which can be run in production.&lt;/p&gt;

&lt;p&gt;Or add a &lt;a href="https://www.youtube.com/watch?v=29UXzfQWOhQ"&gt;"tombstone"&lt;/a&gt; inside a method you want to remove, push it to production and wait. Check again in a few weeks or months, and if the code is never executed, you can safely remove it.&lt;/p&gt;

&lt;p&gt;Here are some other libraries to detect dead code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/lewispb/tombstone/"&gt;Tombstone&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/michaelfeathers/scythe"&gt;Scythe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/seattlerb/debride"&gt;Debride&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Refactor the complex files with better code coverage first 💇‍♀️
&lt;/h3&gt;

&lt;p&gt;Refactor complex files that have at least 60% or more code coverage.&lt;/p&gt;

&lt;p&gt;Sandi Metz's &lt;a href="https://www.youtube.com/watch?v=YtROlyWWhV0"&gt;"Polly Want a Message"&lt;/a&gt; talk has an approach for refactoring classes with lots of responsibilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Compare code quality improvements by running &lt;code&gt;$ skunk -b main&lt;/code&gt;. It will show you how much it improved. Such a great metric to share with your team! 🎊&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Write tests for the files with high skunk_core and low code coverage 🧹
&lt;/h3&gt;

&lt;p&gt;Writing tests will decrease a file's skunk_score. Skunk gives you a list of good candidates for your next test-writing efforts.&lt;/p&gt;

&lt;p&gt;Keep track of Code Quality by analyzing the SkunkScore Average. It's recommended to run the report every 3 weeks to evaluate the team's engineering practices and if the project is moving in the right direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Celebrate tiny wins often 🥳
&lt;/h3&gt;

&lt;p&gt;Improving code quality is a hard task! Make sure to celebrate every tiny improvement along the way with your team. Enjoy the relief of working on a great Ruby codebase.&lt;/p&gt;




&lt;p&gt;We highly recommend you watch the talk. The best part of this talk is to feel like there's hope and that getting out of a tar pit is possible.&lt;/p&gt;

&lt;p&gt;The questions he asked such as "What is code quality anyway?" are helpful to change the perspective on how to approach technical debt more humanely.&lt;/p&gt;

&lt;p&gt;After all, technical debt has the name technical in it but it's more a result of social/cultural problems in a team.&lt;/p&gt;

&lt;p&gt;Judging past decisions is easy and unhelpful. That's our default. Embracing the challenge and being open to the opportunities for improvement is the real challenge.&lt;/p&gt;

&lt;p&gt;Now, go follow the checklist to assess your Ruby Code Quality and create a livable environment for your code.&lt;/p&gt;




&lt;p&gt;We watched Ernesto's talk at a previous &lt;a href="https://dev.to/watch-party"&gt;Watch Party&lt;/a&gt;. We host tech talks watch parties every 4 weeks, on a Saturday morning 📺&lt;/p&gt;

&lt;p&gt;Sign up for our &lt;a href="https://www.hexdevs.com/newsletter/"&gt;newsletter&lt;/a&gt; to get an invitation for when we host our next one:Saturday morning 📺&lt;/p&gt;




&lt;p&gt;Copyright 2021 hexdevs&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>New job, new codebase. How do you even get started?</title>
      <dc:creator>Thiago Araujo</dc:creator>
      <pubDate>Fri, 22 Oct 2021 00:55:55 +0000</pubDate>
      <link>https://forem.com/hexdevs/new-job-new-codebase-how-do-you-even-get-started-4g7k</link>
      <guid>https://forem.com/hexdevs/new-job-new-codebase-how-do-you-even-get-started-4g7k</guid>
      <description>&lt;p&gt;One of my readers asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you get started when you join a new company? How do you add features to a codebase that is massive, scary, and completely new to you?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;The first day at your new developer job is just like the first day at a new school.&lt;/em&gt; 🚸&lt;/p&gt;

&lt;p&gt;A sea of stranger's faces watching your every move. Unfamiliar smells in the hallway. &lt;/p&gt;

&lt;p&gt;Every chair is uncomfortable and makes weird noises when you sit. &lt;em&gt;"Eek, there's chewed-up gum under the seat!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The cafeteria, as expected, serves undrinkable coffee.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Just like the first zoom meeting with your new team.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Are they friendly and cool people? Will they think your code sucks?&lt;br&gt;
What about that Github link they've just sent you? Urgh, look at all that foreign code!&lt;/p&gt;

&lt;p&gt;Your first day at your new job can be quite scary.&lt;/p&gt;

&lt;h3&gt;
  
  
  But what if you could feel confident, supported, respected, and comfortable collaborating with your new team?
&lt;/h3&gt;

&lt;p&gt;What if you knew how to find your way around any codebase?&lt;/p&gt;

&lt;p&gt;What if you could be so focused and productive that you don't even notice time passing? Your working day goes like a breeze!&lt;/p&gt;

&lt;p&gt;After you read this post, you will know what strategies to use so you feel comfortable and know exactly how and where to get started 🌟&lt;/p&gt;

&lt;h2&gt;
  
  
  Before You Join, Take Time Off
&lt;/h2&gt;

&lt;p&gt;This might not be possible in every situation. Do your best to take some time for yourself.&lt;/p&gt;

&lt;p&gt;Take some time off before you start at a new job. Two weeks at the very least. Take this opportunity to start fresh and spend a couple of weeks relaxing and clearing your head.&lt;/p&gt;

&lt;p&gt;Having this extra headspace will help on your first week as you learn new things and get to know your teammates.&lt;/p&gt;

&lt;p&gt;The reason you feel so tired on your first week even has a scientific name: it's called &lt;a href="https://en.wikipedia.org/wiki/Acculturation" rel="noopener noreferrer"&gt;Acculturation&lt;/a&gt;. It's hard for anyone.&lt;/p&gt;

&lt;p&gt;Companies might try to pressure you into starting as soon as possible, but it's always &lt;em&gt;your choice&lt;/em&gt;.&lt;br&gt;
Assertive communication and taking care of yourself are qualities of a &lt;strong&gt;confident software engineer&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for Onboarding Materials or Documentation
&lt;/h2&gt;

&lt;p&gt;Ask if the company has any kind of onboarding materials you can look at the day before you join.&lt;br&gt;
Try to learn more about the stack, the codebase, and how the team works.&lt;/p&gt;

&lt;p&gt;For a startup, it's always good to look at their pitch deck so you can understand the problem they are solving and what kind of customers they are serving.&lt;/p&gt;

&lt;p&gt;Some companies won't be able to share anything with you before your first day for confidential or security reasons, while others might.&lt;/p&gt;

&lt;p&gt;In the past, one of my colleagues was given access to our codebase and got paid to work on it as part of the interview, which is a very neat way to get people onboarded more easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Onboarding Buddy
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.thd.codes%2Fimages%2Fposts%2Fthdcodes-being-onboarded-by-spongebob-squarepants.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.thd.codes%2Fimages%2Fposts%2Fthdcodes-being-onboarded-by-spongebob-squarepants.png" title="When your onboarding buddy is SpongeBob SquarePants" alt="When your onboarding buddy is SpongeBob SquarePants"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the company has some form of onboarding process plus good documentation, it makes things so much easier. Take advantage of it.&lt;/p&gt;

&lt;p&gt;Having an &lt;strong&gt;onboarding buddy&lt;/strong&gt; helps a lot in your first few weeks, as you get to know your team, the company's culture, how the product helps customers, and how people collaborate.&lt;/p&gt;

&lt;p&gt;Having someone to talk to and support you on your first week is very important.&lt;/p&gt;

&lt;p&gt;This onboarding buddy should also help you set up your dev environment. If there's no onboarding process in place, you can always ask for an onboarding buddy. Help them understand the value of good onboarding and get the ball rolling.&lt;/p&gt;

&lt;p&gt;I've managed the onboarding process for one of my past employers and we've onboarded dozens of software engineers. &lt;strong&gt;Every one of them said that having a good onboarding process made them feel much more confident, welcomed, and productive&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If there's no go-to person to ask your questions, or you don't feel comfortable asking for someone to help you in your first few weeks, read on. There are a couple of other things you can try.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update the documentation and onboarding materials (optional)
&lt;/h3&gt;

&lt;p&gt;When you are getting started, it's always good to update the documentation being used for onboarding. It's often out-of-date, so it's a good opportunity to make things better for yourself&lt;br&gt;
and your team in the future.&lt;/p&gt;

&lt;p&gt;That's an easy way to show your peers you are a team player and you are committed to making things better for everyone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Issues and Feature Requests: Make Sure You Understand Them
&lt;/h2&gt;

&lt;p&gt;First and foremost, you have to understand what a new feature is supposed to do, and what would it mean for it to be "done and complete." Teams often have different interpretations of &lt;strong&gt;done&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For some, 'done' means 'tested and shipped to production'. Other times it just means 'ready for QA'.&lt;/p&gt;

&lt;p&gt;Work with the person that created the issue or&lt;br&gt;
feature request to make sure you understand it well.&lt;/p&gt;

&lt;p&gt;Not every team is good at writing and explaining things well on paper. Trying to understand what you need to do just by looking at the issue description or feature request can be challenging. You will be missing a lot of context as a new member of the team.&lt;/p&gt;

&lt;p&gt;Don't be afraid to ask questions if you're not sure what needs to be done, and take notes. Updating the issue/feature description always helps.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Write well, be kind to your future self.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I love writing good and descriptive user stories even if it's just for me to read. They help me a lot a week from now when I don't even remember what I'm supposed to build. Happens all the time. 🤷‍♂️&lt;/p&gt;

&lt;h2&gt;
  
  
  Latest Merged Pull Requests: A Gold Mine of Information
&lt;/h2&gt;

&lt;p&gt;After trying the usual stuff such as looking at the documentation and potentially outdated READMEs, you can move on to the next step:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look at the latest merged Pull Requests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing that helps the most is going through the latest merged pull requests and seeing what happened and how they look.&lt;/p&gt;

&lt;p&gt;This is the best way to see how people approach building new features on your team. Pull Requests usually have linked issues or feature requests you can read as well.&lt;/p&gt;

&lt;p&gt;This shows which parts/modules/classes/files in the system usually need to be changed in order to ship feature X or Y.&lt;/p&gt;

&lt;p&gt;For example: &lt;em&gt;let's say the latest PR shipped the &lt;code&gt;orders&lt;/code&gt; endpoint.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You look at the diff, you might see this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a new database migration&lt;/li&gt;
&lt;li&gt;a new model&lt;/li&gt;
&lt;li&gt;a new controller&lt;/li&gt;
&lt;li&gt;a new policy&lt;/li&gt;
&lt;li&gt;changes to the &lt;code&gt;routes.rb&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;a new serializer and/or views&lt;/li&gt;
&lt;li&gt;new tests: feature tests, request tests, model tests, etc.&lt;/li&gt;
&lt;li&gt;a new factory&lt;/li&gt;
&lt;li&gt;documentation updates&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes a feature touches infrastructure code as well (terraform files, CI stuff). Some teams ship database migrations in a separate PR.&lt;/p&gt;

&lt;p&gt;Looking at the diff/code changes helps you see what needs to be done.&lt;/p&gt;

&lt;h3&gt;
  
  
  Collaboration
&lt;/h3&gt;

&lt;p&gt;You will also get a sense of how the team works.&lt;/p&gt;

&lt;p&gt;For example, you might get answers to these technical aspects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How much test coverage is good enough?&lt;/li&gt;
&lt;li&gt;What's the coding style people follow?&lt;/li&gt;
&lt;li&gt;What are the conventions and best practices being followed?&lt;/li&gt;
&lt;li&gt;Which libraries are being used?&lt;/li&gt;
&lt;li&gt;Which patterns are being used and how code is organized?&lt;/li&gt;
&lt;li&gt;Do people open large Pull Requests or small ones?&lt;/li&gt;
&lt;li&gt;Do people split changes into frontend and backend changes?&lt;/li&gt;
&lt;li&gt;Is the project organized as a monorepo or a multi-repo?&lt;/li&gt;
&lt;li&gt;How does the CI/CD look like?&lt;/li&gt;
&lt;li&gt;How code gets deployed (manual vs automated deployments)?&lt;/li&gt;
&lt;li&gt;How and when do database migrations get merged?&lt;/li&gt;
&lt;li&gt;Does the team refactor code and pay down technical debt? When?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will learn how people give feedback. How much do they nitpick on the small stuff. How much bikeshedding is allowed.&lt;br&gt;
How technical discussions are conducted.&lt;/p&gt;

&lt;p&gt;Some teams care about good architecture and design. Others like to do incremental changes, refactoring, and paying down technical debt when needed.&lt;br&gt;
While others don't really care about any of this stuff and prefer to move fast and break things.&lt;/p&gt;

&lt;p&gt;These are useful things to know and expect when you submit your first PR. That will give you more confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Take a peek at &lt;code&gt;routes.rb&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;One simple trick is to look at &lt;code&gt;config/routes.rb&lt;/code&gt; first.&lt;br&gt;
Routes give you a sense of the endpoints and features that are available without having to go too deep into the codebase.&lt;/p&gt;

&lt;p&gt;By looking at the routes, you will know if the project has an external API or not, which is very useful information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read Related Code
&lt;/h2&gt;

&lt;p&gt;Take a look at code related to the feature you're working on. Models, Controllers, and the Schema or related migrations are good places to look.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let the Team Help You: Submit Your PR and Ask for Feedback
&lt;/h2&gt;

&lt;p&gt;Your new team wants you to be successful. That's why they hired you in the first place: because you're a great developer and you kick ass!&lt;/p&gt;

&lt;p&gt;Let them help you be successful.&lt;/p&gt;

&lt;p&gt;You can always submit your PR as is and wait for feedback. Let people help you finish it. You'll never know everything up front, there's no point in trying to make it &lt;br&gt;
perfect on the first try.&lt;/p&gt;

&lt;p&gt;If you get stuck, ask for help. Let people help you! There's no shame in that.&lt;/p&gt;

&lt;p&gt;Remember to add enough context in the Pull Request description so people can understand what you are trying to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to receive feedback
&lt;/h2&gt;

&lt;p&gt;Constructive feedback is always valuable. Listening to constructive criticism is how you learn and get better. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ask: what can I learn from the feedback I've received?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ask questions so you can understand their point of view. &lt;strong&gt;Be curious and open-minded&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Don't worry too much if people request changes or point to you things that could be improved. Don't be afraid to make mistakes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ask: did I add enough context in the Pull Request description?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sometimes they don't have enough context into what you are doing. In that case, add more context to help them.&lt;/p&gt;

&lt;p&gt;Sometimes they have a point and they are right. Be flexible and open, as they are giving you feedback so the team can ship good code. They could be asking you to follow some of the team's conventions that you might not know of.&lt;/p&gt;

&lt;p&gt;Other times, the reviewer just thinks differently than you. This is also fine. No two developers would ever write code in the same manner or style all the time. For these types of requests for change, you can politely disagree.&lt;/p&gt;

&lt;p&gt;With time you will learn how to separate changes that are "nice to have" but don't make any real difference, and changes that are really important.&lt;/p&gt;

&lt;p&gt;Having integrity and being assertive are hallmarks of a confident coder. Be graceful when receiving feedback. Even if people do criticize you for no good reason, don't take it personally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be kind, be gentle, and remember: your work does not define your value as a person.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asking questions is an effective way to change your approach to receiving criticism. By asking a question, you stop judging yourself or others, and you start to be more curious.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Confident Developer Onboarding Checklist
&lt;/h2&gt;

&lt;p&gt;Here's a quick checklist you can use for self-onboarding ✅&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Ask for some time off before I start&lt;/li&gt;
&lt;li&gt;[ ] Ask for documentation or onboarding materials&lt;/li&gt;
&lt;li&gt;[ ] Take advantage of the onboarding process&lt;/li&gt;
&lt;li&gt;[ ] Find an onboarding buddy&lt;/li&gt;
&lt;li&gt;[ ] Understand the issue or feature request I'm working on&lt;/li&gt;
&lt;li&gt;[ ] Look at the latest merged Pull Requests&lt;/li&gt;
&lt;li&gt;[ ] Take a peek at the &lt;code&gt;routes.rb&lt;/code&gt; file, or any code related to my work&lt;/li&gt;
&lt;li&gt;[ ] Let the team help me&lt;/li&gt;
&lt;li&gt;[ ] Get out of code perfectionism paralysis&lt;/li&gt;
&lt;li&gt;[ ] Ask for feedback&lt;/li&gt;
&lt;li&gt;[ ] Learn from the received feedback&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have other ideas that helped you in the past and want me to add them here, please let me know! 💡&lt;/p&gt;




&lt;p&gt;Hope you apply these strategies to give you more confidence in your first few weeks at your new developer job.&lt;/p&gt;

&lt;p&gt;Print your checklist and don't forget to use it! Bookmark this post and share it with any friends who need to read this ⭐&lt;/p&gt;

&lt;p&gt;Before I forget: &lt;em&gt;congratulations on getting a new job, that's awesome! I wish you all the best!&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Do you want to become an expert developer?
&lt;/h2&gt;

&lt;p&gt;I write about how to build expertise on the &lt;a href="https://www.hexdevs.com/newsletter/" rel="noopener noreferrer"&gt;hexdevs newsletter&lt;/a&gt;. We do live-coding and live stream events with some software industry experts. Sign up and be the first to hear about it.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>development</category>
      <category>onboarding</category>
    </item>
    <item>
      <title>Open Source Thursdays Expert Session with Rafael França on August 5th</title>
      <dc:creator>Thiago Araujo</dc:creator>
      <pubDate>Thu, 29 Jul 2021 12:00:00 +0000</pubDate>
      <link>https://forem.com/hexdevs/open-source-thursdays-expert-session-with-rafael-franca-on-august-5th-512f</link>
      <guid>https://forem.com/hexdevs/open-source-thursdays-expert-session-with-rafael-franca-on-august-5th-512f</guid>
      <description>&lt;p&gt;Open Source Thursdays is a project from &lt;strong&gt;hexdevs&lt;/strong&gt;. We’ve been making Open Source contributions more inclusive.&lt;/p&gt;

&lt;p&gt;On August 5th at 5 PM EST, Rafael França will join us as our expert guest. Rafael França is a Rails Core team member and Principal Engineer at Shopify. He is working to define the future of Ruby and Rails at Shopify.&lt;/p&gt;

&lt;p&gt;He will teach you all you need to know to get started with contributing to Ruby on Rails.&lt;/p&gt;

&lt;p&gt;In this session, Rafael will do a deep-dive into the Ruby on Rails codebase.&lt;/p&gt;

&lt;p&gt;You will learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to filter and understand issues&lt;/li&gt;
&lt;li&gt;The best practices for contributions&lt;/li&gt;
&lt;li&gt;How to ask for help&lt;/li&gt;
&lt;li&gt;How to help the Ruby on Rails Community.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will also have a Q&amp;amp;A session at the end.&lt;/p&gt;

&lt;p&gt;If you want to join the Livestream session, &lt;a href="https://www.hexdevs.com/open-source-thursdays/expert-sessions-with-rafael-franca-aug-5th/"&gt;click here to RSVP&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Share this event with a friend or a colleague who wants to contribute to Ruby on Rails.&lt;/p&gt;

&lt;p&gt;This event is sponsored by Shopify Engineering.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Learn Ruby on Rails Best Practices With One Exercise</title>
      <dc:creator>Thiago Araujo</dc:creator>
      <pubDate>Wed, 30 Jun 2021 20:00:00 +0000</pubDate>
      <link>https://forem.com/hexdevs/learn-ruby-on-rails-best-practices-with-one-exercise-4ed2</link>
      <guid>https://forem.com/hexdevs/learn-ruby-on-rails-best-practices-with-one-exercise-4ed2</guid>
      <description>&lt;p&gt;You want to write smooth professional-looking code.&lt;/p&gt;

&lt;p&gt;You're craving some squeaky-clean code. But all you have for lunch every day is &lt;strong&gt;a big bowl of legacy spaghetti code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You consider yourself a decent developer, but you're never sure how to organize a project. How to name things. Where some piece of business logic should live.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;How can you become a Ruby on Rails expert if the code you read every day stinks?&lt;/strong&gt;&lt;/em&gt; 🦨&lt;/p&gt;

&lt;p&gt;Is it possible to learn and follow best practices when you're trapped in a big ball of stale legacy code? &lt;/p&gt;

&lt;p&gt;Of course, it is!&lt;/p&gt;

&lt;p&gt;Start changing your coding diet today by consuming something healthier.&lt;/p&gt;

&lt;p&gt;Yes, it's going to take some work. But don't get discouraged. If you want to advance your skills, you've gotta try something different.&lt;/p&gt;

&lt;p&gt;Ready to get started?&lt;/p&gt;

&lt;h2&gt;
  
  
  First: Be Careful When You Ask for Advice
&lt;/h2&gt;

&lt;p&gt;You're committed to advancing your skills. When you ask people for guidance, they tell you to read a bunch of books and start throwing these terms at you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Skinny controllers, fat models, service objects, design patterns, DRY, SOLID, OOP...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The list goes on.&lt;/p&gt;

&lt;p&gt;Is this information really helpful to you? What are you supposed to do with all of that?&lt;/p&gt;

&lt;p&gt;The problem is that it's not actionable information, just a bunch of ideas and vague suggestions.&lt;/p&gt;

&lt;p&gt;There is a more practical way to learn all this stuff. Here's how.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Exercise to Teach You Ruby on Rails Best Practices
&lt;/h2&gt;

&lt;p&gt;Instead of reading another book or watching youtube videos about pasta making during your lunch break, do this exercise instead:&lt;/p&gt;

&lt;h3&gt;
  
  
  Exercise
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Set a timer for &lt;a href="https://e.ggtimer.com/10minutes"&gt;10 minutes&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Open this link in another tab: &lt;a href="https://github.com/thoughtbot/upcase/blob/master/app/services/practice.rb"&gt;practice.rb from Upcase by Thoughtbot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Read the &lt;code&gt;app/services/practice.rb&lt;/code&gt; class.&lt;/li&gt;
&lt;li&gt;Ask yourself: What's going on here? &lt;/li&gt;
&lt;li&gt;Come back here when the time is up! ⌛&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sounds good? &lt;/p&gt;

&lt;p&gt;Okay, now go do it!&lt;br&gt;
I'll wait for you.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;⏰ &lt;em&gt;beep! beep! beep! beep!&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Now that the time is up, answer at least one of these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why is this class so short? It's less than a hundred lines!&lt;/li&gt;
&lt;li&gt;Why is the variable &lt;code&gt;trails&lt;/code&gt; being passed down to the &lt;code&gt;initialize&lt;/code&gt; constructor?&lt;/li&gt;
&lt;li&gt;Did you notice these methods &lt;code&gt;promoted_unstarted_trails&lt;/code&gt; and &lt;code&gt;unpromoted_unstarted_trails&lt;/code&gt;? Why do you think they were given these names, and what's the difference between them?&lt;/li&gt;
&lt;li&gt;What is this class responsible for? 🤔&lt;/li&gt;
&lt;li&gt;What else picked your interest?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Write down the questions and your answers to make them stick.&lt;/p&gt;

&lt;p&gt;Last but not least:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeat this exercise tomorrow, but pick a different class from the same repository.&lt;/li&gt;
&lt;li&gt;Add a daily reminder to your calendar so you don't forget about it. 📅&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  It's okay if you don't understand anything
&lt;/h3&gt;

&lt;p&gt;The goal of this exercise is to notice some patterns. Not to understand every single line of code.&lt;/p&gt;

&lt;p&gt;Use your answers to the questions above as a &lt;em&gt;study guide&lt;/em&gt;. Even if you answered "I don't know", that's useful information. &lt;/p&gt;

&lt;h3&gt;
  
  
  It's okay if you feel uncomfortable
&lt;/h3&gt;

&lt;p&gt;Feeling uncomfortable means you're doing something different. You're challenging yourself. You're learning and growing.&lt;/p&gt;

&lt;p&gt;If you're thinking &lt;em&gt;"OMG this code is too clean and my code is super dirty!"&lt;/em&gt; or &lt;em&gt;"I'll never be able to work on such a clean codebase!"&lt;/em&gt;, don't worry!&lt;/p&gt;

&lt;p&gt;That's okay. That's not the point of this exercise.&lt;/p&gt;

&lt;p&gt;The point of this exercise is to read the code and notice anything that looks different or any interesting pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  How am I going to learn anything just by reading one class?
&lt;/h2&gt;

&lt;p&gt;It might seem like it's not much.&lt;/p&gt;

&lt;p&gt;If you do this every day, here's what's going to happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the very least, you're going to learn how the Upcase codebase works.&lt;/li&gt;
&lt;li&gt;You will pick up new ideas and patterns.&lt;/li&gt;
&lt;li&gt;You will end up with a list of things you don't understand. That's a great guide on what you need to focus on.&lt;/li&gt;
&lt;li&gt;You will see how other experts structure a project to make the code neat and clean.&lt;/li&gt;
&lt;li&gt;You will learn how to find answers to your own questions and how to read source code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's pretty good, right?&lt;/p&gt;

&lt;p&gt;All professional developers and experts have these skills. It comes from practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Pick a Well-Written Codebase?
&lt;/h2&gt;

&lt;p&gt;Good question. You have to be exposed to good code if you want to advance your skills. Especially if you don't have this opportunity at work.&lt;/p&gt;

&lt;p&gt;If your goal is to learn best practices, you have to read a well-written codebase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thoughtbot.com"&gt;Thoughtbot&lt;/a&gt;, the company behind &lt;a href="https://thoughtbot.com/upcase"&gt;Upcase&lt;/a&gt;, is well-known in the Ruby on Rails community for setting industry standards and following &lt;a href="https://thoughtbot.com/blog/sandi-metz-rules-for-developers"&gt;good coding practices&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What if I get stuck?
&lt;/h2&gt;

&lt;p&gt;When that happens, ask one of your colleagues for help.&lt;/p&gt;

&lt;p&gt;If that doesn't work or you don't feel comfortable doing that, ask &lt;a href="https://discuss.rubyonrails.org/"&gt;Rails Forum&lt;/a&gt; or &lt;a href="https://www.reddit.com/r/rails/"&gt;Reddit&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can also send me a DM on &lt;a href="https://twitter.com/thdaraujo"&gt;Twitter&lt;/a&gt; and I'll be happy to help.&lt;/p&gt;




&lt;p&gt;Now that you've done this exercise, you will improve your Rails skills every time you practice.&lt;/p&gt;

&lt;p&gt;It's just a matter of consistently exposing yourself to good code. Keep using the suggested questions as a guide, or come up with different ones. Pick a different class every day, and keep going.&lt;/p&gt;

&lt;p&gt;You've already done the hardest part: getting started. Now keep practicing.&lt;/p&gt;

&lt;p&gt;Let me know what you've learned by practicing this exercise. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bookmark this post to keep the questions on hand. Share it with a friend who will find this exercise helpful.&lt;/strong&gt; ⭐&lt;/p&gt;

&lt;p&gt;Happy learnings! 📓&lt;/p&gt;




&lt;h2&gt;
  
  
  Do you want to become an expert developer?
&lt;/h2&gt;

&lt;p&gt;I write about Ruby and Software Development on &lt;a href="https://www.hexdevs.com/"&gt;hexdevs&lt;/a&gt; and on &lt;a href="https://twitter.com/thdaraujo"&gt;Twitter&lt;/a&gt;. Let's connect!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
  </channel>
</rss>
