<?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: Swishyfishie</title>
    <description>The latest articles on DEV Community by Swishyfishie (@swishyfishie2).</description>
    <link>https://dev.to/swishyfishie2</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%2F175850%2Fea7cfc8f-259e-4cb1-8b16-192741f9524d.jpg</url>
      <title>DEV Community: Swishyfishie</title>
      <link>https://dev.to/swishyfishie2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swishyfishie2"/>
    <language>en</language>
    <item>
      <title>Nice to meet you, PHP!</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Sat, 05 Dec 2020 18:13:13 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/nice-to-meet-you-php-51og</link>
      <guid>https://dev.to/swishyfishie2/nice-to-meet-you-php-51og</guid>
      <description>&lt;p&gt;I have got a few messages on my &lt;a href="https://www.linkedin.com/in/claudiu-andrei-pestenariu-95a47b160/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; regarding my PHP post the other day so I decided to write a bit about the start of my journey in the world of PHP. &lt;/p&gt;

&lt;p&gt;My main motivation for learning this language is -and I'm going to be brutally honest- the job market. Studying Ruby on Rails at Flatiron Bootcamp was amazing, but the job prospects are grim as most of the Rails jobs are for people with a few years of experience, not juniors, but I derail (pun intended). &lt;/p&gt;

&lt;p&gt;Okay so as a PHP junior, I've found a few useful resources and tools: &lt;/p&gt;

&lt;h2&gt;
  
  
  XAMPP
&lt;/h2&gt;

&lt;p&gt;XAMPP is a popular PHP development environment that you can install on all the platforms (Linux, Windows and Mac). If you follow the instructions from &lt;a href="https://www.apachefriends.org/index.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; -- click on the video, you should have it up and running in no time. &lt;/p&gt;

&lt;p&gt;You just open up the XAMPP after you installed it and click on the start buttons for the Apache and MySQL modules. &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%2Fi.imgur.com%2F9wb9wmV.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%2Fi.imgur.com%2F9wb9wmV.png" alt="xampp interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will basically start your server which you'll find by default under the "localhost" address, so just type that in your browser. &lt;/p&gt;

&lt;p&gt;You'll want to create your own php files, right? So in order to do that, go to the path 'xampp/htdocs' and create a folder with your project, maybe something cool like "todolist". Todo lists are cool, right? ...right? &lt;/p&gt;

&lt;p&gt;Right! &lt;/p&gt;

&lt;p&gt;Create your php files there and you can access them from your localhost address like this "localhost/todolist/index.php". &lt;/p&gt;

&lt;p&gt;Simple, right?&lt;/p&gt;

&lt;p&gt;Now you just need to know how to write PHP and you're sorted. &lt;/p&gt;

&lt;p&gt;I highly recommend this &lt;a href="https://www.youtube.com/watch?v=oJbfyzaA2QA&amp;amp;list=PLillGF-Rfqbap2IB6ZS4BBBcYPagAjpjn&amp;amp;ab_channel=TraversyMedia" rel="noopener noreferrer"&gt;FREE&lt;/a&gt; course by Brad Traversy. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a database from 'localhost/phpmyadmin'
&lt;/h2&gt;

&lt;p&gt;It's quite simple to create a database using XAMPP. &lt;/p&gt;

&lt;p&gt;Type in your browser search bar 'localhost/phpmyadmin' and you'll see an overwhelming interface, but do not worry! It's not that scary if you actually look at it. &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%2Fi.imgur.com%2FGcwO5gI.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%2Fi.imgur.com%2FGcwO5gI.png" alt="localhost php my admin interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the right side you can see the magic word "New". You can either press it, or be directed by default to the database panel where you have to enter the database name and just press create. &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%2Fi.imgur.com%2FkxsveqL.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%2Fi.imgur.com%2FkxsveqL.png" alt="new database tab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this example I've created a table named "posts" that has 4 columns.&lt;/p&gt;

&lt;p&gt;The first column is the "id" which you need to make sure it has a type of "INT" (integer) and that it is automatically incremented, by checking the "A_I" checkbox.&lt;/p&gt;

&lt;p&gt;The second one is designated for the body of the post (the actual content) with a type of "TEXT" -- no need to give it other attributes.&lt;/p&gt;

&lt;p&gt;The third one, author is going to be a type of  "VARCHAR" with a length of 255 characters&lt;/p&gt;

&lt;p&gt;And the fourth will have a "DATETIME" type that we will give a default value of  "CURRENT_TIME". &lt;/p&gt;

&lt;p&gt;Press Save and you'll have a lovely table 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%2Fi.imgur.com%2FxKLmZr9.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%2Fi.imgur.com%2FxKLmZr9.png" alt="database table view"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, you can play around and go to the INSERT tab and populate your database, but going more in depth is out of this article's scope. &lt;/p&gt;

&lt;h2&gt;
  
  
  Postman
&lt;/h2&gt;

&lt;p&gt;This is an amazing tool for testing your API -- if you want to build any. But you should want to build at least an API in your lifetime. It's fun and it's not that hard! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/OEWXbpUMODk" rel="noopener noreferrer"&gt;PHP API course&lt;/a&gt; - this one has Postman included and &lt;a href="https://www.youtube.com/watch?v=Iq7eh6DhN6M&amp;amp;ab_channel=CleverProgrammer" rel="noopener noreferrer"&gt;Postman course&lt;/a&gt; - this one is focused on Postman&lt;/p&gt;

&lt;h2&gt;
  
  
  VSCode
&lt;/h2&gt;

&lt;p&gt;Use VSCode. &lt;/p&gt;

</description>
      <category>php</category>
      <category>postman</category>
      <category>api</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Bite-sized intro to React</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Sun, 22 Nov 2020 11:01:42 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/bite-sized-intro-to-react-4249</link>
      <guid>https://dev.to/swishyfishie2/bite-sized-intro-to-react-4249</guid>
      <description>&lt;p&gt;Sometimes we come across tutorials that seem great because we're building something, and that's ok.&lt;/p&gt;

&lt;p&gt;The main issue with some of these tutorials is that they are focused on you building something, and not actually, teaching you what's going on inside of what you've built, so at the end of an udemy course you might find yourself having coded 3 full stack applications and have no idea how to manipulate an array.&lt;/p&gt;

&lt;p&gt;I'll try to take a different approach with this article and instead of focusing on building, we're going to dissect something which was already built following examples from &lt;a href="http://www.reactjs.com"&gt;www.reactjs.com&lt;/a&gt; and &lt;a href="http://www.w3schools.com"&gt;www.w3schools.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to explore the following questions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What is a component? (and what is going on inside it)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are the props? (and what is &lt;em&gt;this&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is the state?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: the HTML you see in React is not actually HTML, it's a way of writing JavaScript and HTML. You are not required to know JSX in order to build a React app, but it's definitely the easiest way. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is a component?
&lt;/h3&gt;

&lt;p&gt;A component is a piece of code that is (ideally) reusable code, that is (&lt;em&gt;again, ideally&lt;/em&gt;) independent from the other pieces of code that you wrote.&lt;/p&gt;

&lt;p&gt;This is a component: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--44AD6St5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/8lSW63U.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--44AD6St5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/8lSW63U.png" alt="react component" width="426" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reference: &lt;a href="https://reactjs.org/"&gt;https://reactjs.org/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, let's break down what's going on in here. &lt;/p&gt;

&lt;p&gt;On line 1 we're using the ES6 Class syntax to define the "TodoList" class, that is extending the React.Component which basically means that TodoList class is a React.Component child, therefore inheriting React.Component's methods.&lt;/p&gt;

&lt;p&gt;On line 2, we're looking at a &lt;strong&gt;&lt;em&gt;render&lt;/em&gt;&lt;/strong&gt;  function, that (on line 3) *** returns*** HTML.&lt;/p&gt;

&lt;p&gt;Line 4 is an &lt;em&gt;UL&lt;/em&gt; opening tag, that closes on line 8,  and line 5 and 6 are the display of JSX's power. &lt;/p&gt;

&lt;p&gt;Curly braces allow you to process javascript inside the HTML, you can think of it like when you're using template literals in javascript, where in order to have javascript code in your string, you need to surround the string with back-ticks and wrap your code around ${ }. It's mostly the same principle.&lt;/p&gt;

&lt;p&gt;Coming back to line 5 and 6.&lt;br&gt;
We're going to talk about &lt;code&gt;this&lt;/code&gt; and &lt;code&gt;props&lt;/code&gt; soon, but for now you just need to know that we're mapping over the this.props.items array and returning a &lt;em&gt;LI&lt;/em&gt; html element that has a key and a content of &lt;code&gt;item.text&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are the props?
&lt;/h3&gt;

&lt;p&gt;Props are properties of a react component. They are similar to what arguments are in a javascript function and they're passed down from a parent component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zf63wpcp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/MGn9WhG.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zf63wpcp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/MGn9WhG.png" alt="car compoent" width="728" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reference: &lt;a href="https://www.w3schools.com/"&gt;https://www.w3schools.com/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On this example you can see how there are two components, Car and Garage. If we're thinking about the hierarchy of things, a Garage can store Cars so we can say that Garage is the parent of Car. &lt;/p&gt;

&lt;p&gt;In the Garage component you can see how the &lt;code&gt;&amp;lt;Car /&amp;gt;&lt;/code&gt; component is invoked and there's the prop passed in as brand="Ford" which is essentially a HTML attribute. &lt;/p&gt;

&lt;p&gt;The Car component can access it through &lt;code&gt;props&lt;/code&gt; and in our case, through &lt;code&gt;this.props.brand&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;this&lt;/code&gt; refers to the object it belongs to so &lt;code&gt;this.props.brand&lt;/code&gt; could be pseudocoded like:&lt;/p&gt;

&lt;p&gt;from &lt;em&gt;&lt;code&gt;this&lt;/code&gt;&lt;/em&gt; object . I want these &lt;em&gt;&lt;code&gt;props&lt;/code&gt;&lt;/em&gt; . named &lt;em&gt;&lt;code&gt;brand&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the state?
&lt;/h3&gt;

&lt;p&gt;The state of an object refers to what that object is like, and its attributes.&lt;/p&gt;

&lt;p&gt;A state of a Car object can be an object that holds some attributes such as &lt;code&gt;color:red&lt;/code&gt;, &lt;code&gt;working:true&lt;/code&gt;, &lt;code&gt;wheels:4&lt;/code&gt; and so on.&lt;/p&gt;

&lt;p&gt;The magic of it is the fact that we can change this information and update it in the user view without much trouble. &lt;/p&gt;

&lt;p&gt;We could theoretically build a function that detects changes in the wheels number and when it's less than 4, we could change &lt;code&gt;this.state.working&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;. However we'd have to do it through a function named &lt;code&gt;setState&lt;/code&gt; so the code will look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;this.setState({working:false})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is an example of how the Car's color will be changed through setState, using an event listener bound to a button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kQVm9pRu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/HPkYUeU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kQVm9pRu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/HPkYUeU.png" alt="car component changes state" width="435" height="842"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reference: &lt;a href="https://www.w3schools.com/"&gt;https://www.w3schools.com/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I hope that this bite-sized article made you curious about what's going on in some simple React code. &lt;/p&gt;

&lt;p&gt;For more information please check the &lt;a href="https://reactjs.org/"&gt;https://reactjs.org/&lt;/a&gt; and really work your way through it. Study properly, don't just copy the code and you'll find yourself progressing way faster than coding along from udemy or youtube. &lt;/p&gt;

&lt;p&gt;All the best!&lt;/p&gt;

</description>
      <category>react</category>
      <category>coding</category>
      <category>beginners</category>
      <category>bitesized</category>
    </item>
    <item>
      <title>4 aspects of studying coding tutorials that you must be aware of, as a beginner</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Thu, 22 Oct 2020 04:29:57 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/4-aspects-of-studying-tutorials-that-you-must-be-aware-of-as-a-beginner-m6i</link>
      <guid>https://dev.to/swishyfishie2/4-aspects-of-studying-tutorials-that-you-must-be-aware-of-as-a-beginner-m6i</guid>
      <description>&lt;h4&gt;
  
  
  When you're learning a programming language as a beginner, and you're faced with a tutorial (or 10) that feels overwhelming, you must know a few things:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The person who made the tutorial, prepared everything in advance. The video/article is made for educational purposes, not to reflect how real programmers work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's perfectly normal to not understand too much. The goal here is for you to type the code, get familiar with the words so when you'll see the same stuff again, your brain will click saying "Hey, I remember this!", and of course, you'll feel proud of yourself! &lt;em&gt;clap clap&lt;/em&gt; :) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;People were not ready for the tutorials we have here. Our brains can't process the amount of information, their complexity and because there are so many tutorials, we devalue them. &lt;br&gt;
Let's imagine we are 15 years in the past and you'd try to learn programming. You'd get some CDs with a person talking you through code and explaining various concepts. Due to the fact that your resources are limited, you'd devour those CDs making use of every bit of information there. You wouldn't neglect it as you're doing with your udemy courses. Should I even mention &lt;a href="https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ/"&gt;freeCodeCamp's&lt;/a&gt; 5-10 hours long, free tutorials? -- which brings me to my last point&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commitment. Dedicate yourself to one tutorial, one series or one instructor. It's tempting and often advised to use multiple sources, and to an extent it's a good idea, but serious learning is done through commitment, and commitment means focus. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  I hope this tiny article helped you. These are some things I wish I knew when I started coding.
&lt;/h4&gt;

</description>
      <category>programming</category>
      <category>tutorials</category>
      <category>coding</category>
      <category>studying</category>
    </item>
    <item>
      <title>My Top 3 Favourite JavaScript Array Methods</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Sun, 18 Oct 2020 15:52:44 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/my-top-3-favourite-javascript-array-methods-46fo</link>
      <guid>https://dev.to/swishyfishie2/my-top-3-favourite-javascript-array-methods-46fo</guid>
      <description>&lt;p&gt;In this tutorial I will be working in the &lt;strong&gt;Google Chrome dev tools&lt;/strong&gt; console, so feel free to follow along.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xoFoL09k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/j3GVn2O.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xoFoL09k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/j3GVn2O.png" alt="" width="567" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will create an array of strings and we will go through each of those methods to see what they are used for in an array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let myTutorials = ['Python','JavaScript','Ruby']&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QDoRlTel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/YgF6e8y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QDoRlTel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/YgF6e8y.png" alt="" width="398" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Starting with .forEach()
&lt;/h3&gt;

&lt;p&gt;For each calls a function for each element of the array, in order so basically it loops over the array, and I mostly use &lt;code&gt;.forEach()&lt;/code&gt; when I want to render something in the dom.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;myTutorials.forEach(tutorial =&amp;gt; document.write(&lt;/code&gt;I love ${tutorial}. &lt;code&gt;))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cbnTwLeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hfCWAzB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cbnTwLeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hfCWAzB.png" alt="" width="822" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please be careful when you're working with objects, as forEach is an &lt;strong&gt;array method&lt;/strong&gt;, and if you try to use it it will throw the following error&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IpN2h616--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/c9UFgKH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IpN2h616--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/c9UFgKH.png" alt="" width="528" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The next array method is called .filter()
&lt;/h3&gt;

&lt;p&gt;Filter it will create an array with the items that pass a certain condition which is provided as a function.&lt;/p&gt;

&lt;p&gt;Let's create an array of numbers: &lt;code&gt;let arrayOfNumbers = [2, 53, 3, 81, 31, 5, 12, 66, 199, 34, 81, 19]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the following image you can see how the filter method is easy to apply when you know what you want to filter, in this case, I want to filter out numbers that are higher than 50&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--drdOqnlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JT3XcXD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--drdOqnlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JT3XcXD.png" alt="" width="463" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  And last but not least, your soon-to-be best friend, .map() .
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Map will execute a function over all the elements it loops through, and create a new array of them. &lt;/p&gt;

&lt;p&gt;Map will not change the initial array and we're calling this a non-destructive behaviour. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's say I want to change something on every element of my previously initialized tutorials array&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let myTutorials = ['Python','JavaScript','Ruby']&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can see here how I changed each element individually&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---xTfCcgY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/WznO5af.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---xTfCcgY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/WznO5af.png" alt="" width="375" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here, I could even introduce a conditional statement to display my love for a certain language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OWVtVbi5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/UpffdI0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OWVtVbi5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/UpffdI0.png" alt="" width="362" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This bite-sized article is meant to quickly show you how you could use those 3 methods. I hope you enjoyed it and found it useful.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>arrays</category>
      <category>foreach</category>
      <category>filter</category>
    </item>
    <item>
      <title>Restful routes or why do I have to do this?!</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Wed, 15 Apr 2020 10:30:57 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/restful-routes-or-why-do-i-have-to-do-this-3kbn</link>
      <guid>https://dev.to/swishyfishie2/restful-routes-or-why-do-i-have-to-do-this-3kbn</guid>
      <description>&lt;p&gt;Introduction:&lt;br&gt;
REST or Representational State Transfer is an architectural style, a convention that enables interaction through descriptive HTTP requests : GET, POST or DELETE and makes it simpler to organize your app structure.&lt;/p&gt;

&lt;p&gt;In order to understand how to use RESTful routes better, we need to take a look n what those HTTP requests mean.&lt;/p&gt;

&lt;p&gt;GET is used to retrieve data and nothing else. It's like you'd play "get" with your HTTP dog...&lt;/p&gt;

&lt;p&gt;POST is used when you want to make something new. Basically you send data to the database and the models, where it's processed and manipulated in the desired way. Nothing to do with posting mail though...&lt;/p&gt;

&lt;p&gt;PATCH. Come on you two, patch things up! .. This one updates whatever you want to be updated.&lt;/p&gt;

&lt;p&gt;DELETE is generally used to...you know...delete stuff.&lt;/p&gt;




&lt;p&gt;A &lt;em&gt;GET&lt;/em&gt; route should look like:&lt;br&gt;
&lt;a href="http://www.mywebsite.com/user/3"&gt;www.mywebsite.com/user/3&lt;/a&gt; &lt;br&gt;
&lt;a href="http://www.mywebsite.com/items/3/edit"&gt;www.mywebsite.com/items/3/edit&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.mywebsite.com/products/new"&gt;www.mywebsite.com/products/new&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They all should only display the content and not process it in any way. That's a job for the other routes.&lt;/p&gt;




&lt;p&gt;A &lt;em&gt;POST&lt;/em&gt; route should look like:&lt;br&gt;
&lt;a href="http://www.mywebsite.com/products"&gt;www.mywebsite.com/products&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might wonder why is this looking like a GET route, well, it just LOOKS like it, but it behaves differently. Whilst a GET request will only display a form, a POST request will process the input values and enable CRUD actions.&lt;/p&gt;




&lt;p&gt;A &lt;em&gt;PATCH&lt;/em&gt; route should look like: &lt;br&gt;
&lt;a href="http://www.mywebsite.com/items/3"&gt;www.mywebsite.com/items/3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Again, you'd think that we need the "/edit" but we don't. That '/edit' is only needed in the GET request, when we're displaying the updating form.&lt;/p&gt;

&lt;p&gt;What PATCH does, it updates our (let's say) Item object, only with the specific parameters we're asking for, it doesn't recreate the whole object like a PUT request would do.&lt;/p&gt;




&lt;p&gt;A &lt;em&gt;DELETE&lt;/em&gt; route should look like: &lt;br&gt;
&lt;a href="http://www.mywebsite.com/items/3"&gt;www.mywebsite.com/items/3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we're deleting the specified source from the server. Nothing to see, move along! &lt;/p&gt;




&lt;p&gt;You can see that we're following a clean pattern of routes here. A convention that is explicit to the user, that is easier to debug, easier to follow and also understand as there's a lot of documentation on it.&lt;/p&gt;

</description>
      <category>rest</category>
      <category>restful</category>
      <category>http</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How you can effortlessly improve your pseudo-coding in 2 minutes! </title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Sun, 12 Jan 2020 03:40:39 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/how-you-can-effortlessly-improve-your-pseudo-coding-in-2-minutes-373</link>
      <guid>https://dev.to/swishyfishie2/how-you-can-effortlessly-improve-your-pseudo-coding-in-2-minutes-373</guid>
      <description>&lt;p&gt;Flashy title, I know.&lt;br&gt;
Before revealing this secret, let's do a quick recap on what a function is.&lt;/p&gt;

&lt;p&gt;A function is a piece of code that runs whenever you want it to run without writing the whole code from scratch. You write it once(very unlikely), you save it and then call it when it's needed. &lt;/p&gt;

&lt;p&gt;More complex functions take in parameters to operate and solve a particular problem. &lt;/p&gt;




&lt;p&gt;Cool, now that you know what a function is, let's go through this scenario:&lt;/p&gt;

&lt;h3&gt;
  
  
  It's Tuesday morning and you just woke up.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Url6By9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.kym-cdn.com/photos/images/newsfeed/001/345/823/ac2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Url6By9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.kym-cdn.com/photos/images/newsfeed/001/345/823/ac2.png" alt="My disappointment is immeasurable and my day is ruined meme" width="500" height="383"&gt;&lt;/a&gt;&lt;br&gt;
Whilst heading towards your local independent coffee shop, you see that you received a letter. &lt;strong&gt;What could it be?!&lt;/strong&gt; &lt;br&gt;
It's a bill of course, because who writes letters nowadays? Your grandma stopped writing when you installed Facebook on her phone so that's that. &lt;br&gt;
That bill is overdue and it's way more than you can afford to pay right now.&lt;br&gt;
You have two options: Cry and tweet about it &lt;strong&gt;OR&lt;/strong&gt; think about solutions.&lt;/p&gt;

&lt;h3&gt;
  
  
  There's one obvious choice here.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hAhKZWtF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://m.quickmeme.com/img/98/98eeb11d3492884796379199b37d90853111df58bc0e10a7cfff41ef0bc2c010.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hAhKZWtF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://m.quickmeme.com/img/98/98eeb11d3492884796379199b37d90853111df58bc0e10a7cfff41ef0bc2c010.jpg" alt="One does not stop tweeting meme" width="493" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...so after you wiped your tears and deleted that backfiring tweet, you remember that the "bill people" are reasonable enough to let you pay it in installments.&lt;br&gt;
You also remember that you have a relative that needs a website and you know for a fact that that's the best way to do business. &lt;strong&gt;With friends and relatives.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You call the "bill people" and arrange something that works for you.&lt;br&gt;
Things seem to have worked out. Now the only things needed are you to work on that website and respect the bill arrangement. &lt;/p&gt;

&lt;h3&gt;
  
  
  Problem solved.
&lt;/h3&gt;

&lt;p&gt;How is this relevant? &lt;/p&gt;

&lt;p&gt;Well let's break it down really quick:&lt;/p&gt;

&lt;p&gt;Problem appears&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cry, tweet and regret&lt;/li&gt;
&lt;li&gt;Looking for tools to solve the problem&lt;/li&gt;
&lt;li&gt;Finding a way to earn money&lt;/li&gt;
&lt;li&gt;Negotiating an arrangement&lt;/li&gt;
&lt;li&gt;Build the website&lt;/li&gt;
&lt;li&gt;Pay the bill&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Problem disappears&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PdIYapBz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://memecrunch.com/meme/17N4I/no-problem/image.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PdIYapBz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://memecrunch.com/meme/17N4I/no-problem/image.jpg" alt="No problem meme" width="555" height="729"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This my friend, is a real life function and ta-daaaa, you're doing pseudo-coding in real life. &lt;/p&gt;

&lt;p&gt;When it comes to coding, people seem to dive head-first into the deep end. That unfailingly triggers the impostor syndrome making you feel that you know nothing about coding. &lt;br&gt;
Syntax is very important but syntax is out there on google. &lt;br&gt;
You have everything you need inside your head. &lt;br&gt;
Write or at least think about a plan on how to approach your coding problem and only after you're satisfied with it, &lt;strong&gt;ONLY THEN&lt;/strong&gt; you should start writing code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro tip&lt;/strong&gt;: after your pseudo-code, write down what kind of syntax would you need to look for. You have a list of items that is probably an array? Well you could look for array methods that could help you and so on.&lt;/p&gt;

&lt;p&gt;Happy coding and remember that pseudo-coding is not something you have to learn. It's something you do on a day-to-day basis. &lt;/p&gt;

&lt;p&gt;You just call it overthinking. :D &lt;/p&gt;

&lt;p&gt;Happy coding and spread love.&lt;/p&gt;

</description>
      <category>pseudocoding</category>
      <category>100daysofcode</category>
      <category>motivation</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>My 10 months of coding or how to print 'hello world' and call it a startup</title>
      <dc:creator>Swishyfishie</dc:creator>
      <pubDate>Fri, 29 Nov 2019 01:05:10 +0000</pubDate>
      <link>https://dev.to/swishyfishie2/10-months-of-coding-or-how-to-print-hello-world-and-call-it-a-startup-1pbb</link>
      <guid>https://dev.to/swishyfishie2/10-months-of-coding-or-how-to-print-hello-world-and-call-it-a-startup-1pbb</guid>
      <description>&lt;p&gt;I started coding out of a random ad for a HTML&amp;amp;CSS course. Thank you mind-reading ads - I didn't even know that coding is going to fit me like a glove. A glove without finger-holes. In the summer.&lt;/p&gt;

&lt;p&gt;And because I love coding so much, I'm going to give you my do's and don'ts, that I wish I was aware of while doing all this...&lt;/p&gt;




&lt;h2&gt;
  
  
  In the first months
&lt;/h2&gt;

&lt;p&gt;Yes: Get an Udemy course. Create a Twitter account. Do the #100daysOfCode challenge. &lt;br&gt;
No: Get 10 Udemy courses. Be pressured by the #100DaysOfCode challenge.&lt;/p&gt;

&lt;p&gt;I think that the first month was the one that decided I'm going to stick to coding and it was mainly because of the community I found on Twitter. Highly recommend to connect to as many devs you can. Just don't be weird about DM's and stuff.&lt;/p&gt;

&lt;p&gt;People need to feel that they belong somewhere and that's why the #100DaysOfCode challenge has so much success. It's an amazing tool that will connect you to people around the globe which are on the same journey as you and you'll find that struggle, despair, and doubt are normal when learning something hard like coding. &lt;br&gt;
You're not alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're picking up web development, don't limit yourself to HTML&amp;amp;CSS!&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Add JavaScript or Python on your studying list.&lt;/strong&gt; &lt;br&gt;
&lt;strong&gt;Trust me, the sooner you start learning one of those, the better!&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A couple of months later
&lt;/h2&gt;

&lt;p&gt;Yes: Get a coding buddy. Do projects with them. &lt;br&gt;
No: Cry over coding buddies. &lt;/p&gt;

&lt;p&gt;Having a coding buddy is crucial to your dev life as you'll have to work in teams. There will be many people on the same level especially in the twitter dev community just make sure to reach out in a mindful way. The key aspect in this whole coding-buddy experience is not to cling on to one person and learn how to overcome the fails. You do get a lot of experience points when you fail though, so keep that in mind. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Some people struggle with self-confidence and the infamous impostor syndrome&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;JavaScript or Python will work the same whether your're feeling good about yourself or not. Getting out of that "I'm not good" mindset once in a while does wonders and you can do it with mindfulness or just writing down how you feel for 2-3 minutes a day.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A few good months later-er
&lt;/h2&gt;

&lt;p&gt;Yes: Start to learn a second programming language. Give back to the community. Create your "Hello world" startup.&lt;br&gt;
No: Not looking back on a regular basis to see how far you went!&lt;/p&gt;

&lt;p&gt;Since programming concepts are more or less the same and it's mostly the syntax which is different, learning a second programming language is an eye opener and will definitely solidify the concepts you already knew. &lt;/p&gt;

&lt;p&gt;There's tons of way to give back to the community. People are constantly asking questions and need help or guidance so go ahead and reply to the #codenewbie, #helpmecode or #100DaysOfCode questions. &lt;/p&gt;

&lt;h3&gt;
  
  
  What's a "Hello world" startup?
&lt;/h3&gt;

&lt;p&gt;"Hello world" is the first thing that 99%* of the programmers wrote when they first coded and it probably generated the greatest feelings of accomplishment. &lt;/p&gt;

&lt;p&gt;Now apply the "Hello world" concept to your personal journey and you'll find yourself starting up things. Start a weekly zoom meeting, a twitch stream of you solving codewars exercises, a youtube tutorial series or a blog. &lt;/p&gt;

&lt;p&gt;These things aren't unique and most coders do them and you may ask yourself why to do something that's already over-done(is this a word?). Because in our times it's sensible that our actions should be in the benefit of others too and no matter your level, you can always teach or inspire someone. And ultimately because it's fun!&lt;/p&gt;

&lt;p&gt;Yep, coding should be fun. If it isn't, stop and reconsider things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;No more pro tips, you're the pro now&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*statistic that is purely fictional, created for the dramatic effect &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>firstyearincode</category>
    </item>
  </channel>
</rss>
