<?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: Premanshu Pareek</title>
    <description>The latest articles on DEV Community by Premanshu Pareek (@premanshupareek).</description>
    <link>https://dev.to/premanshupareek</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%2F629451%2F95a90173-3da2-452d-bad6-bd604900b98f.jpeg</url>
      <title>DEV Community: Premanshu Pareek</title>
      <link>https://dev.to/premanshupareek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/premanshupareek"/>
    <language>en</language>
    <item>
      <title>Learning To Code? Here Are 5 Mistakes That You Should Avoid.</title>
      <dc:creator>Premanshu Pareek</dc:creator>
      <pubDate>Tue, 27 Dec 2022 18:57:34 +0000</pubDate>
      <link>https://dev.to/premanshupareek/learning-to-code-here-are-5-mistakes-that-you-should-avoid-5ebd</link>
      <guid>https://dev.to/premanshupareek/learning-to-code-here-are-5-mistakes-that-you-should-avoid-5ebd</guid>
      <description>&lt;p&gt;Have you ever tried your hand at programming and wondered if it is for you or not? Or, have you been working for a long time with the same technology, and when you were asked to work on something new, you couldn't get it, no matter how you tried?&lt;/p&gt;

&lt;p&gt;Well... if your answer to those questions is a yes, then you are in the right place.&lt;br&gt;
In this article, we will go over 5 things that are becoming a roadblock in your learning journey and how to avoid them. So, let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thinking you already know it
&lt;/h2&gt;

&lt;p&gt;The number one on the list is this thought that some of you may have, and that is thinking you already know the stuff. It is especially true for those who have spent some time programming.&lt;br&gt;
This way of thinking doesn't just take away the excitement you have while learning new things, but at the same time also gives you a feeling that you might be wasting your time.&lt;br&gt;
Something you can do to get over this mental block is to practice "Deliberate Learning."&lt;br&gt;
Deliberate Learning means you move on to learning the things you aren't comfortable with and skip the things that feel familiar to you.&lt;br&gt;
According to Josh Kaufman, a New York Times bestselling author, &lt;strong&gt;it only takes 20 hours of deliberate practice to get really good at something.&lt;/strong&gt; Approaching your learning sessions this way will make them more productive and exciting for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting comfortable with hell
&lt;/h2&gt;

&lt;p&gt;You might have heard of the term "tutorial hell" before. Going through many tutorials and finishing them... copying code from there, and sometimes getting certificates for this may sound like you are making progress, but in reality, it's hindering your growth. &lt;br&gt;
The famous quote, "When you are going through hell, keep going", doesn't really apply in this case.&lt;br&gt;
The easiest thing to do to get out of this is to start putting the knowledge that you have gained so far into practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not choosing the right path
&lt;/h2&gt;

&lt;p&gt;Now... tutorial hell could be a thing, but it is also true that tutorials help you get started and stay on track. So, it's better to choose the right starting point.&lt;br&gt;
One of the principles of learning, according to Scott Young, author of the book Ultralearning, is called &lt;strong&gt;Metalearning&lt;/strong&gt;. It's &lt;strong&gt;the act of gathering good resources, and planning the path your learning journey will take.&lt;/strong&gt;&lt;br&gt;
To learn programming, you can take some help from Youtube videos, or choose a path from &lt;a href="https://roadmap.sh" rel="noopener noreferrer"&gt;here&lt;/a&gt; for your chosen field. The important thing is to pick one and sticking to it.&lt;br&gt;
If you are starting out with JavaScript, and aiming to become JavaScript Developer then the courses mentioned in this &lt;a href="https://sutle.io/jorenrui/learn-reactjs" rel="noopener noreferrer"&gt;path&lt;/a&gt; can help you in quickly getting the hang of the concepts to further propel your growth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Switching technologies too often
&lt;/h2&gt;

&lt;p&gt;There is no shortage of exciting new technologies in today's tech world, and new ones also keep popping every now and then. Although it may be hard to resist the urge to dive into these new and untested waters to explore what's new, but you should resist it nonetheless.&lt;br&gt;
This is one of the most obvious mistakes a programmer can make. If you have picked a technology, don't leave it until you have a good enough grasp of it. As we have already discussed above, it just takes 20 hours of deliberate practice. After you have mastered a technology to a good extent, you will find it way easier to pick up new technologies.&lt;br&gt;
So, plan your learning well, and master your current field before moving onto the next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Being Inconsistent with your effort
&lt;/h2&gt;

&lt;p&gt;Now, this is something that I am telling you from personal experience. Nothing slows down your progress more than inconsistent effort. I can't tell you how many times I have had to revisit something I already learned in the past just because I was not consistent.&lt;br&gt;
When you are learning to program, it does not matter if you do it for 1 hour or for 10 hours. What matters is that you do it everyday, over a significant period of time. Just doing this one thing will ensure that you are making progress and moving towards your goals.&lt;br&gt;
To keep yourself accountable, you can join the &lt;a href="https://www.100daysofcode.com/" rel="noopener noreferrer"&gt;#100DaysofCode&lt;/a&gt; challenge, where you will find the support of a community to help you stay on track.&lt;br&gt;
In moments of doubt, remember these words from Robert Collier - &lt;strong&gt;"Success is the sum of small efforts repeated day in and day out."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everything I have mentioned above is something that I have learned over the years through trial and error. I believe if you focus on not making these mistakes, you will be able to enjoy your learning process to the fullest and see your skills improve.&lt;br&gt;
If you have any questions, feel free to ask me by sending me a message on my &lt;a href="https://www.instagram.com/premanshu.pareek/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt;, or add me on &lt;a href="https://www.linkedin.com/in/premanshupareek/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Higher Order Functions You Should Know Before Learning React</title>
      <dc:creator>Premanshu Pareek</dc:creator>
      <pubDate>Tue, 15 Mar 2022 14:25:52 +0000</pubDate>
      <link>https://dev.to/premanshupareek/higher-order-functions-you-should-know-before-learning-react-39p6</link>
      <guid>https://dev.to/premanshupareek/higher-order-functions-you-should-know-before-learning-react-39p6</guid>
      <description>&lt;p&gt;React is one of the most famous frontend framework in the world and that has been the case for many years now. One of the things that makes React more appealing to new developers is that it is quite easier to use.&lt;br&gt;
But, many developers that dive straight into React before achieving a good understanding of JavaScript face issues with it and end up getting confused.&lt;br&gt;
This article will introduce you to some of the higher order functions that are used in React very often.&lt;/p&gt;
&lt;h2&gt;
  
  
  But wait... What qualifies a function to be called a Higher Order Function?
&lt;/h2&gt;

&lt;p&gt;The function that performs any action on another function(s) by taking them as arguments or returns a function as response, is called a Higher Order Function.&lt;/p&gt;

&lt;p&gt;It is not necessary for the function to do both the above mentioned things. As long as it does either of those, it is considered a Higher Order Function.&lt;/p&gt;
&lt;h2&gt;
  
  
  .forEach()
&lt;/h2&gt;

&lt;p&gt;.forEach() can be considered a replacement for the for loop. It performs a set of operation over a collection of data (such as array, object etc.) by going over all the items one by one, just the way a for loop does.&lt;br&gt;
One advantage that it has over for loop is that it adds another layer of abstraction in the code.&lt;br&gt;
Following examples will clear it even further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Use of For loop
const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

for (i=0; i &amp;lt; ages.length; i++) {
  if(ages[i] &amp;gt;= 18) {
    console.log("You are an adult");
  } else {
    console.log("You are not an adult");
  }
}
&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;// Use of .forEach()
const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

ages.forEach(age =&amp;gt; age &amp;gt;= 18 ? console.log("You are an adult") : console.log("You are not an adult"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  .map()
&lt;/h2&gt;

&lt;p&gt;.map() is a very useful function in the sense that it allows us to create a new array from anything, be it an array or object. Let's look at an example 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;// Use of For loop

const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

let twiceAge = [];
for (i = 0; i &amp;lt; ages.length; i++) {
  twiceAge.push(ages[i]);
}
&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;// Use of .map()

const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

let twiceAge = ages.map(age =&amp;gt; age * 2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  .filter()
&lt;/h2&gt;

&lt;p&gt;.filter() allows us to filter data based on a condition that we provide. We can understand the contrast between the loop approach and the approach using the .filter() function, as well as the functionality of .filter() much better using the following examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Use of For loop
const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

let approvedForVoting = [];
for (i = 0; i &amp;lt; ages.length; i++) {
  if (ages[i] &amp;gt;= 18) {
    approvedForVoting.push(ages[i]);
  }
}
&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;// Use of .filter()
const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];

let approvedForVoting = ages.filter(age =&amp;gt; age &amp;gt;= 18)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  .sort()
&lt;/h2&gt;

&lt;p&gt;.sort() as the name suggests, allow us to sort and rearrange the data based on a condition that we provide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Use of For loop

const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];
initialAge = 0;
for (i = 0; i &amp;lt;= ages.length ; i++) {
  for (j = i; j &amp;lt;= ages.length; j++) {
    if(ages[j] &amp;lt; ages[i]) {
      initialAge = ages[j];
      ages[j] = ages[i];
      ages[i] = initialAge;
    }
  }
}
&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;// Use of .sort()
const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];
ages.sort((a, b) =&amp;gt; a - b);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  .reduce()
&lt;/h2&gt;

&lt;p&gt;.reduce() basically starts you off with a set of data and a variable with an initial value. It then allows you to go through all the values in the set of data and then add it to the variable. It then returns the final value as the result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Use of For loop

const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];
let total = 0;
for (i = 0; i &amp;lt; ages.length; i++) {
  total += ages[i];
}
&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;// Use of .reduce()

const ages = [15, 18, 14, 9, 22, 86, 74, 45, 3, 76, 32, 36];
let totalOfAges = ages.reduce((total, age) =&amp;gt; {return total += age}, 0);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Although this is not an exhaustive list of all the higher order functions in JS, these are the ones that I have seen and used most by far. Learning these before diving into React, will likely make your learning experience better.&lt;/p&gt;

&lt;p&gt;Please leave your comments if you liked this article. Your suggestions are always welcome as well. I hope you will benefit from reading this article. I will see you all soon with my next post. Until then, keep learning.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
