<?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: codethepotato</title>
    <description>The latest articles on DEV Community by codethepotato (@codethepotato).</description>
    <link>https://dev.to/codethepotato</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%2F1106030%2F3d5df2c3-e267-47da-b047-bf46a896ba06.png</url>
      <title>DEV Community: codethepotato</title>
      <link>https://dev.to/codethepotato</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codethepotato"/>
    <language>en</language>
    <item>
      <title>Understanding Scope Chain</title>
      <dc:creator>codethepotato</dc:creator>
      <pubDate>Tue, 08 Aug 2023 14:33:04 +0000</pubDate>
      <link>https://dev.to/codethepotato/understanding-scope-chain-2nbi</link>
      <guid>https://dev.to/codethepotato/understanding-scope-chain-2nbi</guid>
      <description>&lt;p&gt;Today we are going to discuss Scope Chain. This was something I struggled to understand. The stress of trying to keep up in class while figuring out what this meant was too much to handle. &lt;br&gt;
&lt;em&gt;Scope&lt;/em&gt;, in JavaScript, determines the accessibility of variables and functions at various parts in one's code/program. When inside a scope of a variable, function, or method data can be accessed. &lt;br&gt;
There are three types of scopes available:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Global Scope&lt;/li&gt;
&lt;li&gt;Function Scope&lt;/li&gt;
&lt;li&gt;Block Scope&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;
  
  
  Global Scope
&lt;/h1&gt;

&lt;p&gt;When a variable is declared outside of a function it becomes &lt;strong&gt;Global&lt;/strong&gt;. Meaning all variables can be accessed from anywhere in a program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let petName = 'Keebs';
//code here can use petName

function newFunction() {
//code here can also use petName 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Function Scope
&lt;/h1&gt;

&lt;p&gt;Variables defined inside of a function are not accessible from outside the function. Quite similar as using &lt;code&gt;let&lt;/code&gt;, &lt;code&gt;var&lt;/code&gt; and/or &lt;code&gt;const&lt;/code&gt; &lt;strong&gt;inside&lt;/strong&gt; of the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function petFunction() {
let petName = 'Keebs';  //example of Function Scope
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Back in 2015, JavaScript only had &lt;strong&gt;Global Scope&lt;/strong&gt; and  &lt;strong&gt;Function Scope&lt;/strong&gt;. Then when &lt;strong&gt;ES6&lt;/strong&gt; was introduced they provided the very important keywords: &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;. Only these two keywords provide Block Scope!&lt;/p&gt;

&lt;h1&gt;
  
  
  Block Scope
&lt;/h1&gt;

&lt;p&gt;Variables declared inside curly brackets {} can NOT be accessed from outside the block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  let x = 10;
}
// x can NOT be accessed here!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When declaring variables with &lt;code&gt;var&lt;/code&gt;, they do &lt;strong&gt;NOT&lt;/strong&gt; have block scope! Even declared inside of a {} block, they can be accessed from outside the block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
var x = 10
}
// x CAN be accessed here!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is so important to watch where you are declaring your variables, compared to where they are going to be needed. Knowing the Scope Chain will help immeasurably as your coding starts to come more naturally. This will allow you get to farther with less errors. &lt;/p&gt;

&lt;p&gt;I hope that this blog has helped you understand Scope Chain a little more and pushes you along this knowledge path we are both adventuring! &lt;/p&gt;

&lt;p&gt;Good luck and don't give up!! :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Imperative vs Declarative Programming</title>
      <dc:creator>codethepotato</dc:creator>
      <pubDate>Tue, 25 Jul 2023 14:03:07 +0000</pubDate>
      <link>https://dev.to/codethepotato/imperative-vs-declarative-programming-4gcm</link>
      <guid>https://dev.to/codethepotato/imperative-vs-declarative-programming-4gcm</guid>
      <description>&lt;p&gt;There isn't much of a difference between Imperative and Declarative programming, except for where we would use them. Today we are going to explain the key difference that separates these two. &lt;/p&gt;

&lt;h1&gt;
  
  
  Imperative Programming
&lt;/h1&gt;

&lt;p&gt;Imperative programming can be the easiest for beginnings since it relies more on a step-by-step process for executing code. This style of coding allows the programmer to tell the program &lt;strong&gt;what to do, how to do it, and when to do it&lt;/strong&gt;. This process is called the &lt;strong&gt;control flow&lt;/strong&gt;!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Calculate the Result in the list
result = 0
theList = [2, 4, 6, 8, 10]

# Creating a for loop to add numbers in the list to the Result
for x in theList:
    result += x
print(result)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Languages that are examples of Imperative Programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;Pascal&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;li&gt;Fortran&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Declarative Programming
&lt;/h1&gt;

&lt;p&gt;Declarative Programming in contrast to Imperative defines the results we want to accomplish without describing its &lt;em&gt;control flow&lt;/em&gt;. This process allows the us to place emphasis on the results of the overall goal instead of the execution process. It can lead to more descriptive and specific code. Declarative structure is precise with less code, reducing complexity and making it easier to read/understand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;theList = [2, 4, 6, 8, 10]

# Setting the result to the sum of numbers in theList
result = sum(theList)
print(result)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Languages that are examples of Declarative Programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL&lt;/li&gt;
&lt;li&gt;Miranda&lt;/li&gt;
&lt;li&gt;Prolog&lt;/li&gt;
&lt;li&gt;Lisp&lt;/li&gt;
&lt;li&gt;Many markup languages (ex. HTML)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both of these structures are useful in certain places. The key differences are that Imperative Programming is easier, step-by-step, and allows the programmer to have complete control allowing them to customize the structure to their needs with &lt;strong&gt;control flow&lt;/strong&gt;. Whereas, Declarative Programming makes it easier to limit the complexity of the code making it shorter and more concise, customization is more complicated since it has reduced code, and it also allows us to easily optimize code, with adding extensions and making upgrades.&lt;/p&gt;

&lt;p&gt;Languages that have been updated to support both paradigms include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/blog/declarative-vs-imperative-programming"&gt;educative&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.learnhowtoprogram.com/react/functional-programming-with-javascript/imperative-versus-declarative-programming"&gt;Epicodus&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.differencebetween.com/difference-between-declarative-and-vs-imperative-programming/"&gt;DifferenceBetween.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>react</category>
      <category>learning</category>
    </item>
    <item>
      <title>Debugging in Console</title>
      <dc:creator>codethepotato</dc:creator>
      <pubDate>Wed, 05 Jul 2023 15:11:44 +0000</pubDate>
      <link>https://dev.to/codethepotato/debugging-in-console-4011</link>
      <guid>https://dev.to/codethepotato/debugging-in-console-4011</guid>
      <description>&lt;p&gt;Something programmers use all the time is debugging. The best thing about this process is that we don't have to wait until an error is thrown to use this tool. There are many different ways that can end this tool to refine our check. We are going to talk about a few of them here today. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log()&lt;/code&gt;  &lt;/p&gt;

&lt;p&gt;It is the most basic and best tool in JavaScript for debugging.&lt;/p&gt;

&lt;p&gt;While writing our code we can add in &lt;code&gt;console.log()&lt;/code&gt; with the parameter or message that we are checking. This is called, Tracing!&lt;br&gt;
This will provide feedback about 'what the machine is thinking', and showing us what is being passed. From here we know if we need to go back and see why we aren't getting the response in console, or if there's some reshaping to the code that is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log('Is this our info?')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are some that are not as popular as the &lt;code&gt;console.log&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.error()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const pets = {smallCat: 'Flurry', bigCat: 'Keebs'}
console.error(pets)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is for printing out an error to the console. This form allows it to take on multiple arguments. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.warn()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const pets = {smallCat: 'Flurry', bigCat: 'Keebs'}
console.warn(pets)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This form is a middle step between the usual .log() and the more dire .error() messages.&lt;/p&gt;

&lt;p&gt;The final one that we are going to talk about today is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.table()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is going to print out a table of all the entries. Just like the last two examples, they are not as common. Primarily &lt;code&gt;console.log()&lt;/code&gt; is going to be a new best friend! &lt;/p&gt;

&lt;p&gt;It is good practice to always &lt;code&gt;console.log()&lt;/code&gt; any message, variable, and even finish functions with that to be sure that everything is still working so far. When passing or receiving elements to the DOM it's so crucial to be checking that those elements; Be sure we are moving what we want, where we want. &lt;/p&gt;

&lt;p&gt;There are many many uses to this debugging. It allows us to pick apart our code to see what is causing the issues and where they are. Error codes will show what folder, code line and line space that broke the code. The most common error types are Syntax, Type, Range, and Scope errors. &lt;/p&gt;

&lt;p&gt;Here are some great links that are helpful to understanding these tools more in depth. &lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Console/log"&gt;MDN Web Docs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/javascript-console-log-method/"&gt;GeeksforGeeks&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org/news/javascript-console-log-example-how-to-print-to-the-console-in-js/"&gt;FreeCodeCamp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading! Have a great day!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Removing Elements From An Array</title>
      <dc:creator>codethepotato</dc:creator>
      <pubDate>Sun, 25 Jun 2023 19:43:10 +0000</pubDate>
      <link>https://dev.to/codethepotato/removing-elements-from-an-array-2im1</link>
      <guid>https://dev.to/codethepotato/removing-elements-from-an-array-2im1</guid>
      <description>&lt;p&gt;There are multiple ways an element can be removed from an array. We're going to discuss how to destructively and non destructively remove elements. It is crucial to think of how the code should run. &lt;/p&gt;

&lt;h1&gt;
  
  
  Destructively
&lt;/h1&gt;

&lt;p&gt;There are two ways that elements can be added to an array with a destructive method. The reason they are called Destructive is because when used in a function they will change the original array with the passed in information. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;.shift()&lt;/code&gt; removes the &lt;strong&gt;first&lt;/strong&gt; element in an array&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.pop()&lt;/code&gt; removes the &lt;strong&gt;last&lt;/strong&gt; element in an array&lt;/p&gt;

&lt;p&gt;The two methods are similar in these ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They do &lt;strong&gt;not&lt;/strong&gt; take any arguments&lt;/li&gt;
&lt;li&gt;They remove a single element&lt;/li&gt;
&lt;li&gt;They return the element that is removed&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Nondestructively
&lt;/h2&gt;

&lt;p&gt;This method works similar as the spread operator(...) if we don't add any arguments it will return a copy of the original array with all elements intact. Then removes an element without mutating the original array. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;.slice()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We are able to add one-two arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, is the index where the slice should begin&lt;/li&gt;
&lt;li&gt;Second, is the index where the slice should end
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const snacks = ['Chips', 'Pretzels', 'M&amp;amp;Ms', 'Fruit', 'Veggies'];
const healthy = snacks.slice(3, 4);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above we are creating a new variable and assigning pieces of the original array without mutating the original array. &lt;/p&gt;

&lt;p&gt;Some great resources are linked below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/js/js_array_methods.asp"&gt;W3Schools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice"&gt;Mozilla&lt;/a&gt;&lt;br&gt;
&lt;a href="https://react.dev/learn/updating-arrays-in-state#updating-arrays-without-mutation"&gt;React&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>learning</category>
    </item>
    <item>
      <title>Building an Online Profile</title>
      <dc:creator>codethepotato</dc:creator>
      <pubDate>Sun, 25 Jun 2023 18:47:37 +0000</pubDate>
      <link>https://dev.to/codethepotato/building-an-online-profile-217f</link>
      <guid>https://dev.to/codethepotato/building-an-online-profile-217f</guid>
      <description>&lt;p&gt;Having an online presence is among the top 10 priorities of thriving in the ever booming Tech world. The last 15 years alone have shown over a 2 billion people rise in social media usage. Being a 1997 baby myself, I've experienced great advances with many more to follow.&lt;/p&gt;

&lt;p&gt;Not only is it crucial to know the lines of code that we write to create entire systems; We also have to construct a virtual platform of ourselves to create our futures. Schools, big companies and even small businesses are using many different hiring websites to look for ideal candidates. &lt;br&gt;
People of all ages are learning to use technology. Joining the Software Engineering profession in schools or from the comfort of their home. Even more incredible, there are people with little to no knowledge joining. Creating a community!&lt;/p&gt;

&lt;p&gt;There are many tools out there that can help you to practice and modify code. One of the biggest tools is GitHub and Visual Studio Code (VS Code). GitHub has many repositories to fork and clone, and allows groups to work together. GitHub is a public resource for everyone. Teachers and employers are able to access your profile to see what work that has been started and projects finished. Making it immensely useful and important to have updated. Vs Code is a platform that can be used to create, edit, or practice coding. VS Code provides an organized space to write and integrate changes necessary for functions. These two systems are able to ingrate together. Pushing your work from VS Code allows progress commits and also checkpoints for groups with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "creates myfile.md"
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That leaves it open for group members to &lt;code&gt;git pull&lt;/code&gt; from their systems, allowing smooth exchange.&lt;/p&gt;

&lt;p&gt;There are hundreds of extensions available for install that can improve technique, color organize, and also add a little fun into coding. An example would be VS Pets. A small virtual animal at the bottom left of the screen for reminders of how important it is to take breaks and refresh.  &lt;/p&gt;

&lt;p&gt;Some websites that are good to have in the tool belt are LinkedIn and Indeed. Here you can upload resumes that hold all previous experiences and jobs. Indeed provides small quizzes to take about certain knowledge fields to show a level of comprehension. Where as LinkedIn has classes available to gain more knowledge, and it shows an understanding that we never truly stop learning. These sites can help you build up a profile with examples and templates to input personal information. &lt;br&gt;
We use them to help us create these profiles, but ultimately what we came here for is a job! LinkedIn and Indeed are first and foremost job search engines! &lt;/p&gt;

&lt;p&gt;Join some social media groups of your own! There are many more sites and apps available that have coding forums of their own. Such as Reddit, Quora, Medium, and Discord. Joining a virtual community can help in more ways than just helping build a portfolio. An open forum for questions, help or just sharing can improve personal and social skills. It may not seem like a software engineer has to be social, but that is a myth! Team work and communicating syntax or asking questions is a major part of the foundation.  &lt;/p&gt;

&lt;p&gt;Employers are going to be looking at two things specifically. They want to know what technical ability, and what kind of team fit that person is going to make. These are so important to keep in mind when creating a portfolio. They'll want to get a good idea of the person that would be filling their position. &lt;/p&gt;

&lt;p&gt;This project will be changing all the time. Keep updated and stay informed. Always remember to Ctrl + S ;)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>career</category>
      <category>github</category>
    </item>
  </channel>
</rss>
