<?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>DEV Community: Antonio Djigo</title>
    <description>The latest articles on DEV Community by Antonio Djigo (@brownio).</description>
    <link>https://dev.to/brownio</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%2Fuser%2Fprofile_image%2F154470%2F78e06936-1ce8-498d-8a7d-88c55f2fe000.jpg</url>
      <title>DEV Community: Antonio Djigo</title>
      <link>https://dev.to/brownio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brownio"/>
    <language>en</language>
    <item>
      <title>Bullet-proof user stories for your team - with AI Prompts to do them!</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Tue, 02 Jul 2024 13:21:01 +0000</pubDate>
      <link>https://dev.to/brownio/bullet-proof-user-stories-for-your-team-with-ia-prompts-to-do-them-17g3</link>
      <guid>https://dev.to/brownio/bullet-proof-user-stories-for-your-team-with-ia-prompts-to-do-them-17g3</guid>
      <description>&lt;h2&gt;
  
  
  What are the user stories?
&lt;/h2&gt;

&lt;p&gt;In the dynamic world of product development and engineering, &lt;strong&gt;effective communication and collaboration are critical to a project's success&lt;/strong&gt;. User stories serve as the backbone of agile methodologies, providing a clear and concise way to capture user requirements and translate them into actionable tasks for the development team.&lt;/p&gt;

&lt;p&gt;When done right, user stories can drive alignment, foster collaboration, and streamline the development process. However, crafting user stories that are truly "bullet-proof" requires a blend of art and science. It involves understanding the core principles of** effective storytelling*&lt;em&gt;, embracing **best practices&lt;/em&gt;*, and continuously refining the process based on feedback and real-world experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  What will you learn
&lt;/h2&gt;

&lt;p&gt;In this article, we will delve into &lt;strong&gt;what makes a user story rock-solid&lt;/strong&gt;, and why it is essential for your team's success. We will explore the key characteristics of high-quality user stories, provide practical tips for writing them, and discuss how to avoid common pitfalls.&lt;/p&gt;

&lt;p&gt;Whether you are a product manager, a developer, or a stakeholder, mastering the art of bullet-proof user stories will empower you to deliver products that truly resonate with your users, and will make your peer's life easier.&lt;/p&gt;

&lt;p&gt;Also, we'll speak about a method called &lt;strong&gt;Gherkin&lt;/strong&gt;, used for highly-technical tickets that are aimed to both devs and non-technical profiles.&lt;/p&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%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNzF5aWliMnRxMWkyMHJkM3VoZzM0emo0b2RpancweWQ0emt5bXA4NiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F8079jlIfkJneWbyrdu%2Fgiphy.webp" 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%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNzF5aWliMnRxMWkyMHJkM3VoZzM0emo0b2RpancweWQ0emt5bXA4NiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F8079jlIfkJneWbyrdu%2Fgiphy.webp" alt="What's this?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding User Stories
&lt;/h2&gt;

&lt;p&gt;User stories are &lt;strong&gt;concise&lt;/strong&gt;, simple descriptions of a feature told from the perspective of the end user. They focus on what the user needs and why. Typically, they follow a basic format:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template&lt;/strong&gt;: "As a [&lt;strong&gt;type of user&lt;/strong&gt;], I want [&lt;strong&gt;an action&lt;/strong&gt;] so that [&lt;strong&gt;a benefit&lt;/strong&gt;]."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: To capture user requirements and facilitate clear communication between stakeholders and development teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Characteristics of Bullet-Proof User Stories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clarity&lt;/strong&gt;: Easy to understand with no ambiguity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conciseness&lt;/strong&gt;: Brief yet comprehensive enough to convey the necessary information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specificity&lt;/strong&gt;: Provides sufficient detail without being overly prescriptive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These stories should follow the &lt;strong&gt;INVEST&lt;/strong&gt; criteria, which stands for independent, negotiable, valuable, estimable, small, and testable.&lt;/p&gt;

&lt;h3&gt;
  
  
  INVEST Criteria
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Independent&lt;/strong&gt;: The story should stand alone, allowing it to be developed and delivered independently of other stories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Negotiable&lt;/strong&gt;: Stories should be flexible and open to discussion and modification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Valuable&lt;/strong&gt;:Each story should provide value to the user or customer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Estimable&lt;/strong&gt;:The team should be able to estimate the effort required to complete the story.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small&lt;/strong&gt;:The story should be small enough to be completed in a single iteration or sprint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testable&lt;/strong&gt;:There should be clear criteria to determine when the story is complete and meets the requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, good acceptance criteria are key because they help the team and other developers grasp the fundamental technical details of a task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acceptance Criteria
&lt;/h2&gt;

&lt;p&gt;Acceptance criteria &lt;strong&gt;specify the requirements that need to be fulfilled to meet the user's needs&lt;/strong&gt; as described in the user story. They provide a clear definition of done, helping to prevent misunderstandings and scope creep during development. Essentially, acceptance criteria outline the conditions under which the user story can be considered satisfactorily implemented and ready for testing and deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Should Acceptance Criteria Be?
&lt;/h3&gt;

&lt;p&gt;Acceptance criteria should be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Specific&lt;/strong&gt;: Clearly define what needs to be achieved and what constitutes success.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measurable&lt;/strong&gt;: Provide a way to objectively verify when the criteria are met.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Achievable&lt;/strong&gt;: Realistic and feasible within the project constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relevant&lt;/strong&gt;: Directly related to the user story and its intended outcome.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time-bound&lt;/strong&gt;: Clearly state when the acceptance criteria should be fulfilled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, here's an example of a bad vs a good user story about the necessity of adding a new cookie banner for a promotional campaign, that will show specific content depending on wether the user accepts or not:&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad Example of a User Story
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Title: Show Cookie Banner

User Story:

As a user,
I want a cookie banner,
so that cookies are handled.

Acceptance Criteria:
- Display a cookie banner.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeah, but, what should happen when user declines? How long should the cookies stay on the browser?, Should we keep showing it if the user accepts?&lt;/p&gt;

&lt;p&gt;Above, you'd be failing the achieve most of the acceptance criteria and user story criteria (except for the Small one...)&lt;/p&gt;

&lt;h3&gt;
  
  
  Good Example of a User Story
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Story:

As a new user that enters the website for the first time,
I want a cookie banner to be displayed to me,
so that cookies can be stored in my browser to determine what to display on the website during the promotional campaign.

Acceptance Criteria:

- Upon first visit, a prominent cookie banner is displayed at the bottom of the website (Check design files below).
- The banner includes options to "Accept" or "Decline" cookies.
- It remains visible until the user makes a choice.
- If the user clicks "Accept," cookies are stored in the browser to record their preference.
- If the user clicks "Decline," no cookies are stored, and the banner remains visible on subsequent visits.
- Component A, related to tracking order status, is shown only if the user accepts cookies.
- If cookies are declined, Component A remains hidden.
- The user's cookie preference is remembered across sessions and visits to the website.
- The banner does not reappear after the user has made a choice unless they clear their browser cookies.
- Ensure the cookie banner and options are accessible to all users, including those using assistive technologies.
- Ensure compliance with legal requirements for cookie consent and user privacy regulations. Link in the cookie banner should forward the user to https://web.xyz/legal on a new tab.
- Verify that the cookie banner appears correctly on different browsers and devices.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, you can see it's still small, concise, easier to estimate, specific, and testable.&lt;/p&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%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExdHVnNGtzOHJ6Mm1vbTdzZjl1aDZsb21lcWZsYzY4ZWFnaHppNmo0MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FPqBh9miQvMQ2zamKJ2%2Fgiphy.webp" 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%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExdHVnNGtzOHJ6Mm1vbTdzZjl1aDZsb21lcWZsYzY4ZWFnaHppNmo0MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FPqBh9miQvMQ2zamKJ2%2Fgiphy.webp" alt="Better now"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the promised prompts for creating good user stories using tools or models like GPT, Gemini, or Copilot. Always be as informative as possible, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Delete everything from before. As if you were Senior Product Owner, Can you please generate a good user story following this format: 'As a [new user that entered the website for the first time], I want [a cookie banner to be displayed to the user] so that [we can store the cookies in the user's browser to decide what to show on the website]'? [The user story should be related to a new feature for a shopping website with a promotional campaign that allows users to track their order status. Component A should be shown only is user accepts the cookies] Please add an extensive and concise acceptance criteria for the developers to understand. Ask me if there is any doubt on what fields are we working, if any data or description is incomplete, on or anything relevant.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be sure to adapt everything that's between the "[ ]" so it matches your story.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Gherkin Method
&lt;/h2&gt;

&lt;p&gt;Gherkin is a structured language used to describe scenarios in a way that is &lt;strong&gt;easy to understand by both technical and non-technical stakeholders&lt;/strong&gt;. It's primarily used in &lt;a href="https://cucumber.io/docs/bdd/" rel="noopener noreferrer"&gt;BDD&lt;/a&gt; (a way for software teams to work that closes the gap between business people and technical people) to define acceptance criteria and specify how software should behave in various scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  When is Gherkin used?
&lt;/h3&gt;

&lt;p&gt;Gherkin is typically used in agile environments, where collaboration between business analysts, developers, and testers is essential. It helps &lt;strong&gt;ensure that everyone has a clear understanding of the expected behavior&lt;/strong&gt; of a feature or system.&lt;/p&gt;

&lt;p&gt;A normal user story, as described earlier, typically follows a format that outlines the who, what, and why of a feature from a user's perspective. On the other hand, Gherkin is more structured and focuses on specifying the behavior of the software through scenarios written in a specific syntax.&lt;/p&gt;

&lt;h3&gt;
  
  
  Characteristics of a Gherkin story
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Structure&lt;/strong&gt;: Gherkin scenarios are structured using keywords like Feature, Scenario, Given, When, and Then, which provide clear steps and expected outcomes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Human-Readable&lt;/strong&gt;: Gherkin scenarios are written in plain, understandable language that can be easily read and understood by both technical and non-technical stakeholders. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automation&lt;/strong&gt;: Scenarios written in Gherkin can often be directly used as automated tests. They can also be used as documentation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Structure explanation
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Feature
&lt;/h4&gt;

&lt;p&gt;The Feature keyword is used to define a high-level description of a feature or functionality that is being tested. It provides context about what aspect of the system the scenarios are related to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature: Login Functionality
  As a user,
  I want to be able to log into the system,
  So that I can access my account and manage my profile.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Scenario
&lt;/h4&gt;

&lt;p&gt;The Scenario keyword is used to define specific test scenarios or examples that illustrate how the system should behave under certain conditions. Each scenario typically represents a specific use case or user story.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scenario: Successful Login
  Given the user is on the login page
  When the user enters valid credentials
  And clicks on the login button
  Then the user should be logged into their account
  And redirected to the dashboard page.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Steps: Given, When, Then, And, But
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Given&lt;/strong&gt;: Specifies the initial state or precondition of the scenario. It sets up the context in which the scenario takes place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When&lt;/strong&gt;: Describes the action or event that occurs that triggers the behavior being tested.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then&lt;/strong&gt;: Defines the expected outcome or result of the action specified in the When step. It verifies the expected behavior of the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And, But&lt;/strong&gt;: These keywords are used to continue the previous step (Given, When, or Then) to add additional context or conditions as needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scenario: Search for a Product
  Given the user is on the homepage
  When the user enters "smartphone" in the search bar
  And clicks on the search button
  Then the search results page should display relevant products
  And the user should be able to filter and sort the results.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Optionals for Gherkin
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;: Optional Gherkin keyword used to define steps that are common to all scenarios within a feature file. It helps in setting up a consistent starting state for scenarios, reducing redundancy. &lt;a href="https://cucumber.io/docs/gherkin/reference/#background" rel="noopener noreferrer"&gt;Read more here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario Outline&lt;/strong&gt;: Optional Gherkin keyword used to define a template for scenarios that vary only in their inputs or data. It allows for parameterization of scenarios using placeholders, which are replaced with concrete values in each scenario instance. &lt;a href="https://cucumber.io/docs/gherkin/reference/#scenario-outline" rel="noopener noreferrer"&gt;Read more here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Overall, let's see what a complete Gherkin story should look like for the example from before&lt;/p&gt;

&lt;h3&gt;
  
  
  Example of a Gherkin story
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature: Cookie Consent Banner
  As a new user visiting the shopping website,
  I want to see a cookie banner
  So that my preferences can be recorded and I can view relevant promotional content.

  Scenario: Display Cookie Banner
    Given I am a new user
    When I visit the shopping website
    Then I should see a cookie banner with options to accept or decline cookies

  Scenario: Accept Cookies
    Given I am a new user
    And I see the cookie banner
    When I click on "Accept"
    Then cookies should be stored in my browser
    And I should be able to view promotional content related to the campaign

  Scenario: Decline Cookies
    Given I am a new user
    And I see the cookie banner
    When I click on "Decline"
    Then cookies should not be stored in my browser
    And Component A, which allows users to track their order status, should not be displayed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now, a good AI prompt to generate the Gherkin story, remember to change what's inside the "[ ]":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Delete everything from before. As if you were Senior Product Owner, Can you please generate a good user story following the Gherkin format: 'As a [new user that entered the website for the first time], I want [a cookie banner to be displayed to the user] so that [we can store the cookies in the user's browser to decide what to show on the website]'? [The user story should be related to a new feature for a shopping website with a promotional campaign that allows users to track their order status. Component A should be shown only is user accepts the cookies]  Ask me if there is any doubt on what fields are we working, if any data or description is incomplete, on or anything relevant.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fmedia2.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExdnI1YXJ2angydmRydmRneHdxeHdycHlrZXFlZHp2MnRsNTYyMDh3bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FPdGrB8Vq9pn16LR983%2Fgiphy.webp" 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%2Fmedia2.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExdnI1YXJ2angydmRydmRneHdxeHdycHlrZXFlZHp2MnRsNTYyMDh3bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FPdGrB8Vq9pn16LR983%2Fgiphy.webp" alt="That was nice"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mastering the creation of bullet-proof user stories is not just about following a template but understanding the nuances of effective communication and stakeholder alignment. By applying these principles, &lt;strong&gt;teams can navigate complexities, mitigate risks, and deliver impactful solutions that resonate with users&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed the article. Feel free to follow me on &lt;a href="https://x.com/brownio_" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, or just check my website! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://djigo.dev" rel="noopener noreferrer"&gt;https://djigo.dev&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>beginners</category>
      <category>startup</category>
      <category>writing</category>
    </item>
    <item>
      <title>What WordPress Playground means for your future</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Mon, 17 Jun 2024 15:46:10 +0000</pubDate>
      <link>https://dev.to/brownio/what-wordpress-playground-means-for-your-future-106d</link>
      <guid>https://dev.to/brownio/what-wordpress-playground-means-for-your-future-106d</guid>
      <description>&lt;h2&gt;
  
  
  Wordpress in one click
&lt;/h2&gt;

&lt;p&gt;Meaning, you can have a WordPress site &lt;strong&gt;on any device&lt;/strong&gt;, &lt;strong&gt;without the need of a host&lt;/strong&gt;, with just &lt;strong&gt;clicking a single button&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A site you can your work with &lt;strong&gt;directly in your browser&lt;/strong&gt;. Download it as a zip, import it to GitHub, test themes and plugins on the fly... All while being &lt;strong&gt;safe&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you first start using WordPress Playground, you'll be provided with a separate space where you can create and customize your own WordPress website. This space is completely isolated from your actual website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1FxhiVxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media1.tenor.com/m/mDGwkDSItD4AAAAC/playground.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1FxhiVxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media1.tenor.com/m/mDGwkDSItD4AAAAC/playground.gif" alt="Playground fun" width="498" height="278"&gt;&lt;/a&gt;&lt;/p&gt;
You and your fellow dev destroying the WP site without consecuences



&lt;p&gt;Web applications like WordPress have long-relied on server technologies to run logic and to store data.&lt;/p&gt;

&lt;p&gt;Using those technologies has meant either running an web server connected to the internet or using those technologies in a desktop service or app (sometimes called a "WordPress local environment") that either leans on a virtual server with the technologies installed or the underlying technologies on the current device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playground&lt;/strong&gt; is a novel way &lt;strong&gt;to stream server technologies&lt;/strong&gt; -- and WordPress (and WP-CLI) -- &lt;strong&gt;as files that can then run in the browser&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbygl49hvr0fg5sszczgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbygl49hvr0fg5sszczgr.png" alt="First look at the playground" width="703" height="742"&gt;&lt;/a&gt;&lt;/p&gt;
Part of the configuration of the playground



&lt;p&gt;The WordPress you see when you open Playground in your browser is a WordPress that should function like any WordPress, with a** few limitations**:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network connections are disabled (will limit connections to some third-party services)&lt;/li&gt;
&lt;li&gt;Volatile, data will disappear once you leave (but you can export it!)&lt;/li&gt;
&lt;li&gt;It renders in an iframe&lt;/li&gt;
&lt;li&gt;PHP code and wp-cli commands are ran via &lt;a href="https://wordpress.github.io/wordpress-playground/blueprints-api/index"&gt;Blueprints&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  So, how can Playground help your projects?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd4w3midaicam4ybvmhvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd4w3midaicam4ybvmhvn.png" alt="WordCamp EU presentation for WP Playground" width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;
WordPress Playground at the WordCamp 2024



&lt;h4&gt;
  
  
  At Launch:
&lt;/h4&gt;

&lt;p&gt;Reach your clients or customers faster. Showcase your product, let users try it live, or launch it in the App Store with zero lead time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Embed interactive product demos on websites.&lt;/li&gt;
&lt;li&gt;Put a native app running WordPress in the App Store.&lt;/li&gt;
&lt;li&gt;Create new sites from Blueprints and share them with a few clicks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  At QA:
&lt;/h4&gt;

&lt;p&gt;Upgrade your QA process with the ability to &lt;strong&gt;review progress in your browser in a single click&lt;/strong&gt;. When you’re ready, push updates instantly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live preview pull requests in GitHub.&lt;/li&gt;
&lt;li&gt;Clone your site and experiment in a private sandbox.&lt;/li&gt;
&lt;li&gt;Test with different WordPress and PHP versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  At development:
&lt;/h4&gt;

&lt;p&gt;Create and learn WordPress quickly—even on mobile with no signal. Use Playground where you work best, whether that’s in the browser, Node.js, mobile apps, VS Code, or elsewhere.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install WordPress in a single click.&lt;/li&gt;
&lt;li&gt;Build a block theme in your browser and save it to GitHub.&lt;/li&gt;
&lt;li&gt;Integrate with Open AI and CLI apps to create new tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, to summarize:&lt;/p&gt;

&lt;p&gt;WordPress Playground allows you to create and customize a WordPress site on any device with a single click, no host needed. This browser-based tool provides a secure, isolated environment to work on your site, download it, or test plugins and themes instantly. While it has some limitations, like disabled network connections and temporary data storage, it offers a fast, flexible solution for showcasing products, enhancing QA processes, and accelerating development. Whether for demos, app integration, or learning, Playground streamlines WordPress management and development directly in your browser.&lt;/p&gt;

&lt;p&gt;And you can go a play around at:&lt;br&gt;
&lt;a href="https://playground.wordpress.net/"&gt;https://playground.wordpress.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github&lt;/strong&gt;: &lt;a href="https://github.com/WordPress/wordpress-playground"&gt;https://github.com/WordPress/wordpress-playground&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Documentation&lt;/strong&gt;: &lt;a href="https://wordpress.github.io/wordpress-playground/"&gt;https://wordpress.github.io/wordpress-playground/&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Contribute&lt;/strong&gt;: &lt;a href="https://wordpress.github.io/wordpress-playground/contributing/index/"&gt;https://wordpress.github.io/wordpress-playground/contributing/index/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>productivity</category>
      <category>cms</category>
    </item>
    <item>
      <title>Develop your WordPress themes and plugins on Docker</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Wed, 30 Dec 2020 14:30:24 +0000</pubDate>
      <link>https://dev.to/brownio/develop-your-wordpress-themes-and-plugins-on-docker-5b56</link>
      <guid>https://dev.to/brownio/develop-your-wordpress-themes-and-plugins-on-docker-5b56</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;It's been a long time since I wrote my last post. I've been through a lot of changes, both dev-related (new job ✨) and in life.&lt;/p&gt;

&lt;p&gt;As I'm expecting to encounter some WordPress work during my new path, I decided to do it in the most comfortable and efficient way. I started to learn Docker not so long ago, and I think it's time to move the WP-Homestead setup to the shelf so my dev life gets even easier than before.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/YqR8igkpXdtJKobl6f/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/YqR8igkpXdtJKobl6f/giphy.gif" alt="New life gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tutorial is made for those who want to develop anything related to WordPress on any OS without suffering with Homestead or XAMP/LAMP/WAMP/whateverAMP stuff. It also will work as an introduction to the uses of Docker.&lt;/p&gt;

&lt;p&gt;So, first of all, why would you want to use Docker to develop WordPress?&lt;/p&gt;

&lt;p&gt;Well, by following this post, you can &lt;strong&gt;setup and run any WordPress environment with just one file and one command&lt;/strong&gt;. Actually, the TL;DR of this post would be this simple if you already have Docker installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the wp-content folder from your repo.&lt;/li&gt;
&lt;li&gt;Add a docker-compose.yml file to the directory you want to work with.&lt;/li&gt;
&lt;li&gt;Run docker-compose up -d .&lt;/li&gt;
&lt;li&gt;Visit localhost:8000, done, WP is up &amp;amp; running.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are going straight into battle, so I won't stop with the "what is ...?". I'll just add a link so you can read it if interested.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=_dfLOzuIg2o" rel="noopener noreferrer"&gt;Click me if you want to know what Docker is!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, let's start.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to install Docker
&lt;/h1&gt;

&lt;p&gt;First of all, we've got to &lt;strong&gt;download it&lt;/strong&gt;. You can do this in one of the following pages. I'll be following Windows, which is pretty similar to the Mac one. Don't worry if you get lost, everything is perfectly explained in the documentation of the websites below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.docker.com/docker-for-windows/install/" rel="noopener noreferrer"&gt;For Windows&lt;/a&gt;, &lt;a href="https://docs.docker.com/docker-for-mac/install/" rel="noopener noreferrer"&gt;Mac&lt;/a&gt;, &lt;a href="https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/" rel="noopener noreferrer"&gt;Ubuntu&lt;/a&gt;, &lt;a href="https://docs.docker.com/engine/installation/linux/docker-ce/debian/" rel="noopener noreferrer"&gt;Debian&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/FaKV1cVKlVRxC/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/FaKV1cVKlVRxC/giphy.gif" alt="Docker installed"&gt;&lt;/a&gt;&lt;/p&gt;
This is Docker saying hello to your system.



&lt;p&gt;Once we finish the installation, which is a simple Next, Next, Next, Finish one, it is recommended to &lt;strong&gt;restart the system&lt;/strong&gt;. Once we've done it, we can access now to our Docker app, or run docker info to check everything is fine. &lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqzbfibt7t4amqhtdtcgb.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqzbfibt7t4amqhtdtcgb.png" alt="Our Docker Desktop App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up WordPress
&lt;/h1&gt;

&lt;p&gt;Perfect, now that we have Docker ready to work, it's time to set-up our WordPress site. For testing purposes, I'll be doing (and also recommend this for first-timers) a setup with a fresh and clean WordPress site, which you can get &lt;a href="https://wordpress.org/download/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Unzip it, and we can continue. If you for example want to work with an existent &lt;code&gt;wp-content&lt;/code&gt; folder from a repo, it is also possible. In this case, the directory should look like this:&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjhl6upe034uvh2fvwv6o.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjhl6upe034uvh2fvwv6o.png" alt="Our directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Preparing the environment
&lt;/h1&gt;

&lt;p&gt;Did you notice the &lt;code&gt;docker-compose.yml&lt;/code&gt; file in the last image? Great. This is the file we will have to create in order to make everything work between Docker and WordPress. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/2ihmHH6pzBDYBWmglu/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/2ihmHH6pzBDYBWmglu/giphy.gif" alt="Synch gif"&gt;&lt;/a&gt;Your Docker &amp;amp; WordPress working together smoothly&lt;/p&gt;

&lt;p&gt;So, once we have created this file INSIDE the directory we want to work with (in this case, the wp-content directory) we are going to add this to the file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     volumes:
       - .:/var/www/html/wp-content
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
volumes:
  db_data: {}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;A little bit of explanation here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We've got two &lt;strong&gt;services&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;One for the database &lt;strong&gt;db&lt;/strong&gt; and one for our WordPress &lt;strong&gt;wordpress&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;They use an &lt;strong&gt;image&lt;/strong&gt;, which will decide which version of database and wordpress are we using, in this case, MySQL 5.7 and the latest WP version.&lt;/li&gt;
&lt;li&gt;We can also set up the &lt;strong&gt;environment&lt;/strong&gt; to decide which passwords and database names are we using.&lt;/li&gt;
&lt;li&gt;With &lt;strong&gt;ports&lt;/strong&gt;, we decide on which port our app will be running&lt;/li&gt;
&lt;li&gt;And finally we have &lt;strong&gt;volumes&lt;/strong&gt;. Here, we decide which of our folders will be copied into the docker environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this case, looking at our &lt;code&gt;wordpress: volumes&lt;/code&gt; part, we can see defined &lt;code&gt;.:/var/www/html/wp-content&lt;/code&gt;, which means: Copy this directory (.) into (:) &lt;code&gt;/var/www/html/wp-content&lt;/code&gt; inside our Docker container.&lt;/p&gt;

&lt;p&gt;By doing this, we can &lt;strong&gt;edit anything in our editor, and it will be copied in our container&lt;/strong&gt;, so we can visualize every change we make.&lt;/p&gt;

&lt;p&gt;Save it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/h7u3pLvYK3HfQ4yXxW/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/h7u3pLvYK3HfQ4yXxW/giphy.gif" alt="So close gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Running our environment
&lt;/h1&gt;

&lt;p&gt;Well, this is pretty straightforward. Just run &lt;code&gt;docker-compose up -d&lt;/code&gt;  on the folder directory through a terminal, and a container will be created and started.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Output: 

PS C:\Users\brownioDEV\Desktop\WP_Docker_DEVTO\wp-content&amp;gt; docker-compose up -d
Creating network "wp-content_default" with the default driver
Creating wp-content_db_1 ... done
Creating wp-content_wordpress_1 ... done


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, if we access our Docker Desktop App, we'll see this.&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8bkwmvgxguzljh99j6j1.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8bkwmvgxguzljh99j6j1.png" alt="Our Docker container running"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This means everything is good to go, so, if you access now to &lt;code&gt;http://localhost:8000/&lt;/code&gt;, you'll be redirected to your WordPress installation site, and once you finish, you can now work on anything you want!&lt;/p&gt;

&lt;p&gt;Next time you want to run your environment, you just need to click the Play button on the Docker App, and everything will be up!&lt;/p&gt;

&lt;p&gt;You can follow me so you are tuned to whenever I post something through my &lt;a href="https://twitter.com/brownio_" rel="noopener noreferrer"&gt;Twitter account&lt;/a&gt;. Hope you liked it, and enjoy the festivities!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1jkVi22T6iUrQJUNqk/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1jkVi22T6iUrQJUNqk/giphy.gif" alt="bye"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>docker</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Is the Front-End community better than the Back-End community?</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Tue, 21 Apr 2020 16:52:32 +0000</pubDate>
      <link>https://dev.to/brownio/is-the-front-end-community-better-than-the-back-end-community-1e5b</link>
      <guid>https://dev.to/brownio/is-the-front-end-community-better-than-the-back-end-community-1e5b</guid>
      <description>&lt;p&gt;I know, I know, this is one of those click-bait titles you can see on YouTube.&lt;/p&gt;

&lt;p&gt;Before everyone starts yelling, let me explain this.&lt;/p&gt;

&lt;p&gt;I've been in the Web Development industry for a few years. Started 100% knee-deep in Front-end and everything seemed to be cool, sparky, flawless and there were a lot of "dev influencers" around the net creating videos, courses, etc... &lt;/p&gt;

&lt;p&gt;It was almost impossible not to make someone think "I should become a React/Vue Developer".&lt;/p&gt;

&lt;p&gt;Now that I've dug a lot more into back-end —to the point that I'm thinking about staying there—, I feel some kind of disappointment when I look at social media like Twitter, Dev.to or local events and don't really feel the "hype" I saw in front-end.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do you think the same?&lt;/li&gt;
&lt;li&gt;Do you think there is an important difference between those two worlds?&lt;/li&gt;
&lt;li&gt;Could you recommend any resources for those who feel the same?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please, let me know in the comments!&lt;/p&gt;

&lt;p&gt;Cover illustration by &lt;a href="https://twitter.com/WilliamErhel" rel="noopener noreferrer"&gt;William Erhel&lt;/a&gt; &amp;amp; &lt;a href="https://twitter.com/bluecoders/" rel="noopener noreferrer"&gt;BlueCoders&lt;/a&gt;&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffq0l8nj88hries5v5a0h.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffq0l8nj88hries5v5a0h.png" alt="Illustration"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>healthydebate</category>
      <category>career</category>
    </item>
    <item>
      <title>I just want to be a Golang developer - How to get started</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Mon, 16 Mar 2020 17:44:43 +0000</pubDate>
      <link>https://dev.to/brownio/i-just-want-to-be-a-golang-developer-how-to-get-started-e46</link>
      <guid>https://dev.to/brownio/i-just-want-to-be-a-golang-developer-how-to-get-started-e46</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;I've been searching almost everywhere to find some good resources to learn Go, and I just realized that there wasn't much information about it! So, what a better way to learn new things than reviewing resources to teach others.&lt;/p&gt;

&lt;p&gt;But first, allow me to introduce myself: I'm Antonio (Tony, Tonio, Anto, many other variants allowed...), a Ruby on Rails developer for almost a year, after one and a half years of WordPress and other front-end tasks. I wanted to do something new, something that could teach me how to improve in other fields of programming and would be fun at the same time. That leaves us with the big first question...&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fls2otyqir0wlr4gahnur.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fls2otyqir0wlr4gahnur.gif" alt="Le'go"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why would I learn GO?
&lt;/h1&gt;

&lt;p&gt;Let's start with the basics, in case you haven't decided yet if this language is really for you.&lt;/p&gt;

&lt;p&gt;First of all, Go is an open-source programming language. It's &lt;a href="https://hackernoon.com/i-finally-understand-static-vs-dynamic-typing-and-you-will-too-ad0c2bd0acc7" rel="noopener noreferrer"&gt;statically typed&lt;/a&gt; and produces compiled machine code binaries (an executable, just like Java). If you need a comparison, people say that Go it's the &lt;em&gt;"new age C"&lt;/em&gt; speaking of syntax (fear not, it's pretty easy on the eyes).&lt;/p&gt;

&lt;p&gt;It was introduced back in 2009, and it's now (16/03/2020) in version 1.14.&lt;/p&gt;

&lt;p&gt;It's main characteristics are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ease of use together with state-of-the-art productivity.&lt;/li&gt;
&lt;li&gt;High-level efficiency along with static typing.&lt;/li&gt;
&lt;li&gt;Advanced performance for networking and the full use of multi-core power.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And you may be wondering what you can do with Go, well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can create websites.&lt;/li&gt;
&lt;li&gt;You can de IoT stuff.&lt;/li&gt;
&lt;li&gt;You can do Desktop Software.&lt;/li&gt;
&lt;li&gt;You can do... &lt;a href="https://github.com/avelino/awesome-go" rel="noopener noreferrer"&gt;eveything.&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/dt0hE9OmRi0j5R1LRf/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/dt0hE9OmRi0j5R1LRf/giphy.gif" alt="So powerful"&gt;&lt;/a&gt;So damn powerful.&lt;/p&gt;

&lt;p&gt;Aren't you interested yet? You can read more about it on this &lt;a href="https://www.upwork.com/hiring/development/golang-programming-language/" rel="noopener noreferrer"&gt;website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are, please keep reading, as there is a lot to know.&lt;/p&gt;

&lt;h1&gt;
  
  
  How do I learn GO?
&lt;/h1&gt;

&lt;p&gt;First, you need to know the basics of the language, and for that, I truly recommend doing the &lt;a href="https://tour.golang.org/welcome/1" rel="noopener noreferrer"&gt;Go Tour&lt;/a&gt;.&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t03o8q1j8g5rcfksnao.JPG" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t03o8q1j8g5rcfksnao.JPG" alt="A Go Tour webpage example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On this tutorial made by the creators of Golang, you will get through all the content that makes Go what it really is. &lt;strong&gt;All of its main features you need to know&lt;/strong&gt; to start doing stuff. Slices, Goroutines, Channels, Structs... but worry not, those concepts may sound pretty weird, but if you have a software background, you will notice that everything else is pretty much the same as other languages (&lt;strong&gt;and even easier!&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;After you've done this, you may want to set up an environment on your computer. &lt;/p&gt;

&lt;h1&gt;
  
  
  How do I install GO?
&lt;/h1&gt;

&lt;p&gt;If so, you should follow the steps &lt;a href="https://golang.org/doc/install" rel="noopener noreferrer"&gt;here&lt;/a&gt;. No matter what OS you have on your computer, Go works everywhere!&lt;/p&gt;

&lt;p&gt;I do recommend VSCode to work with Golang. You'll get a lot of useful tools &lt;a href="https://github.com/Microsoft/vscode-go/wiki/Go-tools-that-the-Go-extension-depends-on" rel="noopener noreferrer"&gt;recommended by the editor itself&lt;/a&gt; when you start coding with the language. A linter, snippets, etc... &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/VgeGEVTdwzZao/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/VgeGEVTdwzZao/giphy.gif" alt="Teamwork!"&gt;&lt;/a&gt;&lt;/p&gt;
Thanks VSCode team!



&lt;p&gt;You also have the JetBrains option, &lt;a href="https://www.jetbrains.com/go/" rel="noopener noreferrer"&gt;GoLand&lt;/a&gt;, if you want and can afford it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Something to read, so I can improve?
&lt;/h1&gt;

&lt;p&gt;Before we dive deeper into recommendations for Go, you should check some of these books out if you think you need more knowledge of the language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.golang-book.com/books/intro" rel="noopener noreferrer"&gt;An introduction to Programming in Go&lt;/a&gt; - A must if you are new to programming and you want to start with Go.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/" rel="noopener noreferrer"&gt;Build Web Applications with Go&lt;/a&gt; - if you want to get into Web Development with Go.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/pazams/go-for-javascript-developers" rel="noopener noreferrer"&gt;Go for Javascript Developers&lt;/a&gt; - In case you already know JS, this may help you learn Go faster!&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dariubs/GoBooks" rel="noopener noreferrer"&gt;More recommended books here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/RZnTaU1aKBjJm/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/RZnTaU1aKBjJm/giphy.gif" alt="Read please"&gt;&lt;/a&gt;&lt;/p&gt;
But please wait until COVID-19 goes away!



&lt;p&gt;Okay, I feel that you now have enough resources to create your own path into Golang, but you need something to practice, so... what about some &lt;em&gt;exercises&lt;/em&gt;?&lt;/p&gt;

&lt;h1&gt;
  
  
  What about learning by doing?
&lt;/h1&gt;

&lt;p&gt;You don't need to make every exercise or watch every video you see here, but they may help you develop your programming skills and Golang knowledge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gophercises
&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%2Fgophercises.com%2Fimg%2Fgophercises_logo.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%2Fgophercises.com%2Fimg%2Fgophercises_logo.png" alt="Gophercises logo"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gophercises.com/" rel="noopener noreferrer"&gt;Gophercises&lt;/a&gt; is a free course that will help you become more familiar with Go while developing your skills as a programmer. In the course, we will build roughly 20 different mini-applications, packages, and tools that are each designed to teach you something different.&lt;/p&gt;

&lt;h2&gt;
  
  
  JustForFunc
&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8recy2iolramsjs5b8y8.JPG" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8recy2iolramsjs5b8y8.JPG" alt="JustForFunc Channel"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/channel/UC_BzFbxG2za3bp5NRRRXJSw/" rel="noopener noreferrer"&gt;JustForFunc&lt;/a&gt; also used to upload tons of videos about Go new features and tutorials, so be sure to check them out!&lt;/p&gt;

&lt;p&gt;Other resources of interest: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://quii.gitbook.io/learn-go-with-tests/" rel="noopener noreferrer"&gt;Learn Go with tests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And last, but not least.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do a project of your own!
&lt;/h2&gt;

&lt;p&gt;There are a lot of options around there. Maybe find something that you've always wanted to have, or some simple application that you think is missing something, and create it again.&lt;/p&gt;

&lt;p&gt;I started with a To-Do list on console and an HTTP server to serve my own website. Keep it simple at first, we don't want you to get suffocated! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/VIEngKb5u48e35Lxp4/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/VIEngKb5u48e35Lxp4/giphy.gif" alt="Do it yourself!"&gt;&lt;/a&gt;&lt;/p&gt;
DIY!



&lt;p&gt;Here you have a curated list of awesome Go frameworks, libraries and software &lt;a href="https://awesome-go.com/" rel="noopener noreferrer"&gt;Awesome Go&lt;/a&gt;, so you can experiment with whatever you want to first.&lt;/p&gt;

&lt;p&gt;If you are into web development (as I am), I can recommend you &lt;a href="https://gin-gonic.com/" rel="noopener noreferrer"&gt;Gin Gonic&lt;/a&gt;, a web framework to have a pleasant journey creating a website of your own (even though, I recommend you to do it without framework if this is your first time using Go).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/Xj1GHC7mXPquY/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/Xj1GHC7mXPquY/giphy.gif" alt="The end"&gt;&lt;/a&gt;&lt;/p&gt;
Nothing at all.



&lt;p&gt;And... I think we can stop it for the day. There is a lot to speak about regarding Go, but I think that the basics are covered in this post, so you can start experimenting with Go. Thanks for reading, and please, if you liked it, let me know, so I keep bringing content to this awesome community.&lt;/p&gt;

&lt;p&gt;You can follow me so you are tuned to whenever I post something through my &lt;a href="//twitter.com/brownio_"&gt;Twitter &lt;/a&gt; account, hope you liked it!&lt;/p&gt;

&lt;p&gt;There are no limits... &lt;em&gt;Go&lt;/em&gt; in and play!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>go</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Useful "advanced" commands in 2 minutes - Git Bisect</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Tue, 10 Mar 2020 13:16:29 +0000</pubDate>
      <link>https://dev.to/brownio/useful-advanced-commands-in-2-minutes-git-bisect-2f3</link>
      <guid>https://dev.to/brownio/useful-advanced-commands-in-2-minutes-git-bisect-2f3</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;Welcome to Useful "advanced" commands in 2 minutes. Let's be quick about this. Have you ever introduced a bug, and noticed 5 commits after, without knowing where did you put added that bug to the code?&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;git bisect&lt;/strong&gt; will help you (a lot!).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/l0HU2DVgTzcuh2WT6/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/l0HU2DVgTzcuh2WT6/giphy.gif" alt="Let's GO"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, how does this work?:&lt;/p&gt;

&lt;p&gt;First, you need to go to the last commit where you have this bug present somewhere around the code, let's say you are in the &lt;em&gt;master&lt;/em&gt; branch.&lt;/p&gt;

&lt;p&gt;Then you are going to write in your console:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git bisect start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Nothing will happen after you tell the system the hash of the commit that has the error, by saying: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git bisect bad hashofthebadcommitas489sf0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and you also need to tell the system a commit where the code was working as expected, like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git bisect good hashofthegoodcommiteoiwi30ea&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Bisect then will prompt a message like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Bisecting: 3 revisions left to test after this (roughly 2 steps)&lt;br&gt;
[cc6a1e3f00cf5360c3bae687fdcf21f1c111accd] Commit message that you wrote&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, it's time to test, go to that part of the website/app where you have the error, and check whether you still have the error or not.&lt;/p&gt;

&lt;p&gt;If you don't have the error, you will write &lt;code&gt;git bisect good&lt;/code&gt;, if you DO have the error, write &lt;code&gt;git bisect bad&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/lzjFRULTTw8mY/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/lzjFRULTTw8mY/giphy.gif" alt="Bad boy bisect"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you choose one of these options, git bisect will automatically checkout to another commit, where you'll have to do the check again, is everything good? bisect good, else, bisect bad.&lt;/p&gt;

&lt;p&gt;Until you reach the last possible commit to check, where, after you make the last decision, git will tell you this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ed4d268d1ec7039bc6b5e4ee7c4ce28sbc3af30 is the first bad commit&lt;br&gt;
commit ed4d268d1ec7039bc6b5e4ee7c4ce28sbc3af30&lt;br&gt;
Author: Antonio Djigo &amp;lt;antonio@greatest-developer.eu&amp;gt;&lt;br&gt;
Date:   Tue Mar 10 11:59:06 2020 +0000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Add new functionality where for sure I won't break anything&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And there you have it! Now you know which commit was the first one that introduced the bug, so you can fix it ASAP!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3orieUe6ejxSFxYCXe/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3orieUe6ejxSFxYCXe/giphy.gif" alt="Ahá!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can follow me so you are tuned to whenever I post something through my &lt;a href="//twitter.com/brownio"&gt;Twitter&lt;/a&gt; account, hope you liked it!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>debugging</category>
    </item>
    <item>
      <title>Resources to learn Golang by doing?</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Thu, 05 Mar 2020 17:10:23 +0000</pubDate>
      <link>https://dev.to/brownio/resources-to-learn-golang-by-doing-1chm</link>
      <guid>https://dev.to/brownio/resources-to-learn-golang-by-doing-1chm</guid>
      <description>&lt;p&gt;Hello! I'm posting this because I'm looking for a resource to learn go by doing a guided project. Just like you can do with the &lt;a href="https://www.railstutorial.org/"&gt;The Ruby on Rails tutorial&lt;/a&gt; by Michael Hartl.&lt;/p&gt;

&lt;p&gt;Do you know any?&lt;/p&gt;

&lt;p&gt;I found &lt;a href="https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/index.html?ref=hackr.io"&gt;this one&lt;/a&gt;, but last time it was updated was 2 years ago...&lt;br&gt;
Any other resources are also welcome. 👀✨&lt;/p&gt;

</description>
      <category>help</category>
      <category>go</category>
    </item>
    <item>
      <title>Beautiful Controllers - Growing Rails applications in practice</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Wed, 04 Mar 2020 12:26:54 +0000</pubDate>
      <link>https://dev.to/brownio/beautiful-controllers-growing-rails-applications-in-practice-4mg9</link>
      <guid>https://dev.to/brownio/beautiful-controllers-growing-rails-applications-in-practice-4mg9</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;I've been reading through a book called &lt;a href="https://pragprog.com/book/d-kegrap/growing-rails-applications-in-practice"&gt;Growing Rails Applications in practice&lt;/a&gt; and I decided to make a summary to get a better understanding of every chapter. Maybe it also works for you!&lt;/p&gt;

&lt;p&gt;Normally, the developer does not struggle to learn about what a View or a Model is. &lt;strong&gt;But what about the controllers?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the major problems of dealing with them?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It's often hard to decide if the logic goes into the controller or in the model.&lt;/li&gt;
&lt;li&gt;Normally, sharing code between the model and the screen requires too much code.&lt;/li&gt;
&lt;li&gt;Tested controller's code is hard to test and experiment with because of the parameters, sessions, requests etc they need.&lt;/li&gt;
&lt;li&gt;Without a design guide to follow, it is hard to find two controllers that look alike, making it a pain to recognize who every controller work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We cannot get rid of them, but, by following simple guidelines, we can extract business logic out of the controllers, and take them to a better place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consistent controller design
&lt;/h2&gt;

&lt;p&gt;It is important to have a standardized controller design. A developer who has to learn how to manage a new system every time he/she edits a controller file won't be happy. A lot of time will be spent here by doing this.&lt;/p&gt;

&lt;p&gt;By &lt;strong&gt;reducing the variability in our controllers&lt;/strong&gt;, we will improve our fellow developers' mental health. Wouldn't it be awesome that, by having a default design, you could focus exactly on what you want to do, and in the other parts of the system?&lt;/p&gt;

&lt;p&gt;Also, the development speed of new controllers would be improved. You would only decide to use &lt;a href="https://www.codecademy.com/articles/what-is-crud"&gt;CRUD&lt;/a&gt;, and move to the parts you really care about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Normalizing user interactions
&lt;/h2&gt;

&lt;p&gt;How could you come up with a default controller design when your site has a lot of different user interactions? A good way to manage this would be to reduce every interaction to a CRUD controller, even if you feel that it's not necessarily a typical CRUD interface (at first).&lt;/p&gt;

&lt;p&gt;Every interaction can be modelled as a CRUD. You may have a controller that manages a subscription. Why not DESTROY a subscription instead of cancelling it? Or CREATING it instead of activating a new subscription?&lt;/p&gt;

&lt;p&gt;By normalizing every user interaction to a CRUD interaction, we can design a beautiful controller layout and reuse it again and again with little changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  A better controller implementation
&lt;/h2&gt;

&lt;p&gt;How should a controller truly be? We have seen many unloved controllers during our careers.&lt;/p&gt;

&lt;p&gt;Let me give you some hints.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They should be short, &lt;a href="https://thevaluable.dev/dry-principle-cost-benefit-example/"&gt;DRY&lt;/a&gt; and easy to read.&lt;/li&gt;
&lt;li&gt;Controllers should provide the minimum amount of glue code as possible. (No intermediary code between a request and a model)&lt;/li&gt;
&lt;li&gt;Always follow the standard design, unless there is a truly good reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good way to do this is by creating an standart implementation of a controller that CRUDS an ActiveRecord class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NotesController&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationController&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;
    &lt;span class="n"&gt;load_notes&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;show&lt;/span&gt;
    &lt;span class="n"&gt;load_note&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;new&lt;/span&gt;
    &lt;span class="n"&gt;build_note&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create&lt;/span&gt;
    &lt;span class="n"&gt;build_note&lt;/span&gt;
    &lt;span class="n"&gt;save_note&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="s1"&gt;'new'&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;edit&lt;/span&gt;
    &lt;span class="n"&gt;load_note&lt;/span&gt;
    &lt;span class="n"&gt;build_note&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;
    &lt;span class="n"&gt;load_note&lt;/span&gt;
    &lt;span class="n"&gt;build_note&lt;/span&gt;
    &lt;span class="n"&gt;save_note&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="s1"&gt;'edit'&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;destroy&lt;/span&gt;
    &lt;span class="n"&gt;load_note&lt;/span&gt;
    &lt;span class="vi"&gt;@note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;destroy&lt;/span&gt;
    &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="n"&gt;notes_path&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="c1"&gt;# The controller actions are delegating most of their work to helper methods like load_note or build_note. This will make our code DRY and it will be easier to change the behaviour of multiple actions by just editing our helper method.&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;load_notes&lt;/span&gt;
    &lt;span class="vi"&gt;@notes&lt;/span&gt; &lt;span class="o"&gt;||=&lt;/span&gt; &lt;span class="n"&gt;note_scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_a&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;load_note&lt;/span&gt;
    &lt;span class="vi"&gt;@note&lt;/span&gt; &lt;span class="o"&gt;||=&lt;/span&gt; &lt;span class="n"&gt;note_scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;build_note&lt;/span&gt;
    &lt;span class="vi"&gt;@note&lt;/span&gt; &lt;span class="o"&gt;||=&lt;/span&gt; &lt;span class="n"&gt;note_scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;
    &lt;span class="vi"&gt;@note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attributes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;note_params&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;save_note&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;
      &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="vi"&gt;@note&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;note_params&lt;/span&gt;
    &lt;span class="n"&gt;note_params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:note&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;note_params&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;note_params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;permit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:published&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="c1"&gt;# note_params will allow us to only give access to those parameters we want the user to edit&lt;/span&gt;
  &lt;span class="c1"&gt;# authorization does not belong in a model, as no users should interact with data in there.&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;note_scope&lt;/span&gt;
    &lt;span class="no"&gt;Note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="c1"&gt;# This note_scope method is used by every CRUD action. &lt;/span&gt;
  &lt;span class="c1"&gt;# It loads a Note with a given ID, or to load the list of all notes at the index method.&lt;/span&gt;
  &lt;span class="c1"&gt;# By having this guard access to the Model, we have a central place that tells exactly which records the controller can show.&lt;/span&gt;
  &lt;span class="c1"&gt;# We could limit this, for example, to only display specific user notes, just by changing the query we make to the model.&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why have controllers at all?
&lt;/h2&gt;

&lt;p&gt;By doing this, we are creating a simple and consistent controller design that pushes a lot of code into the model. So, why have controllers? &lt;/p&gt;

&lt;p&gt;There are several responsibilities that belong in a controller.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security (authentication, authorization)&lt;/li&gt;
&lt;li&gt;Parsing and white-listing parameters&lt;/li&gt;
&lt;li&gt;Loading or instantiating the model&lt;/li&gt;
&lt;li&gt;Deciding which view to render&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that a controller never does the heavy lifting. They should contain as less amount of glue code as possible. 👀 ✨&lt;/p&gt;

&lt;p&gt;You can follow me so you are tuned to whenever I post something through my &lt;a href="https://twitter.com/brownio_"&gt;Twitter account&lt;/a&gt;, hope you liked it!&lt;/p&gt;

</description>
      <category>rails</category>
      <category>ruby</category>
      <category>webdev</category>
      <category>codequality</category>
    </item>
    <item>
      <title>A pattern a day keeps the reviewers away - [Day 6] - Adapter Pattern</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Mon, 17 Feb 2020 14:39:16 +0000</pubDate>
      <link>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-6-adapter-pattern-cp1</link>
      <guid>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-6-adapter-pattern-cp1</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;It's been 7 days already, that's totally a new achievement! I hope both you and I are learning &lt;strong&gt;a lot&lt;/strong&gt; from these posts, and please, do not hesitate to contact me with your ideas and constructive criticism to make these post better and better!&lt;/p&gt;

&lt;p&gt;Well, let's get started:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o8doT5DaMjfH3paHC/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o8doT5DaMjfH3paHC/giphy.gif" alt="Unleash the post gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The first day of a new week, and it's the turn for another design pattern, one that you may find really obvious, but also one that is not as used at it should be. Today, I'll be writing about the &lt;strong&gt;Adapter Controller&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's get in context. You may have worked before with some APIs that give you a lot of data in many &lt;em&gt;different ways and shapes&lt;/em&gt;. Maybe you also had to transform this data and send it to a website, or a chart, or a PDF... Many options here.&lt;/p&gt;

&lt;p&gt;Once you try to send the data for your first time, you notice that the service where you are sending the information &lt;em&gt;needs your data in a specific format and type&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here is where the &lt;strong&gt;Adapter Design Pattern&lt;/strong&gt; gets into action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b1x5Psyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media1.tenor.com/images/8c06adfbb313a6f2d9632ce8cd4ff708/tenor.gif%3Fitemid%3D10468556" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b1x5Psyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media1.tenor.com/images/8c06adfbb313a6f2d9632ce8cd4ff708/tenor.gif%3Fitemid%3D10468556" alt="Improvise, Adapt, Overcome GIF" width="498" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This pattern functionality is pretty basic, you may have already realized how does it work. Is just the same logic as an electricity adapter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G5QcfW7r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i1.wp.com/www.javagists.com/wp-content/uploads/2018/01/adapter-Example.png%3Fssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G5QcfW7r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i1.wp.com/www.javagists.com/wp-content/uploads/2018/01/adapter-Example.png%3Fssl%3D1" alt="A computer factory diagram" width="688" height="410"&gt;&lt;/a&gt;&lt;/p&gt;
Diagram from https://www.javagists.com/adapter-design-pattern



&lt;p&gt;What should you have in mind when working with Adapters?:&lt;/p&gt;

&lt;p&gt;Well, there isn't much to say here. You'll always need to have in mind that &lt;strong&gt;the data transformation it's made inside the Adapter Class&lt;/strong&gt;, and it will send it to the object that requested this information. It should be &lt;em&gt;between&lt;/em&gt; the sender and the requester.&lt;/p&gt;

&lt;p&gt;Want to know more about how to implement this pattern? &lt;a href="https://refactoring.guru/design-patterns/adapter#checklist"&gt;Click here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By following these simple rules, everything will fit together and you won't have to worry about that weird information that comes from that 0.1-alpha API you found.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/gqHpvjKG5me9W/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/gqHpvjKG5me9W/giphy.gif" alt="Perfect fit gif" width="418" height="265"&gt;&lt;/a&gt;&lt;/p&gt;
Perfect fit!






&lt;p&gt;And this is my sixth post about design patterns for the series "A pattern a day keeps the reviewers away".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif" alt="Bye!" width="306" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'll try&lt;/strong&gt; to keep posting every day one of the different patterns that are around. I can't promise I'll fulfil this task every day though!&lt;/p&gt;

&lt;p&gt;You can read more about this pattern at:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://refactoring.guru/design-patterns/adapter"&gt;Refactoring Guru&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sourcemaking.com/design_patterns/adapter"&gt;Sourcemaking&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also, you can follow me so you are tuned to whenever I post something through my &lt;a href="//twitter.com/brownio_"&gt;Twitter&lt;/a&gt; account! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>codequality</category>
    </item>
    <item>
      <title>#KnowYourWorth - Are you really being valued?</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Sat, 15 Feb 2020 11:29:59 +0000</pubDate>
      <link>https://dev.to/brownio/knowyourworth-are-you-really-being-valued-23dl</link>
      <guid>https://dev.to/brownio/knowyourworth-are-you-really-being-valued-23dl</guid>
      <description>&lt;p&gt;During the past days, a new trending hashtag appeared on Twitter, calling to all the devs/designers around the world to mention what do they earn, what did they study, and for how long have they been working in the software/design sector.&lt;/p&gt;

&lt;p&gt;You can spot things like this: &lt;/p&gt;




&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1228247484591476736-543" src="https://platform.twitter.com/embed/Tweet.html?id=1228247484591476736"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1228247484591476736-543');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1228247484591476736&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1228341690362191874-87" src="https://platform.twitter.com/embed/Tweet.html?id=1228341690362191874"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1228341690362191874-87');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1228341690362191874&amp;amp;theme=dark"
  }



&lt;/p&gt;




&lt;p&gt;But there are also many several case where you see &lt;strong&gt;totally the opposite&lt;/strong&gt;, like:&lt;/p&gt;




&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1228465847661887488-21" src="https://platform.twitter.com/embed/Tweet.html?id=1228465847661887488"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1228465847661887488-21');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1228465847661887488&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;or, well, myself:&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1228602383363706880-809" src="https://platform.twitter.com/embed/Tweet.html?id=1228602383363706880"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1228602383363706880-809');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1228602383363706880&amp;amp;theme=dark"
  }



&lt;/p&gt;




&lt;p&gt;What concerns me the most, it is not the huge difference between salaries per country, as the expenses are different. It is, for example, that, your salary is completely worse than others in the same country. That you have to bear spending &lt;strong&gt;60%-65% of your salary only for the monthly rent&lt;/strong&gt;...&lt;/p&gt;

&lt;p&gt;You can more about my rant here: &lt;iframe class="tweet-embed" id="tweet-1228627734823305216-284" src="https://platform.twitter.com/embed/Tweet.html?id=1228627734823305216"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1228627734823305216-284');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1228627734823305216&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is your situation?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;What do you think?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Do you need help?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let us know in the comments, or &lt;a href="https://twitter.com/brownio_"&gt;Twitter&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Want to share your state? Here you have a template:&lt;/p&gt;

&lt;p&gt;🏫: Studies&lt;br&gt;
⏳: Experience&lt;br&gt;
🏷: Role&lt;br&gt;
🌎: Country / City&lt;br&gt;
💸: Salary&lt;/p&gt;

&lt;p&gt;A user I don't know (if you do, please share), created &lt;a href="https://docs.google.com/spreadsheets/d/1Ukk1I_voBALZrBNznMfCLF6QMIlEdROdv06T3zdIppg/edit#gid=0"&gt;this spreadsheet&lt;/a&gt; with many of the salaries posted, in case you are curious.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>rant</category>
    </item>
    <item>
      <title>A pattern a day keeps the reviewers away - [Day 5] - Abstract Factory Pattern</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Fri, 14 Feb 2020 17:02:30 +0000</pubDate>
      <link>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-5-abstract-factory-pattern-20d0</link>
      <guid>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-5-abstract-factory-pattern-20d0</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;During the past few months, I've been working on a back-end project made with Ruby on Rails. Last year I was working as a Front-End developer, I've never had the opportunity to apply design patterns almost anywhere, until now. &lt;/p&gt;

&lt;p&gt;It's a pretty useful thing, that probably every developer that works with objects should at least know and practice, and this is why I'm here, to give you (and me!) a daily short post about the different design patterns that exist (or at least, those that are used the most), with an example, and an explanation.&lt;/p&gt;

&lt;p&gt;Because doing &lt;strong&gt;good code&lt;/strong&gt; will help you, your workmates, and those who will be in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3oEdv4b54SMGgxfnTW/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3oEdv4b54SMGgxfnTW/giphy.gif" alt="Teamwork!" width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;
Do teamwork!





&lt;p&gt;Today, I'll write about a famous one. It is called the &lt;strong&gt;Abstract Factory Pattern&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's say you have a magic computer generator, where you three families, Linux, macOS, and Windows. Each one has three elements of its own, a &lt;em&gt;calculator&lt;/em&gt;, a &lt;em&gt;text editor&lt;/em&gt;, and a &lt;em&gt;terminal&lt;/em&gt;. For each machine that you are going to build, software on them must match with their OS in order to work. Also, &lt;strong&gt;you don't want to change your OS code whenever you want to add a new tool&lt;/strong&gt;, it should always support every new tool on its own!&lt;/p&gt;

&lt;p&gt;If you have felt before that you've suffered this, then you have to choose the &lt;strong&gt;Abstract Factory Pattern&lt;/strong&gt;, where you will create an &lt;em&gt;interface&lt;/em&gt; that can be &lt;strong&gt;implemented&lt;/strong&gt; on each of the OS's tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/10aADbYxnJlc9q/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/10aADbYxnJlc9q/giphy.gif" alt="A happy factory it is" width="350" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next diagram, you'll see how an Abstract Factory diagram is defined, so you get an idea of how the idea works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9bjbuh5ph0y73sqej6oa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9bjbuh5ph0y73sqej6oa.png" alt="A computer factory diagram" width="401" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things you need to have in mind when working with abstract factories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use the Abstract Factory &lt;strong&gt;when your code needs to work with various families of related products&lt;/strong&gt;, but &lt;strong&gt;you don’t want it to depend on the concrete classes of those products&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The code may become more complicated than it should be, since &lt;strong&gt;a lot of new interfaces and classes are introduced along with the pattern&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you follow the ideas raised above, you will have an amazing abstract factory ready to mass-produce.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/11E0hI5eDiCpiM/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/11E0hI5eDiCpiM/giphy.gif" alt="odly satisfying" width="438" height="271"&gt;&lt;/a&gt;&lt;/p&gt;
It will be as oddly satisfying as this gif.



&lt;p&gt;Now, you'll create new products with similar characteristics in a ✨ clean and efficient way ✨&lt;/p&gt;




&lt;p&gt;And this is my fifth article about design patterns for the series "A pattern a day keeps the reviewers away".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3ov9k1lJ0A2o4OQew8/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3ov9k1lJ0A2o4OQew8/giphy.gif" alt="Bye!" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
Wow, 5 posts. I've never expected to reach the 5 days strike 



&lt;p&gt;&lt;strong&gt;I'll try&lt;/strong&gt; to keep posting every day one of the different patterns that are around. I can't promise I'll fulfil this task every day though!&lt;/p&gt;

&lt;p&gt;You can read more about this pattern at:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://refactoring.guru/design-patterns/abstract-factory"&gt;Refactoring Guru&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sourcemaking.com/design_patterns/abstract_factory"&gt;Sourcemaking&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also, you can follow me so you are tuned to whenever I post something through my &lt;a href="//twitter.com/brownio_"&gt;Twitter&lt;/a&gt; account! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>codequality</category>
    </item>
    <item>
      <title>A pattern a day keeps the reviewers away - [Day 4] - Prototype Pattern</title>
      <dc:creator>Antonio Djigo</dc:creator>
      <pubDate>Thu, 13 Feb 2020 21:31:11 +0000</pubDate>
      <link>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-4-prototype-pattern-1aef</link>
      <guid>https://dev.to/brownio/a-pattern-a-day-keeps-the-reviewers-away-day-4-prototype-pattern-1aef</guid>
      <description>&lt;p&gt;Hey 👀✨&lt;/p&gt;

&lt;p&gt;During the past few months, I've been working on a back-end project made with Ruby on Rails. Last year I was working as a Front-End developer, I've never had the opportunity to apply design patterns almost anywhere, until now. &lt;/p&gt;

&lt;p&gt;It's a pretty useful thing, that probably every developer that works with objects should at least know and practice, and this is why I'm here, to give you (and me!) a daily short post about the different design patterns that exist (or at least, those that are used the most), with an example, and an explanation.&lt;/p&gt;

&lt;p&gt;Because doing &lt;strong&gt;good code&lt;/strong&gt; will help you, your workmates, and those who will be in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3oEdv4b54SMGgxfnTW/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3oEdv4b54SMGgxfnTW/giphy.gif" alt="Teamwork!" width="600" height="338"&gt;&lt;/a&gt;&lt;br&gt;Do teamwork!
&lt;/p&gt;




&lt;p&gt;Today, I'll write about a popular design pattern that you may have heard. It is called the &lt;strong&gt;Prototype Pattern&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Have you ever had the problem where you have one specific object that you want to &lt;strong&gt;duplicate&lt;/strong&gt; to an exact same copy? The "easy" way would be to just generate a new object with the same values over and over, but, some of those objects could have some private or protected fields that you’ll miss...&lt;/p&gt;

&lt;p&gt;Also, it’s quite ugly 🤨&lt;/p&gt;

&lt;p&gt;Feeling like you really need to get rid of this problem? Then you have to choose the &lt;strong&gt;Prototype Pattern&lt;/strong&gt;, where you will create a &lt;em&gt;prototype&lt;/em&gt; that can be &lt;strong&gt;cloned&lt;/strong&gt; with just a single method.&lt;/p&gt;

&lt;p&gt;This one is pretty easy. You just have to generate one, two, or as many variants as you need, and, when you need an exact same object, you just clone it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/dZkIlrGhw8rks/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/dZkIlrGhw8rks/giphy.gif" alt="A new clone is born" width="467" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next diagram created by &lt;a href="https://refactoring.guru/design-patterns/prototype"&gt;refactoring guru&lt;/a&gt;, you'll see how there is defined a Prototype interface. It will specify the kinds of objects to create using the subsequent prototypes, and create new objects by copying this prototype.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---fihrgnh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://refactoring.guru/images/patterns/diagrams/prototype/structure.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---fihrgnh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://refactoring.guru/images/patterns/diagrams/prototype/structure.png" alt="Prototype diagram" width="500" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things you need to have in mind when working with prototypes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use only if your code &lt;strong&gt;shouldn’t depend on the subclasses of objects that you need to copy&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Try to use it only when you have many subclasses that they are only differentiated &lt;strong&gt;by the way they are initialized&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you follow the ideas raised above, you will have an amazing factory of prototypes ready to be tested.&lt;/p&gt;

&lt;p&gt;Now, your clones production will be ✨ clean and efficient ✨&lt;/p&gt;




&lt;p&gt;And this is my fourth article about design patterns for the series "A pattern a day keeps the reviewers away".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif" alt="Bye!" width="306" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'll try&lt;/strong&gt; to keep posting every day one of the different patterns that are around. I can't promise I'll fulfil this task every day though!&lt;/p&gt;

&lt;p&gt;You can read more about this pattern at:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://refactoring.guru/design-patterns/prototype"&gt;Refactoring Guru&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sourcemaking.com/design_patterns/prototype"&gt;Sourcemaking&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also, you can follow me so you are tuned to whenever I post something through my &lt;a href="//twitter.com/brownio_"&gt;Twitter&lt;/a&gt; account! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>codequality</category>
    </item>
  </channel>
</rss>
