<?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: PixoDev</title>
    <description>The latest articles on DEV Community by PixoDev (@pixodev).</description>
    <link>https://dev.to/pixodev</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%2F303341%2Fd015c058-4950-49f3-8001-b04b0117863e.jpeg</url>
      <title>DEV Community: PixoDev</title>
      <link>https://dev.to/pixodev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pixodev"/>
    <language>en</language>
    <item>
      <title>Creating a fancy stepper component in React
</title>
      <dc:creator>PixoDev</dc:creator>
      <pubDate>Wed, 04 Nov 2020 12:43:58 +0000</pubDate>
      <link>https://dev.to/pixodev/creating-a-fancy-stepper-component-in-react-ad1</link>
      <guid>https://dev.to/pixodev/creating-a-fancy-stepper-component-in-react-ad1</guid>
      <description>&lt;p&gt;This is an Stepper made in React:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ta1eKV8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fx3tw3ozioo2pcg41929.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ta1eKV8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fx3tw3ozioo2pcg41929.gif" alt="full_stepper-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Steppers let you display content in sequential steps, they are good for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dynamically split big forms, so the user doesn’t need to fill 20000 inputs at once&lt;/li&gt;
&lt;li&gt;logically present data, for example, to understand the content in step 2 you need to see step 1 first&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this tutorial we are going to create a Stepper component in React, taking care of the usability, and we are going to create a cool and fancy one.&lt;/p&gt;

&lt;p&gt;If you don’t want to go through the tutorial, the code is in Github already, &lt;a href="https://github.com/PixoDev/fancy-stepper"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the project
&lt;/h2&gt;

&lt;p&gt;First things first, let’s create our project, we are going to create one with ‘create-react-app’ and Typescript&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-react-app fancy-stepper --template typescript&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once our project is generated:&lt;br&gt;
&lt;code&gt;cd fancy-stepper &amp;amp;&amp;amp; yarn start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your app should be running on localhost:3000&lt;/p&gt;
&lt;h2&gt;
  
  
  Preparing the component
&lt;/h2&gt;

&lt;p&gt;The next step is to create our Stepper component. Let’s go to our src directory and let’s create a file called Stepper.tsx, and we are going to create our component like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

interface StepperProps {
    // Empty right now, we will fill this in later
}

export const Stepper: React.FC&amp;lt;StepperProps&amp;gt; = () =&amp;gt; {
    return &amp;lt;&amp;gt;Nothing yet&amp;lt;/&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, go to your App.tsx file, and remove everything, then add your Stepper component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { Stepper } from './Stepper';
import './App.css';

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Stepper /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating our Stepper functionalities
&lt;/h2&gt;

&lt;p&gt;If we make a breakdown of what a Stepper can do, we can summarize it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display N steps&lt;/li&gt;
&lt;li&gt;Go to next step&lt;/li&gt;
&lt;li&gt;Go to the previous step&lt;/li&gt;
&lt;li&gt;Update the Stepper progress&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Steps
&lt;/h3&gt;

&lt;p&gt;We are going to pass steps to the stepper component using the render props pattern, let’s start creating a steps prop in our component. That prop will accept an array of objects, and each object will configure each step, let’s write our types first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";

interface StepperProps {
    steps: Step[];
}

interface Step {
    // Title of the step
    title: string;
    // Element to render in the step, can contain
    // a form, an image, whatever
    element: (stepProps:StepProps) =&amp;gt; JSX.Element;
}

export interface StepProps {
  // Here we tell the stepper to go to the next or previous step from
  // the element we are rendering
  goNextStep: () =&amp;gt; void;
  goPreviousStep: () =&amp;gt; void;
  // Tells you the active step right now
  currentStep: number;
  // And this is useful to know where you are
  isLast: boolean;
  isFirst: boolean;
  // Tells you the step in which you are right now, starting
  // from 1
  step: number;
}

export const Stepper: React.FC&amp;lt;StepperProps&amp;gt; = ({steps}) =&amp;gt; {
  return &amp;lt;&amp;gt;Nothing yet&amp;lt;/&amp;gt;;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will notice, now in our App.tsx file, we have an error because the Stepper component is missing the steps prop, let’s add it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { Stepper } from "./Stepper";
import "./App.css";

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Stepper
        steps={[
          {
            title: "I'm the step 1",
            // Render whatever you want here, we will improve this later
            element: ({ goNextStep, goPreviousStep }) =&amp;gt; &amp;lt;&amp;gt;Step 1&amp;lt;/&amp;gt;,
          },
          {
            title: "I'm the step 2",
            element: ({ goNextStep, goPreviousStep }) =&amp;gt; &amp;lt;&amp;gt;Step 2&amp;lt;/&amp;gt;,
          },
        ]}
      /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice!, now our steps and our Stepper are ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rendering our Steps
&lt;/h2&gt;

&lt;p&gt;We need to display the steps sequentially since we don’t want the steps to appear and disappear from the DOM, because that’s not good for accessibility, we are going to render them linearly with an overflow: hidden wrapper, like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F9sNbw_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kkj19r4z90zqa2nzmibx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F9sNbw_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kkj19r4z90zqa2nzmibx.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The red border represents the visible area, and each grey box represents each step, we only see the step which is currently inside the red area.&lt;/p&gt;

&lt;p&gt;Let’s start by rendering the steps in our Stepper component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const Stepper: React.FC&amp;lt;StepperProps&amp;gt; = ({ steps }) =&amp;gt; {
  const goNextStep = () =&amp;gt; {};
  const goPreviousStep = () =&amp;gt; {};

  return (
    &amp;lt;div className="stepper stepper-wrapper"&amp;gt;
      {/* This div represents the red bordered box */ }
      &amp;lt;div className="stepper-selector"&amp;gt;
        {steps.map(step =&amp;gt; (
          &amp;lt;div&amp;gt;
            &amp;lt;step.element
              // NOOP right now, we will update this later
              goNextStep={goNextStep}
              goPreviousStep={goPreviousStep}
              // Fill this with fake values, we will go
              // over this later
              currentStep={0}
              isFirst={false}
              isLast={false}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Now, state
&lt;/h2&gt;

&lt;p&gt;Our stepper needs to store the value of the active step, we are going to use React state for this, how we are going to update this is using the goNextStep and goPreviousStep functions, those functions are being passed to the steps we are rendering.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const Stepper: React.FC&amp;lt;StepperProps&amp;gt; = ({ steps }) =&amp;gt; {
  const [currentStep, setCurrentStep] = useState&amp;lt;number&amp;gt;(1);
  const goNextStep = () =&amp;gt; {
    const nextStep = currentStep + 1;
    if (nextStep &amp;lt;= steps.length) {
      setCurrentStep(nextStep);
    }
  };

  const goPreviousStep = () =&amp;gt; {
    const previousStep = currentStep - 1;
    if (previousStep &amp;gt;= 1) {
      setCurrentStep(previousStep);
    }
  };

  return (
    &amp;lt;div className="stepper stepper-wrapper"&amp;gt;
      &amp;lt;div className="stepper-selector"&amp;gt;
        {steps.map((step, i) =&amp;gt; (
          &amp;lt;div className="step-wrapper"&amp;gt;
            &amp;lt;step.element
              step={i + 1}
              goNextStep={goNextStep}
              goPreviousStep={goPreviousStep}
              // From our state
              currentStep={currentStep}
              // Check if this step is the first one
              isFirst={i === 0}
              // Check if its the last one
              isLast={i === steps.length - 1}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Making it fancy
&lt;/h2&gt;

&lt;p&gt;Now let’s improve what we render in each step, so we can play with it a bit, we are going to add transitions too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {
  return (
    &amp;lt;div className="wrapper"&amp;gt;
      &amp;lt;Stepper
        steps={[
          {
            title: "I'm the step 1",
            // Render whatever you want here, we will improve this later
            element: stepProps =&amp;gt; &amp;lt;Step {...stepProps} /&amp;gt;,
          },
          {
            title: "I'm the step 2",
            element: stepProps =&amp;gt; &amp;lt;Step {...stepProps} /&amp;gt;,
          },
        ]}
      /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;

const Step: React.FC&amp;lt;StepProps&amp;gt; = ({
  goNextStep,
  goPreviousStep,
  isFirst,
  isLast,
  currentStep,
  step,
}) =&amp;gt; {
  return (
    &amp;lt;div className="step"&amp;gt;
      &amp;lt;div className="step-body"&amp;gt;IM THE STEP {step}&amp;lt;/div&amp;gt;
      &amp;lt;div className="step-actions"&amp;gt;
        {/* If we are in the Step 1, we cannot go back, so we disable this */}
        &amp;lt;button
          className="step-button"
          disabled={isFirst}
          onClick={goPreviousStep}
        &amp;gt;
          GO PREVIOUS
        &amp;lt;/button&amp;gt;
        {/* Same but with the last step */}
        &amp;lt;button className="step-button" disabled={isLast} onClick={goNextStep}&amp;gt;
          GO NEXT
        &amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you go to your browser, you will see an ugly HTML layout, so we are going to add some styles to improve that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* App.css */
.step {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}

.step-body {
  flex: 1;
  justify-content: center;
  align-items: center;
  display: flex;
}

.step-actions {
  display: inline-flex;
  justify-content: space-between;
  margin: 0 2rem 1rem;
}

.step-button {
  padding: 0.5rem 1rem;
  border: none;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Stepper.css */

.stepper {
  width: 600px;
  height: 600px;
  position: relative;
  overflow: hidden;
  display: inline-block;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px,
    rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px;
}

.step-wrapper {
  width: 600px;
  height: 100%;
}

.stepper-selector {
  position: absolute;
  height: 100%;
  display: inline-flex;
    top:0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now, let’s add our functionality to switch between steps, we are going to use a ref for this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const Stepper: React.FC&amp;lt;StepperProps&amp;gt; = ({ steps }) =&amp;gt; {
  const [currentStep, setCurrentStep] = useState&amp;lt;number&amp;gt;(1);
  const stepperSelector = useRef&amp;lt;HTMLDivElement&amp;gt;(null);
  // Every time our currentStep is updated, we are going to trigger this
  useEffect(() =&amp;gt; {
    moveStepper();
  }, [currentStep]);

  const goNextStep = () =&amp;gt; {
    const nextStep = currentStep + 1;
    if (nextStep &amp;lt;= steps.length) {
      setCurrentStep(nextStep);
    }
  };

  const goPreviousStep = () =&amp;gt; {
    const previousStep = currentStep - 1;
    if (previousStep &amp;gt;= 1) {
      setCurrentStep(previousStep);
    }
  };

  const moveStepper = () =&amp;gt; {
    if (stepperSelector.current) {
      const stepper = stepperSelector.current;
      const stepWidth = stepper.offsetWidth / steps.length;
      stepper.style.transform = `translateX(-${
        stepWidth * (currentStep - 1)
      }px)`;
    }
  };

  return (
    &amp;lt;div className="stepper stepper-wrapper"&amp;gt;
      {/* This will display our current step */}
      &amp;lt;div className="stepper-selector" ref={stepperSelector}&amp;gt;
        {steps.map((step, i) =&amp;gt; (
          &amp;lt;div className="step-wrapper"&amp;gt;
            &amp;lt;step.element
              step={i + 1}
              goNextStep={goNextStep}
              goPreviousStep={goPreviousStep}
              // From our state
              currentStep={currentStep}
              // Check if this step is the first one
              isFirst={i === 0}
              // Check if its the last one
              isLast={i === steps.length - 1}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are getting a ref of the DOM element which contains the steps, we are going to move it every time we update the stepper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a progress bar to the stepper
&lt;/h2&gt;

&lt;p&gt;Time to add a progress bar, so we know where we are in the stepper.&lt;/p&gt;

&lt;p&gt;Let’s create a new component in a file called StepperProgress.tsx, it should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import "./Stepper.css";

interface StepperProgressProps {
  stepTitles: string[];
  currentStep: number;
}
export const StepperProgress: React.FC&amp;lt;StepperProgressProps&amp;gt; = ({
  stepTitles,
  currentStep,
}) =&amp;gt; {
    // Calculate the progress for each step we fill
  const progressPerStep = 100 / (stepTitles.length - 1);
    // Calculate the progress based on the step we are in
  const progress = (currentStep - 1) * progressPerStep;
  return (
    &amp;lt;div className="stepper-progress"&amp;gt;
      &amp;lt;div className="stepper-progress-wrapper"&amp;gt;
        &amp;lt;div
          className="stepper-progress-bar"
          style={{ width: progress + "%" }}
        /&amp;gt;
        {stepTitles.map((title, i) =&amp;gt; (
          &amp;lt;div className="step-title"&amp;gt;
            &amp;lt;div className="step-title-number"&amp;gt;{i + 1}&amp;lt;/div&amp;gt;
            {title}
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This component will display a progress bar and will update the progress bar width every time we update the current step.&lt;/p&gt;

&lt;p&gt;In our Stepper.tsx file let’s call the component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Rest of the Stepper.tsx file

return &amp;lt;div className="stepper stepper-wrapper"&amp;gt;
      &amp;lt;StepperProgress
        stepTitles={steps.map(step =&amp;gt; step.title)}
        currentStep={currentStep}
      /&amp;gt;
      {/* This will display our current step */}
      &amp;lt;div className="stepper-selector" ref={stepperSelector}&amp;gt;
        {steps.map((step, i) =&amp;gt; (
          &amp;lt;div className="step-wrapper"&amp;gt;
            &amp;lt;step.element
              step={i + 1}
              goNextStep={goNextStep}
              goPreviousStep={goPreviousStep}
              // From our state
              currentStep={currentStep}
              // Check if this step is the first one
              isFirst={i === 0}
              // Check if its the last one
              isLast={i === steps.length - 1}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now let’s add some CSS for this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Stepper.css

// Rest of the CSS file
.stepper-progress {
  position: absolute;
  top: 15px;
  width: 100%;
  z-index: 9;
}

.stepper-progress-wrapper {
  width: 90%;
  position: relative;
  display: flex;
  margin: auto;
  justify-content: space-between;
}

.step-title {
  text-align: center;
  font-size: 0.7rem;
  align-items: center;
  background: #fff;
  padding: 0 1rem;
  height: 30px;
}

.step-title-number {
  font-size: 1rem;
  background: #ceeeff;
  height: 24px;
  width: 24px;
  margin: auto;
  line-height: 1.5;
  border: 3px solid #fff;
  border-radius: 100%;
}

.stepper-progress-bar {
  position: absolute;
  width: 100%;
  height: 3px;
  top: 13px;
  z-index: -1;
  background: #e91e63;
  transition: width 1s cubic-bezier(0.23, 1, 0.32, 1) 0s;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ta1eKV8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fx3tw3ozioo2pcg41929.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ta1eKV8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fx3tw3ozioo2pcg41929.gif" alt="full_stepper-2"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>ux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Learn programming: 3 tips to improve your journey</title>
      <dc:creator>PixoDev</dc:creator>
      <pubDate>Tue, 03 Nov 2020 12:59:23 +0000</pubDate>
      <link>https://dev.to/pixodev/learn-programming-3-tips-to-improve-your-journey-25l5</link>
      <guid>https://dev.to/pixodev/learn-programming-3-tips-to-improve-your-journey-25l5</guid>
      <description>&lt;p&gt;At first, learn programming can be scary as fuck, you can think about maths and complex operations, but actually, programming is as simple as talking with a computer, is like learning English or French, but you use programming languages to communicate with the machines.&lt;/p&gt;

&lt;p&gt;When you start learning programming, you will feel overwhelmed by the number of resources you will find. I won’t cover where to find resources in this post (TODO: write a post about that), but you can find some interesting things in &lt;a href="https://pixo.sh/starting-in-programming-as-a-self-taught-developer/"&gt;this article&lt;/a&gt;, instead, I will share some tips I used (and I still use), and how they helped me to improve my learning curve&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 1: Consistency is key
&lt;/h2&gt;

&lt;p&gt;I’m a genious right? nobody though about this. Actually this is very important, and is the base of every habit you will try to build by yourself&lt;/p&gt;

&lt;p&gt;When you learn something new, your brain will be trained based on two things: frequency and recency&lt;/p&gt;

&lt;p&gt;Consistency here means that you should try to learn on a regular basis, try to stablish a time during your day where you can stick your ass in a chair with a relaxing mood and without being disturbed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 2: Write a glossary
&lt;/h2&gt;

&lt;p&gt;You will find A LOT of things that you don’t understand, write them in a glossary and explain them in a way you can understand, this is for you, use whatever technique you want to explain the concepts, frogs? frogs then, amount of apples in a basked? amount of apples in a basket.&lt;/p&gt;

&lt;p&gt;When I learn new things I use this technique: Scan – Learn – Read&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I scan the information and identify concepts that I don’t understand, I write them in a simple .txt file in my editor&lt;/li&gt;
&lt;li&gt;I learn every concept, I tend to use practical examples, they allow me to assimilate knowledge easily&lt;/li&gt;
&lt;li&gt;Now I can understand everything I read, so I can read everything in a fluent way without stopping because I don’t understand something&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tip 3: Learn to deal with the frustration
&lt;/h2&gt;

&lt;p&gt;Frustration will come, and that’s something every one of us should learn to deal with.&lt;/p&gt;

&lt;p&gt;Sometimes you will feel frustrated because you don’t understand what’s a thread (this took me some time to understand), or a determinated concept, but you know what, THAT’S TOTALLY OK, you don’t need to understand everything at first. It can demotivate you, make you want to give up, but the truth is that is only a stone in your path.&lt;/p&gt;

&lt;p&gt;People has several ways to deal with frustration, but my main advice is to step away from your source of frustration for a while, and try to think in other things, when you arrive to the problem next time, you will see it with other eyes&lt;/p&gt;

&lt;p&gt;What to do vs what not to do when you are frustrated while you are learning programming:&lt;/p&gt;

&lt;h3&gt;
  
  
  DON’T
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Don’t keep trying to solve the problem, it will frustrate you even more&lt;/li&gt;
&lt;li&gt;Don’t try to learn other programming things immediately, you will keep thinking about that thing that is frustrating you&lt;/li&gt;
&lt;li&gt;Don’t rush things, even if you solve this problem, you will face more in the future, improve the way you deal with them&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DO
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Do things not related to programming, cooking, videogames, do some exercises, for example, I like to watch youtube videos about restorations, I recommend you &lt;a href="https://www.youtube.com/channel/UCsCCifMby57qV_UmrYGladQ"&gt;this channel&lt;/a&gt; if you want to try, they are really satisfying and relaxing&lt;/li&gt;
&lt;li&gt;Ask for help, there are a lot of people on the internet who probably stepped into the same problem before and are more than happy to help you, but remember, their time is valuable, be polite and respectful.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this post helps people in their programming journey, is directly extracted from my professional journey and these are some of the things that worked for me&lt;/p&gt;

&lt;p&gt;Pixo&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>firstyearincode</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Starting in programming as a self taught developer
</title>
      <dc:creator>PixoDev</dc:creator>
      <pubDate>Wed, 19 Aug 2020 13:40:21 +0000</pubDate>
      <link>https://dev.to/pixodev/starting-in-programming-as-a-self-taught-developer-4lif</link>
      <guid>https://dev.to/pixodev/starting-in-programming-as-a-self-taught-developer-4lif</guid>
      <description>&lt;p&gt;There’s a lot of ways to go into the programming world professionally, you can go to college, a bootcamp, or you can learn by yourself and become a self taught developer.&lt;/p&gt;

&lt;p&gt;The programming learning curve for a self taught dev, for me looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fk8BinTN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ly8qctdcuy67x3m6d8hd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fk8BinTN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ly8qctdcuy67x3m6d8hd.png" alt="My perception of the self taught programming learning curve"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It sounds hard at first, but the only difference is that you will be your teacher, this has some cons of course.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sometimes you will find “knowledge gaps” along your career, which means that you don’t know determinated core concepts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn’t learn what is a thread until few months ago for example.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learn by yourself is emotionally hard, you will find yourself sometimes fighting the “I’m not good at this” monster. But remember that you took the hardest step already, you decided to start.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is hard to structure how you will learn, what to learn first…&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it also has pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sounds cool&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You will learn in less time, and is cheaper!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once you know how to learn something, you can learn whatever you want.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It builds really nice habits that companies appreciate, like consistency or the ability to solve problems by yourself.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Progress
&lt;/h2&gt;

&lt;p&gt;One thing i like about being a self taught developer, is that I created my own study method and i still study using it, is something that i created and I have perfected and you will be really proud of that.&lt;/p&gt;

&lt;p&gt;Some things i usually do and help me to understand determinated concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Read everything twice at least&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you don’t understand what a concept or word means, stop, google it, learn it, understand it, then keep reading&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be consistent, you need to learn this, and maybe you will learn this the hard way, but remember this: no programmer learnt to code in two days at a profesional level. Progress is not something you can measure easily, what you can do is:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At day 1, write an exercise, it doesn’t need to be large, it doesn’t need to be perfect, just write something, and save it in a codepen, or a folder in your machine&lt;/p&gt;

&lt;p&gt;At day 30 write the same exercise, and compare it with the exercise you did on day 1.&lt;/p&gt;

&lt;p&gt;You won’t notice ultra awesome differences (it depends of the size of the exercise tho), but you will notice that probably you resolved the exercise faster, you understood easily what the exercise is about, and you made less errors than in the previous exercise, let’s call this “implicit progress”. The fact that you don’t see yourself progressing doesn’t mean that you are not progressing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build consistency
&lt;/h2&gt;

&lt;p&gt;It takes some time to develop an habit, so take it easy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a comfortable space where you can learn without distractions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reserve some time each day, even 30 minutes works, but make it part of your daily routine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Don’t feel overhelmed, just chill, nobody is judging you, you are not failing the whole thing if you miss one day of studying.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Invest in your setup, a good laptop can last for years, and slow things are really frustrating, so getting a nice machine is a thing you should consider.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remember stackoverflow is your friend, and probably somebody faced the problem before, use the search box before asking.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nobody said programming is easy, but humans tends to understimate their capabilities sometimes, and there’s no way to determine if you can do something until you try it.&lt;/p&gt;

&lt;p&gt;Pixo&lt;/p&gt;

</description>
      <category>career</category>
      <category>selftaught</category>
    </item>
  </channel>
</rss>
