<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hugo Lyra]]></title><description><![CDATA[Hi there, I’m Hugo.
Software Developer, Apprentice and working at Red Cloud]]></description><link>https://blog.hugolyra.com</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 12:45:21 GMT</lastBuildDate><atom:link href="https://blog.hugolyra.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Code review is a crucial part of software
development]]></title><description><![CDATA[Ensuring that code quality is maintained and that potential issues are identified early in the development cycle. By having multiple developers review code, a team can catch bugs, security vulnerabilities, and logic errors before they reach productio...]]></description><link>https://blog.hugolyra.com/code-review-is-a-crucial-part-of-software-development</link><guid isPermaLink="true">https://blog.hugolyra.com/code-review-is-a-crucial-part-of-software-development</guid><dc:creator><![CDATA[Hugo Lyra]]></dc:creator><pubDate>Mon, 11 Nov 2024 10:43:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/5fNmWej4tAA/upload/f2c9fc623f7662365747a67900d0398e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ensuring that code quality is maintained and that potential issues are identified early in the development cycle. By having multiple developers review code, a team can catch bugs, security vulnerabilities, and logic errors before they reach production. This process not only improves the quality of the code but also reduces the risk of costly mistakes and downtime caused by undetected errors. Ultimately, code review fosters a collaborative environment where developers can learn from one another and continuously improve their skills.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731321619095/c792251c-dd77-455a-9792-543062c3e34d.png" alt class="image--center mx-auto" /></p>
<p>Beyond error detection, code review enhances the overall consistency and readability of a codebase. When multiple developers contribute to a project, differences in coding styles and approaches can emerge. Code review helps enforce coding standards and best practices, creating a unified codebase that is easier to understand and maintain. This consistency is invaluable in large projects where different developers may need to work on or refactor code that others have written. A clear, cohesive codebase reduces onboarding time for new team members and facilitates smoother handoffs during transitions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731321691492/a808eef4-0d0f-431d-a0a2-0dfa28c474ff.png" alt class="image--center mx-auto" /></p>
<p>Lastly, code review supports knowledge sharing and team cohesion. When developers review each other's code, they gain insight into various parts of the codebase and learn new techniques, tools, and problem-solving strategies. This shared understanding of the code and the project’s goals strengthens the team and encourages a culture of continuous improvement. Additionally, regular code review can reveal opportunities to optimize performance, simplify complex code, and adopt new best practices, making it an essential practice in modern, agile development environments.</p>
]]></content:encoded></item><item><title><![CDATA[Code Review Advice for Beginners in Development]]></title><description><![CDATA[Understanding the Importance of Code Reviews
Benefits of Participating in Code Reviews
Code reviews are a fundamental part of the software development process, especially for beginner developers. Engaging in code reviews can significantly enhance you...]]></description><link>https://blog.hugolyra.com/code-review-advice-for-beginners-in-development</link><guid isPermaLink="true">https://blog.hugolyra.com/code-review-advice-for-beginners-in-development</guid><category><![CDATA[code review]]></category><dc:creator><![CDATA[Hugo Lyra]]></dc:creator><pubDate>Fri, 19 Apr 2024 09:53:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/s9CC2SKySJM/upload/3f1fe118ef290cf89b86214934c89992.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-understanding-the-importance-of-code-reviews"><strong>Understanding the Importance of Code Reviews</strong></h2>
<h3 id="heading-benefits-of-participating-in-code-reviews"><strong>Benefits of Participating in Code Reviews</strong></h3>
<p><strong>Code reviews</strong> are a fundamental part of the software development process, especially for <strong>beginner developers</strong>. Engaging in code reviews can significantly enhance your coding skills and project quality. Here are some key benefits:</p>
<ul>
<li><p><strong>Improvement in Code Quality</strong>: Regular code reviews help in identifying bugs and issues early in the development cycle, which reduces the cost and time spent on fixing them later.</p>
</li>
<li><p><strong>Knowledge Sharing</strong>: Through code reviews, beginners can learn from more experienced developers, gaining insights into coding standards and best practices.</p>
</li>
<li><p><strong>Enhanced Collaboration</strong>: Code reviews foster a collaborative environment where team members can discuss and agree on coding approaches, leading to a more unified codebase.</p>
</li>
<li><p><strong>Skill Development</strong>: By reviewing others' code, developers can also improve their own coding skills, learning new techniques and technologies.</p>
</li>
</ul>
<h3 id="heading-common-misconceptions-about-code-reviews"><strong>Common Misconceptions About Code Reviews</strong></h3>
<p>Despite the benefits, some misconceptions can deter beginners from participating in code reviews. Here are a few common ones:</p>
<ul>
<li><p><strong>"Code reviews are only for finding errors."</strong>: While identifying errors is a part of code reviews, they are also about sharing knowledge and improving the overall quality of the code.</p>
</li>
<li><p><strong>"Code reviews are time-consuming."</strong>: Initially, code reviews might seem time-consuming, but they save time in the long run by catching issues early.</p>
</li>
<li><p><strong>"Only senior developers should review code."</strong>: Code reviews are beneficial for all team members, regardless of experience level. They provide a platform for learning and continuous improvement.</p>
</li>
</ul>
<p>Understanding these benefits and clearing up misconceptions are crucial first steps for beginner developers. This sets a solid foundation for engaging effectively in code reviews and reaping their full advantages.</p>
<h2 id="heading-preparing-for-your-first-code-review"><strong>Preparing for Your First Code Review</strong></h2>
<p>Embarking on your first code review can be daunting, but with the right preparation, you can make it a constructive and educational experience. Here are some essential steps to help you prepare effectively.</p>
<h3 id="heading-familiarize-yourself-with-the-projects-codebase-and-guidelines"><strong>Familiarize Yourself with the Project’s Codebase and Guidelines</strong></h3>
<p>Before you dive into writing or reviewing code, it's crucial to have a good understanding of the <strong>project’s codebase</strong> and the coding guidelines followed by the team. This foundational step ensures that you are not just reviewing the code for syntax, but also for its alignment with the project's overall architecture and standards.</p>
<ul>
<li><p><strong>Study the documentation</strong>: Spend time with any available documentation related to the project. This might include system architecture documents, setup guides, and previously completed code reviews.</p>
</li>
<li><p><strong>Understand the style guidelines</strong>: Most projects have specific coding standards such as naming conventions, formatting rules, and best practices. Familiarizing yourself with these can greatly improve the quality of your reviews.</p>
</li>
<li><p><strong>Ask questions</strong>: Don’t hesitate to ask for clarifications from more experienced team members if certain aspects of the project are unclear.</p>
</li>
</ul>
<h3 id="heading-review-your-own-code-before-submitting"><strong>Review Your Own Code Before Submitting</strong></h3>
<p>Self-review is a critical step before submitting your code for review. It not only helps in catching errors early but also reduces the back-and-forth that might occur if obvious mistakes are left in the code.</p>
<ul>
<li><p><strong>Check for common errors</strong>: Look for syntax errors, typos, memory leaks, or any other common programming mistakes.</p>
</li>
<li><p><strong>Ensure readability</strong>: Make sure your code is clean, well-commented, and easy to understand. Remember, your code isn’t just for the computer to execute; it’s also for humans to read and understand.</p>
</li>
<li><p><strong>Run tests</strong>: Execute any unit tests or integration tests that can help ensure your code behaves as expected.</p>
</li>
</ul>
<h3 id="heading-keep-changes-small-and-focused"><strong>Keep Changes Small and Focused</strong></h3>
<p>When preparing for a code review, one of the best practices is to keep your changes limited and focused. Smaller, well-defined changes are easier to review and understand than a large swath of modifications spread across multiple files.</p>
<ul>
<li><p><strong>Break down features</strong>: If you’re working on a large feature, break it down into smaller, manageable pieces. Submit these pieces for review one at a time.</p>
</li>
<li><p><strong>Focus on one issue at a time</strong>: Avoid mixing multiple issues or features in the same commit. This helps reviewers focus on a specific aspect without distraction.</p>
</li>
</ul>
<p>By following these preparatory steps, you can ensure that your first code review is not only less intimidating but also more productive. Remember, the goal of a code review is not just to find faults, but also to learn from each other and improve the overall quality of the code.</p>
]]></content:encoded></item><item><title><![CDATA[The Power of Code Review]]></title><description><![CDATA[Let's talk about the crucial practice of code review and how it can significantly improve collaboration, code quality, and overall project success. 🚀
🔍 What is Code Review?
Code review is a vital step in the software development process where peers...]]></description><link>https://blog.hugolyra.com/the-power-of-code-review</link><guid isPermaLink="true">https://blog.hugolyra.com/the-power-of-code-review</guid><category><![CDATA[development]]></category><category><![CDATA[#codenewbies]]></category><category><![CDATA[code review]]></category><dc:creator><![CDATA[Hugo Lyra]]></dc:creator><pubDate>Wed, 24 May 2023 11:32:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/FHnnjk1Yj7Y/upload/54580c8649d14ef9b377280de4470bfa.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's talk about the crucial practice of code review and how it can significantly improve collaboration, code quality, and overall project success. 🚀</p>
<p>🔍 What is Code Review?</p>
<p>Code review is a vital step in the software development process where peers examine a proposed code change to identify bugs, improve readability, and ensure adherence to coding standards. </p>
<p>✨ Benefits of Code Review:</p>
<p>1️⃣ Bug Detection: Additional eyes on the code can uncover bugs, logic errors, or potential vulnerabilities that may have been missed during development. This helps catch issues early on, preventing them from reaching production.</p>
<p>2️⃣ Knowledge Sharing: Code review facilitates knowledge transfer among team members. It exposes developers to different coding styles, techniques, and problem-solving approaches.</p>
<p>3️⃣ Improving Code Quality: Feedback received during code review helps improve code quality, readability, and maintainability. It encourages developers to follow best practices, write modular code, and consider edge cases.</p>
<p>4️⃣ Mentorship and Growth: Code review offers a valuable opportunity for mentorship and professional growth. Developers can provide guidance and insights to team members, fostering skill development and career progression.</p>
<p>🚀 Best Practices for Effective Code Reviews:</p>
<p>1️⃣ Establish Clear Guidelines: Define a code review process and document guidelines for reviewers and developers. Set expectations regarding the scope of review, coding standards, and feedback format.</p>
<p>2️⃣ Be Constructive: Provide feedback respectfully and constructively. Focus on the code, not the person, and offer suggestions or alternatives where applicable. Encourage a positive and collaborative atmosphere.</p>
<p>3️⃣ Keep Reviews Small and Focused: Break down large code changes into smaller, manageable review units. This allows reviewers to focus and provide more detailed feedback. Avoid overwhelming reviewers with massive changesets.</p>
<p>4️⃣ Encourage Discussion: Code review should be a two-way communication process. Encourage developers to ask questions, clarify intent, and engage in meaningful discussions with reviewers.</p>
<p>Remember, code review is a team effort, and its value lies in collaboration and continuous improvement. Embrace it as an opportunity to learn, grow, and build better software together! 💪</p>
]]></content:encoded></item><item><title><![CDATA[Understanding the CSS !important Rule]]></title><description><![CDATA[Have you ever encountered a situation where you wanted to change the color of a label, but despite your best efforts, the color remained unchanged? You probably discovered that there was another CSS rule overriding your intended style. In this blog p...]]></description><link>https://blog.hugolyra.com/understanding-the-css-important-rule</link><guid isPermaLink="true">https://blog.hugolyra.com/understanding-the-css-important-rule</guid><category><![CDATA[CSS]]></category><category><![CDATA[coding]]></category><category><![CDATA[HTML]]></category><dc:creator><![CDATA[Hugo Lyra]]></dc:creator><pubDate>Tue, 11 May 2021 12:04:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1620734578642/GE6zCjA4I.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever encountered a situation where you wanted to change the color of a label, but despite your best efforts, the color remained unchanged? You probably discovered that there was another CSS rule overriding your intended style. In this blog post, we will delve into the CSS !important rule, its implications, and how to ensure maintainability and readability in your code.  </p>
<p>Imagine this scenario: you have a task at hand—to change the color of a label. Seemingly simple, right? You confidently create a class for the label.</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.red-label</span> { <span class="hljs-attribute">color</span>: red; }
</code></pre>
<p>Excitedly, you initiate the build, but to your surprise, the label stubbornly remains an ugly shade of green. Perplexed, you start debugging your code and discover another rule buried deep within your codebase.</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.container</span> <span class="hljs-selector-tag">label</span> { <span class="hljs-attribute">color</span>: green <span class="hljs-meta">!important</span>; }
</code></pre>
<p>Ah, the source of the problem is now clear. But how do we fix it?</p>
<p>Solution Attempt: Your instinct tells you to add the !important declaration to your class rule.</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.red-label</span> { <span class="hljs-attribute">color</span>: red <span class="hljs-meta">!important</span>; }
</code></pre>
<p>Voila! The label finally assumes the desired color, and you rejoice in your accomplishment. But hold on a moment—things are not as ideal as they seem.</p>
<h2 id="heading-what-is-the-problem-and-how-to-fix-it">What is the problem and how to fix it?</h2>
<p>Let's consider the issue at hand. Overspecifying rules by relying heavily on the !important rule can have detrimental effects on code maintainability and readability. While it may seem like a quick fix, it offers no real benefits in the long run.  </p>
<p>To comprehend the problem fully, we need to grasp the concept of specificity. CSS stands for Cascading Style Sheets, and as the name suggests, styles cascade and override each other based on their specificity. When multiple rules with the same specificity are applied to an element, the one declared further down in the source code takes precedence.</p>
<h2 id="heading-how-to-calculate-specificity">How to calculate specificity</h2>
<p>To calculate specificity, you need to consider the following factors:</p>
<ol>
<li><p>Count the number of ID attributes in the selector</p>
</li>
<li><p>Count the number of other attributes and pseudo-classes in the selector</p>
</li>
<li><p>Count the number of element names in the selector</p>
</li>
</ol>
<p>The !important value appended to a CSS property grants it the highest specificity, overriding even inline styles defined within the markup. The only way an !important value can be overridden is by another !important rule declared later in the CSS, as the hierarchy of rules determines which property should be applied to a given element.</p>
<p>Rather than relying on excessive use of the !important rule, it is advisable to employ naming methodologies like BEM (Block Element Modifier) or other similar approaches. These methodologies promote a clear CSS hierarchy and help establish a structured and maintainable codebase.</p>
<p>In conclusion, understanding the CSS !important rule and specificity is crucial for maintaining a robust and readable codebase. While the !important rule can be a powerful tool in certain scenarios, overusing it can lead to difficulties in maintaining and comprehending your stylesheets. By following best practices, such as employing naming methodologies and considering the CSS hierarchy, you can create maintainable code that avoids the pitfalls of overspecificity.</p>
<p>Thank you for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Small ruby tips]]></title><description><![CDATA[N+1 Query
What is a N+1 query? Consider a situation where you have users that each have many friends. If we loop to map the friends, we could write the following map code.
With this first solution every time you access a user’s friends, it goes back ...]]></description><link>https://blog.hugolyra.com/small-ruby-tips</link><guid isPermaLink="true">https://blog.hugolyra.com/small-ruby-tips</guid><category><![CDATA[Ruby]]></category><category><![CDATA[Programming Tips]]></category><dc:creator><![CDATA[Hugo Lyra]]></dc:creator><pubDate>Mon, 10 May 2021 15:30:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1620660558555/peC2QxTTp.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="n1-query">N+1 Query</h1>
<p>What is a N+1 query? Consider a situation where you have users that each have many friends. If we loop to map the friends, we could write the following map code.</p>
<p>With this first solution every time you access a user’s friends, it goes back to the database to load them, generating an N+1 query.</p>
<p>The ActiveRecord solution is to eagerly load the data and this is accomplished with a simple method includes.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620660289126/0I5462pwd.png" alt="ruby-n1-query.png" /></p>
<h1 id="memoization">Memoization</h1>
<p>Memoization is a technique you can use to cache the result of a method that do time-consuming work and can be executed once.</p>
<p>That means that you’ll only make the network call the first time you call memoized_friends, and future calls will just return the value of the instance variable friends.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620660341905/vnw_SW_xy.png" alt="ruby-memoization.png" /></p>
<h1 id="map-shorthand">Map Shorthand</h1>
<p>You can use a shorthand version for map when you’re calling a method that doesn’t need any arguments.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620660380733/6Bc5NkeDp.jpeg" alt="ruby-map-shorthand.jpeg" /></p>
<p>Thanks for reading!</p>
]]></content:encoded></item></channel></rss>