<?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>Forem: harleypadua</title>
    <description>The latest articles on Forem by harleypadua (@harleypadua).</description>
    <link>https://forem.com/harleypadua</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%2F351143%2F35d8601f-39e0-4b12-b980-e10762587a0e.jpg</url>
      <title>Forem: harleypadua</title>
      <link>https://forem.com/harleypadua</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/harleypadua"/>
    <language>en</language>
    <item>
      <title>Quick Intro to Bootstrap</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 01 Jun 2020 01:28:01 +0000</pubDate>
      <link>https://forem.com/harleypadua/quick-into-to-bootstrap-22i</link>
      <guid>https://forem.com/harleypadua/quick-into-to-bootstrap-22i</guid>
      <description>&lt;p&gt;When it comes to styling the font end, there are a lot of options. Should you stick with CSS and HTML for full control and endless challenge or pick up a styling library for easy ebb and flow? If you're here, I'm guessing you picked the latter! Great choice, CSS can become extremely cumbersome. Let &lt;a href="https://getbootstrap.com/docs/4.5/getting-started/introduction/" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt; carry you to success! Installation is simple, just run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;bootstrap&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bootstrap is a very popular front-end design framework. Originally called Twitter Blueprint, it was designed by Mark Otto and Jacob Thornton over at Twitter. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd33wubrfki0l68.cloudfront.net%2Fb251cd27c086fb74091dcbbdad080b090a1b787f%2F1cd33%2Fen%2Fblog%2Fuploads%2Fcoding-all-in-one-mark-otto-jacob-thornton.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd33wubrfki0l68.cloudfront.net%2Fb251cd27c086fb74091dcbbdad080b090a1b787f%2F1cd33%2Fen%2Fblog%2Fuploads%2Fcoding-all-in-one-mark-otto-jacob-thornton.jpg" alt="Mark Otto(left) and Jacob Thornton(right)"&gt;&lt;/a&gt;It is designed to be a responsive, mobile-first CSS framework. And although right now Bootstrap on its own depends on jQuery to power certain UI components, Bootstrap 5, which is the next version to be released, will be dropping jQuery entirely in favor of vanilla Javascript! A library that is not only kept up, but is also releasing new versions? A luxury.&lt;/p&gt;

&lt;p&gt;Ignore for a second that I said Bootstrap still uses jQuery. Not only is Bootstrap free, but it also has some state-of-the-art features. According to &lt;a href="https://www.wappalyzer.com/technologies/ui-frameworks/bootstrap" rel="noopener noreferrer"&gt;wappalyzer&lt;/a&gt;, over 4,888,000 websites use it to design their interfaces, the most notable sites being companies such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NBA&lt;/li&gt;
&lt;li&gt;Target&lt;/li&gt;
&lt;li&gt;Bloomberg Business&lt;/li&gt;
&lt;li&gt;and even Walmart!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And it is popular for a reason. The advantages include a responsive grid, a multitude of components, eloquent documentation, customization, and much more. As I stated before, diving into HTML and CSS can get real messy, real fast. Bootstrap has you covered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;row&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;col-sm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;column&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;col-sm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;column&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;col-sm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;column&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing I learned was that making a website look like a website is actually really quite tricky. Making columns and rows is a good place to start. And with Bootstraps flex grid capabilities, you can move your columns around to create the skeleton for your website easily. Paired with their readily available stylesheet, you can even let them handle the CSS.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.postimg.cc%2FXvHmMvYM%2Fexample.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.postimg.cc%2FXvHmMvYM%2Fexample.png" alt="Example Bootstrap Columns"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are building your app with React (my favorite JavaScript library), you can install React-Bootstrap instead. React-bootstrap is probably the most popular library for adding Bootstrap components into React. There’s also reactstrap and React UI, but in my opinion it all boils down to what’s easiest to install and use! To set up React-Bootstrap run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;bootstrap&lt;/span&gt; &lt;span class="nx"&gt;bootstrap&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Like most React elements, you'll need to import the components you wish to use like Button or Alert. They also provide CSS. To achieve the same column effect as before with HTML divs, instead you can use the Col component like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Row&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Col&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Col&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Row&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Container&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bootstrap can allow you to easily make something like my example quickly, without fighting with HTML for hours. Of course, this is just a small tease of what you can do with Bootstrap. Get started and see how creative you can be using this flexible library!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>ReactJS vs React Native</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 25 May 2020 06:06:09 +0000</pubDate>
      <link>https://forem.com/harleypadua/reactjs-vs-react-native-5a28</link>
      <guid>https://forem.com/harleypadua/reactjs-vs-react-native-5a28</guid>
      <description>&lt;p&gt;When I first heard of React Native, I hardly new ReactJS. I remember thinking, "there's more than one?" The person who introduced it to me jumped right in, talking about how they were using it in their project and all of the features it came with. But it left me wondering how exactly it was different from what I'd learned in ReactJS. And now that I am actually working with it for my own project, the question came up again from one of my peers. So for anyone else wondering the difference between ReactJS and React Native, I am going to attempt to address the main distinctions.&lt;/p&gt;

&lt;h3&gt;
  
  
  ReactJS
&lt;/h3&gt;

&lt;p&gt;Let's start with a brief touch up on ReactJS. React is a component-based JavaScript library for building user interfaces. Created by Facebook, it's meant to be an easy way to build single-page applications. ReactJS was open-sourced in May of 2013, making it 7 years old! Happy Birthday, React. How "easy" you are really is in the eye of the developer, though. Anyway, this is basically what a React component looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;ShoppingList&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shopping-list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Shopping&lt;/span&gt; &lt;span class="nx"&gt;List&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Instagram&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;WhatsApp&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Facebook&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ShoppingList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A standard shopping list component with some HTML elements we all know and love(?).&lt;/p&gt;

&lt;h3&gt;
  
  
  React Native
&lt;/h3&gt;

&lt;p&gt;React Native is a JavaScript framework for writing real, natively rendering mobile applications for iOS and Android. "Native" meaning web developers can write directly to the device using JavaScript. Normally, in order to write an iOS application, you'd have to learn Swift or Objective C. With Android, Kotlin or Java. I don't have time to be learning a whole new language right now, so React Native can be real beneficial.&lt;/p&gt;

&lt;p&gt;So after that, it might seem like you would just naturally transition from ReactJS to React Native to shift from being a web browser developer to a mobile developer. But in actuality, you don't need to learn ReactJS at all before jumping into React-Native. It &lt;em&gt;can&lt;/em&gt; help, but many developers skip it entirely (depending on what they plan on working on, like mobile vs browser).&lt;/p&gt;

&lt;h3&gt;
  
  
  Different Characteristics
&lt;/h3&gt;

&lt;p&gt;Let's take a look at the main differences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//ReactJS&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
  &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;25px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;flexDirection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;column&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//React Native&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;Native&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;These two examples show the same thing.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;With react, you can pretty much use any HTML stuff in the components. Obviously the styling object is a little different, but you can also have a CSS file to style however you’re comfortable with. But basically all HTML will also be valid React code.&lt;/p&gt;

&lt;p&gt;With React Native, you cannot use any HTML. Instead, we use a View. So while a div is a container that you can do whatever you want with in terms of styling, a View is that in React Native.&lt;/p&gt;

&lt;p&gt;In HTML there are many ways to put text on the screen, header or p for example, that determines default styling or lets the browser know what kind of text it is.&lt;/p&gt;

&lt;p&gt;React Native just has Text. And you need to import both View and Text because they are not available by default. This is because React Native is platform agnostic. It doesn't know if you're developing for iOS or Android (and it doesn't care). There’s no built in styling, so you would have to style Texts to differentiate them.&lt;/p&gt;

&lt;p&gt;The styling is different as well. There’s no need for px and % for dimensions, for the value to be in a string, or anything like that, and by default React Native uses display flex and flexDirection column since it’s for a mobile screen. (ReactJS is by default flexDirection row for web browsers)&lt;/p&gt;

&lt;p&gt;So to wrap it up, ReactJS is mainly used when you want to build a website that will run in a browser. React Native is used when you want to build something that runs on a mobile device. Technically you &lt;em&gt;could&lt;/em&gt; use ReactJS for mobile development and vice-versa, but, like, don't do that to yourself. &lt;/p&gt;

&lt;p&gt;Hope this cleared up any questions you had, and if you know something that I didn't add, make sure to tell me! I'm still learning as well, and thanks for reading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Google Authentication with Expo and React-Native</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 18 May 2020 07:11:32 +0000</pubDate>
      <link>https://forem.com/harleypadua/google-authentication-with-expo-and-react-native-2l24</link>
      <guid>https://forem.com/harleypadua/google-authentication-with-expo-and-react-native-2l24</guid>
      <description>&lt;p&gt;I had to work with Expo's Google Authentication this week and I found a lot of outdated information while integrating it into my React Native app. So I thought I'd make an updated tutorial for anyone looking to use this Expo feature on future projects.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.expo.io/versions/latest/sdk/google/"&gt;Expo documentation&lt;/a&gt; is mostly good. I'll get into that in a bit, but first, the important stuff. &lt;/p&gt;

&lt;p&gt;Sadly, Expo cannot handle the permissions with Google, so we'll need to do that ourselves. Head over to &lt;a href="https://console.developers.google.com/"&gt;Google developers&lt;/a&gt; and create a new project. Give your project a name and click "create". Now we can get some credentials. From here, click Credentials on the side bar and then, at the top of the screen, Create Credentials. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--89IrIk8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/LXB59ZjS/googleauthcredentials.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--89IrIk8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/LXB59ZjS/googleauthcredentials.png" alt="credentials screen"&gt;&lt;/a&gt; You'll want to select OAuth client ID, but when you do, you'll notice you won't be able to select your application type until you configure consent screen. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l1Jfb1Wn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/5Nf72dWW/consent-screen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l1Jfb1Wn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/5Nf72dWW/consent-screen.png" alt="create OAuth client ID"&gt;&lt;/a&gt; Go ahead and click that. It'll bring you to the OAuth consent screen (duh) where you can choose user type. It feels like they try to scare you with these options, but I still chose External. Give the application a name, skip everything else (even that application logo. I know, it's so tempting), and hit Save.&lt;/p&gt;

&lt;p&gt;Okay, now that we got that out of the way, back to credentials. You'll be able to select your application type now. For the purpose of this tutorial, I'll be using iOS, though the other types only require a few different steps. Google provides you with a name for the client ID which is fine to keep. For Bundle ID, make sure you put host.exp.exponent since we're using Expo. Once that's done you should get your client ID. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eJPAzBKX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/dQRFfYjb/clientID.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eJPAzBKX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/dQRFfYjb/clientID.png" alt="client ID"&gt;&lt;/a&gt; Copy and paste it somewhere for safe keeping, we'll need this. &lt;/p&gt;

&lt;p&gt;Time to code! And now I can touch on one small annoyance. You'll want to install expo-google-app-auth and import it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as Google from 'expo-google-app-auth';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 This is also in their docs, however, after we've got this authentication actually set up, you WILL get a warning telling you to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Expo&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;expo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 instead. When I tried switching, the authentication did not work. So, I have a fix for this annoying yellow box. Simply add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ignoredYellowBox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Warning:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 anywhere in your code (preferably the root of the app, like App.js or index.js) to hide the warning. Make sure to import react as well as View, StyleSheet, and Button from react-native.&lt;/p&gt;

&lt;p&gt;To implement the Google Sign In, you can copy straight from the docs. Now is the time to add your iOS client ID (or whatever one you chose) to your code via .env or some way to keep it private. Your code should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-gesture-handler&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;StyleSheet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Google&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;expo-google-app-auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;IOS_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;AND_CLIENT_ID&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;LoginScreen&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;signInWithGoogleAsync&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logInAsync&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;iosClientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;IOS_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c1"&gt;//androidClientId: AND_CLIENT_ID,&lt;/span&gt;
        &lt;span class="na"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;profile&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;

      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cancelled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next annoyance: You may have noticed that this function is a promise, and therefore won't be able to be passed to a button just yet. Alter it for that purpose or, for a lazy fix, pass it to another function to then pass to a button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;signInWithGoogle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;signInWithGoogleAsync&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;signInWithGoogle&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sign in with Google&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And we're done! All that's left is to add a little style and your app has functioning Google Authentication. Hope this helps and thanks for reading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>reactnative</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Web Design Basics</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 11 May 2020 04:29:39 +0000</pubDate>
      <link>https://forem.com/harleypadua/web-design-basics-537p</link>
      <guid>https://forem.com/harleypadua/web-design-basics-537p</guid>
      <description>&lt;p&gt;On a recent social app I worked on with my peers, we were a bit chewed out for our rather bright colors and design. Described as "hard on the eyes" and "inconsistent", I have been reflecting. What makes a good website? Looking at the most popular social media apps like Facebook and Twitter, maybe it is the color blue? So let's get to the basics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Font
&lt;/h2&gt;

&lt;p&gt;Ah, typography. Since reading is a huge part of user interaction online, it is arguably the most important part of web design. Choosing a font might seem pretty straightforward, but lets touch on a few things. First, Sans Serif. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X7CBWdUQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/cCsr0dvG/serifvssanserif-P3a-720x350-jpg-img.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X7CBWdUQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/cCsr0dvG/serifvssanserif-P3a-720x350-jpg-img.jpg" alt="Sans Serif"&gt;&lt;/a&gt; Sans Serif fonts (left T in picture) are contemporary fonts without decorative finishes. They are easier to read online than the flashy stuff. If you think being creative with a loopy font will make you stick out, think again. Ultimately, you should be putting the user first. The average person spends about &lt;a href="https://www.telegraph.co.uk/news/2018/08/01/decade-smartphones-now-spend-entire-day-every-week-online/"&gt;40&lt;/a&gt; hours a week online, but if your website is an eyesore, they'll be clicking away. &lt;/p&gt;

&lt;p&gt;Which brings me to my next point: font size. Body fonts should be at least 16px, but of course some fonts may appear smaller even at the same size. This is a good place to start, however, leaving adjustments up to you; keep in mind that reading something on your phone should be as readable as the text in a well-printed book. Secondary font can be smaller, but I don't recommend going lower than 13px.&lt;/p&gt;

&lt;h2&gt;
  
  
  Color
&lt;/h2&gt;

&lt;p&gt;This is my favorite one. You probably already know what colors not to pick, like bright, neon colors that are hard on the eyes. But did you know colors can actually invoke feelings? Color Psychology is immensely interesting. The way people react to color is closely interwoven with subconsciousness. Maybe you had an accident and now find you dislike the color red? Or how you might associate one shade of green with illness and another with nature. (Try &lt;a href="https://html-color-codes.info/colors-from-image/"&gt;this&lt;/a&gt; website for picking color straight from an image to avoid shooting in the dark)&lt;/p&gt;

&lt;p&gt;Studies have shown that the younger a person is, the more likely they will prefer more saturated colors, while older people prefer less saturated, lighter colors. I find this particularly fascinating when considering major brands.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D4AN48Tl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AtphoNit3ePGGefFuHP7AvQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D4AN48Tl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AtphoNit3ePGGefFuHP7AvQ.jpeg" alt="brands"&gt;&lt;/a&gt; Of course, there's no need to stick to one color. Complementary colors create balance and harmony. Using contrasting colors for text and background make it easier to read. Even white space can be effective for giving a website a sleek, modern look.&lt;/p&gt;

&lt;h2&gt;
  
  
  "F" Pattern
&lt;/h2&gt;

&lt;p&gt;Most people read from left to right. However, when it comes to the internet, it's more likely that people are "scanning" rather than "reading". Because of this reading behavior, it's good practice to build your website in a visual hierarchy: conventionally, the "F" shape. Most of what people see is in the top left of the screen; the right side is rarely "seen". Work with their natural disposition and display information in order of importance: Left to right, and top to bottom.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9mKn0_xl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.eyequant.com/hubfs/Screen%2520Shot%25202017-09-04%2520at%252016.46.17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9mKn0_xl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.eyequant.com/hubfs/Screen%2520Shot%25202017-09-04%2520at%252016.46.17.png" alt="F pattern"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's the basics! Remember these principles when you get started and you should have a pleasing site! If you like laughing at bad design like I do, check out &lt;a href="https://www.reddit.com/r/CrappyDesign/"&gt;Crappy Design&lt;/a&gt; on Reddit!&lt;/p&gt;

</description>
      <category>design</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The impact on Big Tech by COVID-19</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Sun, 03 May 2020 23:36:01 +0000</pubDate>
      <link>https://forem.com/harleypadua/the-impact-on-big-tech-by-covid-19-knd</link>
      <guid>https://forem.com/harleypadua/the-impact-on-big-tech-by-covid-19-knd</guid>
      <description>&lt;p&gt;With the announcement that General Electric Co. is closing its New Orleans location, sending over 100 people into unemployment during the pandemic, I have been feeling a little apprehensive about the future of the tech industry as a whole. It is easy to feel uncertain about how the world is changing. The emergence of "essential" vs "non-essential" workers may be leaving many people unsure of where their skills will be needed any time soon. So to my fellow developers, I decided to check in on how Big Tech will be coming out of this crisis. (And it's looking good!)&lt;/p&gt;

&lt;p&gt;Since this is meant to be uplifting, I wanted to start with, what is in my opinion, the most exiting turn of events. Technological advancements in the last 10 years have always been met with widespread &lt;a href="https://www.theverge.com/interface/2020/3/26/21193902/tech-backlash-covid-19-coronavirus-google-facebook-amazon"&gt;backlash&lt;/a&gt; in one way or another, whether it be from people refusing to adapt to those changes, feel they are being left behind, upset over how their work life has been altered, or any combination of these things. However, because of social distancing and stay-at-home ordinances, many people are picking up tech they never used before, resulting in an overhaul of opinion. Ah, to see my parents finally admit that being on my phone all the time doesn't mean I'm being antisocial! Not really, but maybe some day real soon!&lt;/p&gt;

&lt;p&gt;With millions of people on semi-enforced lock down, we've also seen a &lt;a href="https://www.nytimes.com/interactive/2020/04/07/technology/coronavirus-internet-use.html"&gt;boom&lt;/a&gt; in video chatting services. Social interactions like business meetings, classroom learning or even chatting with in-laws have been completely transformed into virtual settings. According to Bernstein Research and Apptopia, the daily downloads of Zoom alone have increased 30x, shooting to 200 million daily users in March, up from 10 million just this last December. I can't help but think about all the issues this could solve once we've come out on the other end of this pandemic: people who don't have access to transportation now able to work at home, children too far from any good schools able to tune in long-distance style, or maybe even a program that allows elders in care facilities to interact with people online. Because these online video services have become "essential", I am excited to see how that translates into the future.&lt;/p&gt;

&lt;p&gt;The changes in consumer behavior don't stop there. Amazon's grocery delivery service is one thing in particular that has become increasingly popular. As more customers try different Amazon services, they may create permanent shifts in buying habits, said Guru Hariharan, a former Amazon employee and the founder of CommerceIQ, a company whose automation software is used by major brands like Kellogg’s and Kimberly-Clark. I've mentioned before I worked at Target prior to pursuing programming, and I have personally seen disapproval for services such as this. Target has ownership of a company called Shipt, which has people in the store shopping from a virtual grocery list sent in via their app from Target shoppers. Both employees and shoppers alike had their fair share of negative opinions on the service, but now? People are hesitant to shop in person due to the risk and now such services are life-savors. &lt;/p&gt;

&lt;p&gt;Another stay-at-home service that has seen an increase, unsurprisingly, is Netflix. A 9 percent bump, in fact. YouTube has seen some influx of viewership as well with people looking to be productive in quarantine. According to YouTube, they have experienced a 210% increase in average daily views of videos with “home office” in the title since March 15. Cooking videos have had a 100% increase, and work out and self improvement videos have seen a 515% increase. So many people using tech to pick up new skills is certainly cool to see.&lt;/p&gt;

&lt;p&gt;Many people turn to Facebook for news in times of crisis and as a distraction while working from home. Mark Zuckerberg has reported voice calling on Facebook's WhatsApp and Facebook Messenger have doubled in use. And interestingly enough, he is looking for ways to connect people even more efficiently. Facebook, wanting to add to the virtual presence market, plans on releasing &lt;a href="https://www.theverge.com/facebook/2020/4/24/21234538/mark-zuckerberg-interview-video-chat-messenger-rooms-video-evolve"&gt;Messenger Rooms&lt;/a&gt;, which allows you to create a room in Facebook or Facebook  Messenger and invite up to 50 people to join, even if they do not have a Facebook account.&lt;/p&gt;

&lt;p&gt;With the shift to virtual and so many people using these services for the first time, I find that the need for programmers will most likely increase as a result. Developing new technology or maintaining what has become an essential part of business falls to us! So, despite how rocky many of your situations have become, hang in there, and look forward to a changed world!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>[Detrimental] Mindset</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 06 Apr 2020 04:29:08 +0000</pubDate>
      <link>https://forem.com/harleypadua/detrimental-mindset-3404</link>
      <guid>https://forem.com/harleypadua/detrimental-mindset-3404</guid>
      <description>&lt;p&gt;When I was young, I was told that if I went to college, I'd get a good job. Like it was a vending machine: put in a degree and money will fall out. This wasn't really the case for me. Half of that reason being that the industry I studied died out in my hometown and I didn't have the financial ability to chase it. But mostly because I didn't know a college degree didn't guarantee success.&lt;/p&gt;

&lt;p&gt;This left me feeling very stuck, and I had to do some serious self reflecting to figure out where exactly I wanted to go in life (huge existential crisis, I know). I was working in retail and I &lt;em&gt;hated&lt;/em&gt; it. I knew I couldn't allow myself to just settle, there had to be something else I could pursue.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tech field is guaranteed employment, right?
&lt;/h2&gt;

&lt;p&gt;I've always known that I've wanted to work with technology, but that's such a broad term that I couldn't really pin down a place to even start looking. I toyed with the idea of going back to college to study computer science, but the idea of spending another 4+ years to get a completely different degree felt like a huge setback.&lt;/p&gt;

&lt;p&gt;Then I heard about a coding boot camp called Operation Spark. I had zero experience with anything coding related, unless playing around with HTML on Myspace counts, so I didn't really know what I was getting into. &lt;/p&gt;

&lt;h2&gt;
  
  
  I don't want to say it was Hell, but...
&lt;/h2&gt;

&lt;p&gt;In my educational career, I guess you could say learning came easy. I made good grades without having to pull all-nighters, hardly ever needed study sessions, and went into exams with utmost confidence.&lt;/p&gt;

&lt;p&gt;Going through this program was like a slap in the face. Coding is &lt;em&gt;hard&lt;/em&gt;. And it was both in the way I anticipated (learning, essentially, a new language) and in a way I didn't (doing the work won't be enough to get by). Granted, most people study and practice for years and I've only been in this program a few months, but that's not what I think about everyday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's talk impostor syndrome
&lt;/h2&gt;

&lt;p&gt;There are 5 types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The perfectionist&lt;/li&gt;
&lt;li&gt;The superwoman/man&lt;/li&gt;
&lt;li&gt;The natural genius&lt;/li&gt;
&lt;li&gt;The soloist&lt;/li&gt;
&lt;li&gt;The expert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.themuse.com/advice/5-different-types-of-imposter-syndrome-and-5-ways-to-battle-each-one"&gt;Which one are you?&lt;/a&gt; I fall into that natural genius category. I thought I could just go with the flow (as per my usual attitude) and find I'm pretty good at this along the way. That never happened. Not once did I feel like I had a solid understanding on any topic, regardless of what my instructors and peers would tell me. It's like being in a perpetual state of tip of the tongue. The information is there, but doesn't come easy.&lt;/p&gt;

&lt;p&gt;Coding is a constant challenge that I have to push myself to face, and it's hard not to think, &lt;em&gt;wow, I'm so stupid, how did I even get this far&lt;/em&gt;. Despite my success in the program, every time I stare at my screen in tearful frustration, completely lost because &lt;em&gt;I don't know what to do&lt;/em&gt;, it's difficult not to feel like I should just give up entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  In the end
&lt;/h2&gt;

&lt;p&gt;It doesn't even matter. The anxiety I feel, the uncertainty I can't shake? &lt;em&gt;Everyone&lt;/em&gt; has been there. Part of my struggle has been to remind myself that I'm not alone. That I have only been learning this for a short while and it's going to take a lot more time for me to stop feeling so lost all the time. &lt;/p&gt;

&lt;p&gt;Hopefully, in sharing my frustrations, you will benefit from it and recognize when impostor syndrome might be settling in. It's going to be an uphill battle, especially when starting out, but fight it all the same.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Need to Make a Simple List? Try Backbone!</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 30 Mar 2020 00:33:50 +0000</pubDate>
      <link>https://forem.com/harleypadua/need-to-make-a-simple-list-try-backbone-7kk</link>
      <guid>https://forem.com/harleypadua/need-to-make-a-simple-list-try-backbone-7kk</guid>
      <description>&lt;p&gt;Last week I talked about &lt;a href="https://dev.to/harleypadua/separate-them-concerns-24nf"&gt;separation of concerns&lt;/a&gt; and why it's important when you start building apps. One way this is achieved is by using frameworks, like Backbone. Backbone is basically a lightweight framework that allows you to structure your JavaScript code in a Model View fashion where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model is an object that represents the data and associated methods. &lt;/li&gt;
&lt;li&gt;View is responsible for rendering data to the user and has event handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To get started, any organized coder would set up their main file with the data that will make up the list. Usually I call this file app. For this example we're going to make a list of cakes!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//here is our cake data&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;cakes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Strawberry Shortcake&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="cm"&gt;/* some info here */&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Gentilly Cake&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="cm"&gt;/* cake info here */&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tiramisu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="cm"&gt;/* some more info here */&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So rendering a list refers to taking a collection of data and displaying that info on the DOM of an application. Inside this file, we'll need to do three things:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. instantiate collection based on the Cakes model&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myBakery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Backbone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cakes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Cakes&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// 2. instantiate the collection view based on the collection myBakery&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;cakeView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;CakeView&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;myBakery&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// 3. append the bakeryView to the body of the HTML page you definitely made&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cakeView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You'll notice in step 1 I refer to a model called cakes but we haven't made that yet! That's the next step: set up a file that will be your model, which in this case will control the data for a single cake. That will look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;Cake&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Backbone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="c1"&gt;// default cake info&lt;/span&gt;
  &lt;span class="na"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Strawberry Shortcake&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;strawberry-shortcake-cake-thumb.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;Ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`1 1/2 pounds strawberries, stemmed and quartered,
                  5 tablespoons sugar,
                  2 cups all-purpose flour,
                  2 teaspoons baking powder,
                  1/4 teaspoon baking soda,
                  2 tablespoons sugar,
                  3/4 teaspoon salt,
                  1 1/2 cups heavy cream,
                  Whipped Cream`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="c1"&gt;// hungry? i am...&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally, create the view file (I called this cakeView in step 2). The cakeView controls the rendering of the entire bakery collection. So you start by creating a property that will handle the rendering of data to the DOM. For each new item, a new single cakeView is being instantiated based on the cakeModel. Then call the render function when this gets initialized to render it to the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;CakeView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Backbone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;table&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="c1"&gt;//renders each cake in our bakery collection on the cakeView&lt;/span&gt;
  &lt;span class="na"&gt;render&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;//looping through the cake data&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cakeModel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="cm"&gt;/* for each piece of data, passing the model containing the current cake's data
      to the cake view and appending to the table */&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;CakeView&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cakeModel&lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="c1"&gt;// on initialize, the view will render&lt;/span&gt;
  &lt;span class="na"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And that makes a list showing some cakes and how to make ‘em using Backbone. Pretty simple. In essence, Backbone provides comfortable options to structure code better. It’s simply about that.(And has great docs, can't fight me there!)&lt;/p&gt;

&lt;p&gt;For anyone who wants to say backbone is totally irrelevant &lt;a href="https://www.wappalyzer.com/technologies/javascript-frameworks/backbone-js"&gt;here&lt;/a&gt; is a list of sites still using it!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Separate them concerns</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 23 Mar 2020 02:17:00 +0000</pubDate>
      <link>https://forem.com/harleypadua/separate-them-concerns-24nf</link>
      <guid>https://forem.com/harleypadua/separate-them-concerns-24nf</guid>
      <description>&lt;p&gt;What is separation of concerns? And why should you concern yourself with separation? Well, I am going to try to break this concept down a bit. Separation of concerns is the (really great) idea that each module in a computer program should deal with only one feature or behavior and should not contain code that deals with other things. &lt;/p&gt;

&lt;p&gt;Realistically speaking, this makes total since. When working at your job, you are not expected to know every single thing about the company. Instead, you are solely responsible for your own role, the one you were hired for. In this way, it is easy to keep track of who is doing what to make the whole place run, right?&lt;/p&gt;

&lt;p&gt;You can think of your code in the same way. If your entire project is stored in a single file, how easy would it be to find out what each function is doing? The answer is that it would not be easy at all. It's hard enough to catch spelling errors, but to figure out which part of this massive file is doing the thing that might not be working now? This could generate some (more than some) frustration.&lt;/p&gt;

&lt;p&gt;The solution is to break down the application into smaller units of encapsulated functionality. You've probably done this already without realizing it. The most classic example of separation of concerns is having an HTML, CSS, and JavaScript file. These things all relate to each other, but often times having them all together in one file is clunky. It's so much easier divvying them up into their own files.&lt;/p&gt;

&lt;p&gt;But that JavaScript file by itself can get pretty ridiculous in length once you start laying down the blueprints for your amazing app. That's where design patterns come in. A design pattern is just a way of separating these files, and you can choose Model View Controller, Model View Adapter, or Model-View-ViewModel, just to name a few. Which one is best to use? That depends on you!&lt;/p&gt;

&lt;p&gt;Now, you might be thinking, "Why bother?" It's true that you can code away in a single file and get a fully functional app working. My point isn't really about functionality, though. This is more about organization, and what that means for the people you'll be working with, and the clients you'll be dealing with.&lt;/p&gt;

&lt;p&gt;When working on an application with a team, wouldn't you be frustrated if they had everything just thrown together willy-nilly, and you had to figure out what's going on and what each part of the code is doing? Most likely. In fact, I think we can agree no one would appreciate this scenario. &lt;/p&gt;

&lt;p&gt;A job in coding is complicated and stressful in its own right, there's no reason to make it harder for yourself. Let's think about this in a Model View Controller point of view for a second. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jemlDr9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/W48Dmdq5/httpatomoreillycomsourceoreillyimages2046613.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jemlDr9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/W48Dmdq5/httpatomoreillycomsourceoreillyimages2046613.png" alt="MVC"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If a user clicks a button on your app and nothing happens, we can pretty easily narrow down the problem, yes? A button a user can see and interact with in MVC is called a controller. So we can pretty confidently assume the button created in the controller file is where the problem is. The ease in which you can then debug the error is clear. And even if that wasn't where the problem was, following the trail from the controller to the view or to the model is just as simple. Staring at an all encompassing file to figure out where the button was defined and what it's supposed to be interacting with to make a change is in comparison, much less practical. &lt;/p&gt;

&lt;p&gt;So, do this for your own sake, and in doing so, the sake of everyone you will ever work with. It's a great practice for efficient coding, and will help cut your work in half when it comes to making changes and debugging.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Recursion Recursion Recursion</title>
      <dc:creator>harleypadua</dc:creator>
      <pubDate>Mon, 16 Mar 2020 00:27:00 +0000</pubDate>
      <link>https://forem.com/harleypadua/recursion-recursion-recursion-1501</link>
      <guid>https://forem.com/harleypadua/recursion-recursion-recursion-1501</guid>
      <description>&lt;p&gt;Coding has been a challenging journey, and in the beginning I really struggled with understanding this concept called Recursion. My name is Harley Padua, and I will attempt to unpack it a bit. But before I talk about what Recursion is, I recommend you read my first blog about Recursion &lt;a href="https://dev.to/harleypadua/recursion-recursion-recursion-1501"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fell for that? Then you've had your first taste of Recursion!&lt;br&gt;
 &lt;br&gt;
When I was introduced to this topic, I couldn't help but link it to one of my favorite movies: Inception. The film dealt with this idea of dream traversal, or more specifically, traversing a dream within a dream within a dream in order to retrieve information, with a kick to break out of the dream.&lt;/p&gt;

&lt;p&gt;Recursion is a function that calls itself to accomplish some goal, with a base case to break the loop. See the similarities? And much like Inception, this concept can be very confusing the first time around. So let's take a look at an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;shootGun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sound&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here we have a function called shootGun that takes two parameters: a string that represents a sound the gun makes and a number of times we want to shoot.&lt;/p&gt;

&lt;p&gt;So first things first: a base case. I mentioned that a base case is what will end the recursive function. Without a thorough one, the function will run on forever and nobody wants that. So, let's think on it. We know a gun will only fire as many times as the trigger is pulled. So if there are no more pulls to the trigger, the gun will stop firing. Since num represents this concept, our code should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When we have no more shots, we want to return an empty string, since there is no sound to account for. Next is the recursive case. We know we need to have a return statement because functions default to undefined without one. Call the function with it's parameters. Since our base case checks for when num is less than or equal to 0 in order to make sure our function doesn't run on forever, we have to make sure we decrease num so that it will reach that qualification.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;shootGun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sound&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Okay, great! But we are missing something. As it is now, this function isn't doing anything with the sound parameter. Each time the function is called, it just decreases the number, but we want it to print the sound the gun makes as many times as we fire. In order for that to happen, we have to save sound, and add it to each function call. Put it all together and it should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;shootGun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sound&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sound&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;shootGun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sound&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we have a rootin', tootin', gun shootin' recursive function! If we call the function with 'bang' for the sound and '3' for the number, the function will return 'bang bang bang'! And I'll impart some knowledge that helped me a lot when it came to building more complicated recursive functions: just assume your function is working. As long as your base case is thorough enough to reach a conclusion, play around with your code and see what recursion can do. &lt;/p&gt;

&lt;p&gt;Hopefully this has helped shed a little light on what recursion is, and thank you for reading my very first blog!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
