<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Madeline Stalter on Medium]]></title>
        <description><![CDATA[Stories by Madeline Stalter on Medium]]></description>
        <link>https://medium.com/@madelinestalter?source=rss-b6d4f3aa08e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cMN00R-lb_XSKI-72Bu_9Q.jpeg</url>
            <title>Stories by Madeline Stalter on Medium</title>
            <link>https://medium.com/@madelinestalter?source=rss-b6d4f3aa08e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:17:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@madelinestalter/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Boogie Man of Interviewing: Technical Assessments Part 1]]></title>
            <link>https://madelinestalter.medium.com/the-boogie-man-of-interviewing-technical-assessments-part-1-ca4c6c8d89fd?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca4c6c8d89fd</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[coding-interviews]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 00:40:23 GMT</pubDate>
            <atom:updated>2021-03-17T00:40:23.169Z</atom:updated>
            <content:encoded><![CDATA[<p>I firmly believe that technical assessments are a critical part of the interview process. It allows us to “put all our cards on the table” early on; being efficient with both the candidate and the employer’s time. However, it was a difficult realization when I discovered that technical assessments are not just “build me X, Y or Z of a website”; something that I have been acutely focused on for 15 weeks during the full stack bootcamp. Instead, I have to leverage this general knowledge in order to apply it to more algorithmic problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d0Qq0KpXRpecAYlF5LO38Q.jpeg" /><figcaption>Source: <a href="https://toledolibrary.s3.amazonaws.com/uploads/images/blog/_large/Computer-Coding-Laptop.jpg">https://toledolibrary.s3.amazonaws.com/uploads/images/blog/_large/Computer-Coding-Laptop.jpg</a></figcaption></figure><p>Writing candidly, during this roller coaster of a time that is the job search, I have completed a few coding challenges that have hurt my self confidence and left me wondering if companies truly intend on hiring more junior staff. To continue my development as a budding software engineer and increase the likelihood of passing future exams, I have identified key algorithms to be familiar with; some of which include:</p><h3>1. Binary Search</h3><p>This algorithm is meant to find things like an item in an array. The easiest implementation is by using recursion. It is important to note that the input must be sorted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXFC8vq6xJ8Ud1Zeu24eUQ.png" /><figcaption>Source: <a href="https://miro.medium.com/max/2196/1*dXFC8vq6xJ8Ud1Zeu24eUQ.png">https://miro.medium.com/max/2196/1*dXFC8vq6xJ8Ud1Zeu24eUQ.png</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTlVXu6LRXStx1n6VFM6Dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVpO3LWqp57TyGDT1Tb33Q.png" /></figure><h3>2. Linear Search</h3><p>This algorithm searches through all elements in an array using a loop, or recursion, and compares each element with the one you want to search for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*leliKatpu64lbazEQDAAeQ.png" /></figure><h3>3. Quick Sort</h3><p>Quick sort performs comparisons, meaning that it can sort items of any type regarding a “less-than” relation is defined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZRTzbj4mYzwV9Yfv7YhdQ.png" /><figcaption>Source: <a href="https://www.w3resource.com/javascript-exercises/searching-and-sorting-algorithm/searching-and-sorting-algorithm-exercise-1.php">https://www.w3resource.com/javascript-exercises/searching-and-sorting-algorithm/searching-and-sorting-algorithm-exercise-1.php</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AikrnLmLYjxk1ISCtPeUnQ.png" /></figure><h3>4. Counting Sort</h3><p>This algorithm sorts an array from minimum to maximum values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJeco2iDq615AxlhLafS1Q.png" /></figure><h3>5. String Reversal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Uhie59YB98y9jUAYTqyEw.png" /></figure><h3>6. Palindrome</h3><p>A palindrome is a word/phrase that reads the same backwards as forwards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTF4m8_JLYkwkENDY1TyIA.png" /></figure><p><em>Note</em>: the /[\W_]/g was necessary to add as we want our function to look over (and remove) any non-word or _ characters (including space, symbols, &amp; integers). Notice “e_l 6l‘’%e” still evaluates to true as “elle” did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XWcAEoGRhaIomEqP3h_UA.png" /></figure><ul><li>The / represents to beginning and end of a regular expression</li><li>[ ] signifies the start and end of a character set</li><li>\W denotes “non-word” characters (opposed to \w that will match a word)</li><li>_ is the _ character</li><li>The g means that this is a global search</li></ul><h3>7. Integer Reversal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xCc2B4QbgGdvnkUAb3Orw.png" /></figure><h3>8. Fizz Buzz</h3><p>Given a number, print out every integer from 1 to that number. When the integer is divisible by 2 print “Fizz,” when the integer is divisible by 3 print “Buzz,” and when the integer is divisible by both 2 and 3, print “Fizz Buzz.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6k1UHtPVOMeviFe0LcRMg.png" /></figure><h3>9. Max Character</h3><p>Given a string, return the character that appears most often. The trick is to create a table (hash) to record the “tallies” for each time a character is looped through. The table’s key is the character and the value is the counter (e.g., m: 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mG4yPyS644Zy1-I2l_Srtw.png" /></figure><h3>10. Anagrams</h3><p>Anagrams are words/phrases that are rearranged/contain the same characters. Note: The approach highlighted below is probably the most efficient way. However, you can also use a hash map like we for max character (counting the number of characters in each string and seeing if they’re equal to each other).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*77okd5CrXefF662v0ZFz9w.png" /></figure><h3>11. Vowels</h3><p>Given a string, count the number of vowels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJWLaj9V3dc8iuUZKlna5Q.png" /></figure><h3>12. Array Chunking</h3><p>Splitting an array into smaller arrays of a specified size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XEkNIWx_jo7EbNT12OF8w.png" /></figure><h3>13. Array Reversal</h3><p>There is a .reverse() method for arrays in JavaScript, but let’s pretend we can’t use that!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQVUEXUdQErVdlvWlXhQfA.png" /></figure><h3>14. Word Reversal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cefUkF-r4Ft09oARzvfJtA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca4c6c8d89fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning A New Language: Python Part 1]]></title>
            <link>https://madelinestalter.medium.com/learning-a-new-language-python-part-1-815c1714edc2?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/815c1714edc2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[back-end-development]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 10 Mar 2021 18:24:05 GMT</pubDate>
            <atom:updated>2021-03-10T18:24:05.844Z</atom:updated>
            <content:encoded><![CDATA[<p>The acquisition of Python appears to be a “no-brainer” in terms of desired skills in the marketplace today. Python is exciting as it can be leveraged for a multitude of purposes: web development, data science, and machine learning. Python is a high-level programming language that is designed to be readable and efficient in terms of lines of code used. Its core, user-friendly approach reminds me a lot of Ruby — a language that I already know and love!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2P7SkH82wg6FwC2aXDqFeQ.jpeg" /><figcaption>Source: <a href="https://stackify.com/wp-content/uploads/2019/01/Ruby-vs-Python-1280x720.jpg">https://stackify.com/wp-content/uploads/2019/01/Ruby-vs-Python-1280x720.jpg</a></figcaption></figure><h3>1. Variables</h3><p>In theme with the praise of Python above, defining and setting variables is very easy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsK3QuvRsxiLa5Wyx34THw.png" /></figure><h3>2. Conditional Statements</h3><p>In Python, we use the if keyword to evaluate whether a statement is true or false. If true, then the program will execute the contained code block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipdtMZtI2d-j8JU5s5pKug.png" /></figure><p>We can incorporate the else keyword to capture what happens if the statement evaluates to false.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipdtMZtI2d-j8JU5s5pKug.png" /></figure><p>The elif keyword can be used to check for more cases as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulxT093_wxgFJATMVq-yAA.png" /></figure><h3>3. Iteration (Looping)</h3><p>The while and for loop are most helpful in Python. The while loop dictates that while the state is true, execute the code block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_LJmy1ilpN6kp13I202rg.png" /></figure><p>The for loop dictates that for x, execute the code block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIvahcip-MzqvozKHX8WVQ.png" /></figure><h3>4. Lists</h3><p>Lists allow us to store collections, or lists, of data. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6UQdDSApQmXHejMEU0vog.png" /></figure><p>To get a specific value from a list, we can leverage the element’s index. The index starts with 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJNEDBZoIW07rWMCIscTKw.png" /></figure><p>There are methods to manipulate lists; some of which include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt6S1PMe9GBExncIi8TiTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98JciEMeJd9Ab_4N47___g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYGVzk49Wc21BvKqjiwBTg.png" /></figure><h3>5. Dictionary: Key-Value Pairs</h3><p>In lieu of using numbers as indices, we have the dictionary data structure that is comprised of key-value pairs (the keys can be of any type — numeric or string).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhAX-ZIB_-Vg3_TwvyJVVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63Coo9IfPOVAw3gQ1rGnpQ.png" /></figure><h3>6. Classes &amp; Objects</h3><p>Similar to Ruby, objects are meant to represent the real world. Objects contain data (or attributes) and have behavior (or methods that can be preformed on them to accomplish some task). A class is the blueprint from which individual objects are instantiated; or in other words, classes define the attributes and behaviors that objects have. The class syntax is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bALsr8lDdS4XHTsNCnJvcw.png" /></figure><p>Here sidney is an object (or instance) of the Dog class. In order to set attributes of sidney, we will define our class to receive data when an object is initiated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qe3iT6F-qP3Ap3emF9_16Q.png" /></figure><p>You can reassign the values of attributes as such:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*QW-tBXPcTkIBv7UX6yibPw.png" /></figure><h3>7. Non-Public Instance Variables</h3><p>Non-public instance variables can be accessed and updated; however, they’re considered a non-public part of the API. We define non-public instance variable using a _ before the variable name; methods work in the same fashion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgKSghKRSAHt5JCCnIqnUA.png" /></figure><h3>8. Class Inheritance</h3><p>Classes can inherit from parent classes! For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbvtEa8lOn0vrnPfgKqK4w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=815c1714edc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Connection Between Time Complexity & Big O Notation Part 1]]></title>
            <link>https://madelinestalter.medium.com/the-connection-between-time-complexity-big-o-notation-part-1-1e52390c3e69?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e52390c3e69</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[big-o-notation]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Thu, 04 Mar 2021 00:20:31 GMT</pubDate>
            <atom:updated>2021-03-04T00:20:31.376Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the time complexity of algorithms will help us assess if our code will scale. In implementing algorithms, it is also helpful to understand the variance in execution performance in order to select the best algorithm for your problem and achieve optimal efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*COCW9itDOPsrmXpyDU6qgw.jpeg" /><figcaption>Source: <a href="https://img.devrant.com/devrant/rant/r_1204944_6PfxU.jpg">https://img.devrant.com/devrant/rant/r_1204944_6PfxU.jpg</a></figcaption></figure><p>It’s important to note that time complexity is <em>not</em> the amount of measurable time (e.g., x number of seconds) that it takes for an algorithm to execute; rather it’s concerned with the number of operations that are performed. The number of operations executed by a program is affected by the size of input (referred to as <em>n</em>) and how their elements are arranged. To classify algorithms by their worst-case scenario, we use Big O Notation, which is a function of the input size <em>n</em> (e.g., O(n) or O(n³)). For concept visualization, a Big O cheatsheet, examples, and graph are listed below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUw4DQ1w0EMXojQwyZGDXg.png" /><figcaption>Source: <a href="https://medium.com/@amejiarosario/8-time-complexity-examples-that-every-programmer-should-know-171bd21e5ba">https://medium.com/@amejiarosario/8-time-complexity-examples-that-every-programmer-should-know-171bd21e5ba</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFIHSt4mV0uJAJysaqOU7w.png" /><figcaption>Source: <a href="https://dzone.com/storage/temp/5068673-screen-shot-2017-04-24-at-21022-pm.png">https://dzone.com/storage/temp/5068673-screen-shot-2017-04-24-at-21022-pm.png</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*EzbfIhTRBfKNgRUIqqWGbA.jpeg" /><figcaption>Source: <a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NR3M1nw8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z4bbf8o1ly77wmkjdgge.png">https://res.cloudinary.com/practicaldev/image/fetch/s--NR3M1nw8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z4bbf8o1ly77wmkjdgge.png</a></figcaption></figure><h3>1. O(1): Constant Time</h3><p>O(1) includes algorithms that take the same amount of time to execute regardless of the input size (n); these algorithms have a constant growth rate. Examples of O(1) runtime algorithms include:</p><pre>// 1. Checking if a number is even or odd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9aHMeEu38bFXt61Bc2mHA.png" /></figure><p>In this example, it doesn’t matter if n is 1 or 1,000, it will execute the code block only one time.</p><pre>// 2. Printing the first element from a list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Di1ueP9_QKHyChQdowv-0A.png" /></figure><pre>// 3. Checking if an item in an array is null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhRmDtXYcX90zbJmEQV7Cg.png" /></figure><pre>// 3. Finding a value on a hash map (which is generally done in O(1) time - in unique/difficult cases O(n) time)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tb39qpOWuqPZW5vRanB9WQ.png" /></figure><p><em>Note</em>: It’s important to understand how operations (especially array and object methods) are being implemented in order to determine their runtime. For example, although the code block below is run only once per item — it’s actually run multiple times for each item in the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*My_lp24FjeWPgqUDu0sTbQ.png" /></figure><p>Additionally, believe it or not, primitive mathematical operations (e.g., +, *, -, /, and %) have a constant runtime as most programming languages limit numbers to a max value (in JavaScript, that Number.MAX_VALUE is 1. 7976…). Therefore, you cannot operate numbers that yield a greater value than the MAX_VALUE and these primitive mathematical operations are bound to be completed on a fixed amount of instructions (O(1)).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZGSweooN7QKNNNc2SHXaw.png" /></figure><h3>2. O(n): Linear Time</h3><p>Algorithms that run in linear time are very common; in this runtime, it is implied that every element from the input is visited in the worst-case scenario. Linear time means that as the input grows, execution time grows proportionally. As the name suggests, this time complexity has a linear growth rate. Examples of O(n) runtime algorithms include:</p><pre>// 1. Finding the maximum and minimum values in an array</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*08yS-0iI5eVyaCTl8fHx_A.png" /></figure><p>The function getMaxValue() will check every element in the array. The counter was added to explicitly show how many times the function executed the code block. In this example, n == 4 (there are 4 items in the array) and the counter == 4 as well as soon as the execution was complete.</p><pre>// 2. Finding a given element in a collection</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkGjzCsbbzVacbzaLJecCA.png" /></figure><pre>// 3. Printing all the values in a list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpSHQTfW4CTJFqNxSXBHtA.png" /></figure><h3>3. O(n²) — Quadratic time</h3><p>An algorithm with quadratic time complexity has a growth rate of n². For example, if the input (n) == 2, it will do 4 operations. Examples of O(n²) runtime algorithms include:</p><pre>// 1. Checking if a collection has any duplicate values</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ydasow0ZtYE2mZI4-YenDA.png" /></figure><pre>// 2. Sorting items in a collection using bubble sort, insertion sort, or selection sort</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*RfHrEI8NAlfbfhduORRcdg.png" /><figcaption><a href="https://www.w3resource.com/w3r_images/bubble-short.png">https://www.w3resource.com/w3r_images/bubble-short.png</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmZ4qEyELNK_1h89dt0kaw.png" /></figure><pre>// 3. Finding all pairs in a collection</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZH_-j6ySHTRVzkxWOQK5vQ.png" /></figure><h3>4. O(n^c) — Polynomial time</h3><p>In polynomial runtime, c &gt; 1. O(n²) translates to two nested loops; three nested loops + are considered to be polynomial (cubic, quadratic, etc.). Polynomial runtimes take a great amount of time to compute as the input grows fast and therefore, are generally avoided. An example O(n^c) runtime algorithms includes:</p><pre>// 1. Finding the solution to a multi-variable equation (via triple nested loops)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1uoT_kqVJ3XU_j044ZYug.png" /></figure><p><em>*Resources: </em><a href="https://medium.com/@amejiarosario/8-time-complexity-examples-that-every-programmer-should-know-171bd21e5ba"><em>https://medium.com/@amejiarosario/8-time-complexity-examples-that-every-programmer-should-know-171bd21e5ba</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e52390c3e69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Talk About Data Structures]]></title>
            <link>https://madelinestalter.medium.com/lets-talk-about-data-structures-12defbd72917?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/12defbd72917</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[bootcamp]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 24 Feb 2021 19:59:41 GMT</pubDate>
            <atom:updated>2021-02-24T19:59:41.978Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning about data structures is not of primary concern during a full stack web development bootcamp as you can build powerful applications without knowing about the aforementioned. However as I progress in my job search, I am starting to see the value of data structures in the “real world” setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4p-vJjz1FoFpSt2p82Qd5Q.jpeg" /><figcaption>Source: <a href="https://miro.medium.com/max/4096/1*1x8sT9551MPfqrkAcKWDug.jpeg">https://miro.medium.com/max/4096/1*1x8sT9551MPfqrkAcKWDug.jpeg</a></figcaption></figure><p>Naturally, the first step of this journey is to ask what exactly are data structures? They can be considered a way of organizing and storing data so that we can efficiently perform operations for, for example, accessing, inserting, deleting, finding, and sorting data. It’s important to note that not all data structures can perform these operations efficiently — leading to the development of varying types and associated purposes. Questions to consider before implementing a data structure include:</p><ul><li>How much data do we need to store?</li><li>How often do we need to access that data?</li><li>What is the purpose of this data?</li><li>Do we need to access, insert, delete, or sort the data?</li></ul><p>Understanding the data structures used in our day to day programming will be a great starting point.</p><h3>1. One Dimensional Arrays</h3><p>By this point, we should be very familiar with one dimensional arrays; however, to be safe, an array can hold a fixed number of containers to store data and operations can be performed on that data based upon a user’s needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*YdtYZaXR4ZJGzi3WGfSdxw.png" /><figcaption>Source: <a href="https://www.oreilly.com/library/view/computer-science-programming/9781449356835/figs/cspr_0601.png">https://www.oreilly.com/library/view/computer-science-programming/9781449356835/figs/cspr_0601.png</a></figcaption></figure><p>In the image above, the array is defined with the name <em>arr</em>. The numbers in the white boxes surrounded by brackets indicate the index (or position in the array) of each element. The index always started at 0 and ends at a number one less than the total amount of elements. The numbers in the orange boxes indicate the memory address each container of the array is assigned to.</p><h3>2. Multidimensional Arrays</h3><p>For one dimensional arrays, an array is defined with a row of containers as highlighted above. For multidimensional arrays, an array is defined with rows as well as columns. In order to access an index of a multidimensional array, we will need two numbers (indicating the row AND column).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*hmaZQs21hWSUHuSct28x-Q.jpeg" /><figcaption>Source: <a href="https://cdn.programiz.com/sites/tutorial2program/files/two-dimensional-array_0.jpg">https://cdn.programiz.com/sites/tutorial2program/files/two-dimensional-array_0.jpg</a></figcaption></figure><p>In the diagram above, the array (with the presumed name of arrayName) is defined as arrayName[3][4] because it has 3 rows and 4 columns with a total of 12 indexes. To ascertain the number of indexes, simply multiply the number of rows by columns. Due to the layout, multidimensional arrays can be referred to as tables or matrices.</p><p>//</p><p><em>Note</em>: Some programming languages, including Ruby and JavaScript, define arrays dynamically; meaning that the size of an array will be adjusted automatically based upon the user’s needs. We do not need to predefine space for the array as it will be created with precision at execution. This is done in an attempt to save memory / avoid taking up more memory than we actually need. In languages like Java and Python, we have to be more specific in terms of how we tell the program to dynamically define arrays — using the ArrayList class in Java and the list data type in Python.</p><p>//</p><h3>3. Singly Linked Lists</h3><p>A linked list is a linear collection of nodes that are connected by links. The nodes store data and the location of the next node. The first node is referred to as the head node and the last as the tail. The pointer of the head node points to the next node and so on until the last node; this tail node points to null. Adding and removing nodes is very easy so long that you keep track of the previous and succeeding nodes of the target node and adjust the links accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*AWAYKUDf9nCkjmYnpIF-2g.png" /><figcaption>Source: <a href="https://miro.medium.com/max/953/1*DnMUy7SEP31IRXq1zbMwWA.png">https://miro.medium.com/max/953/1*DnMUy7SEP31IRXq1zbMwWA.png</a></figcaption></figure><h3>4. Doubly Linked List</h3><p>A doubly linked is differentiated from a singly linked list with the fact that the pointers can point forward AND back. The back (or previous) pointer of the head node points to null and the next pointer of the tail points to null.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*M8OI5w8cS4idbtYyr-iNag.png" /><figcaption>Source: <a href="https://media.geeksforgeeks.org/wp-content/cdn-uploads/gq/2014/03/DLL1.png">https://media.geeksforgeeks.org/wp-content/cdn-uploads/gq/2014/03/DLL1.png</a></figcaption></figure><h3>5. Circular Linked List</h3><p>As the name suggested, a circular linked list is a linked list where all the nodes are connected and, as a result, form a circle. There is no head or tail node / any node can be used as a starting point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*yIPR-I7iRS-xSvqwkwVeLw.png" /><figcaption>Source: <a href="https://media.geeksforgeeks.org/wp-content/uploads/CircularSinglyLinkedList.png">https://media.geeksforgeeks.org/wp-content/uploads/CircularSinglyLinkedList.png</a></figcaption></figure><p>//</p><p><em>Note</em>: Linked lists are similar to arrays but there are no indices. As a result, we cannot randomly access data; we must traverse the list in order to find any one element instead. Linked lists can be more useful than arrays when dealing with a large dataset where we constantly need to add or remove data from the beginning or end (e.g., a stack or queue).</p><p>//</p><h3>6. Stack</h3><p>Stacks can be implemented using an array or linked list . They are a Last In First Out (or LIFO) data structure which means that the last item to come is the first to go out. Consider a stack of books, the last book is placed on top of the stack. If you wanted to remove a book, you would remove the first one from the top (or the last book placed). There are three operations that can be performed on stacks: Push (to input data/place it on top), Pop (to remove data from the top), and Peek (to look at the data at the top without removing it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*N53k-zddDZQ1mu5h-2vMvw.png" /><figcaption>Source: <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Lifo_stack.png/350px-Lifo_stack.png">https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Lifo_stack.png/350px-Lifo_stack.png</a></figcaption></figure><h3>7. Queue</h3><p>Similar to stacks, the word queue is also derived from daily life. The most common example being a queue of people waiting in the checkout line at the grocery store. Queues are First in First Out (or FIFO) structures and can be implemented using arrays or linked lists. There are three operations that can be performed on queues: Enqueue (to input data into a stack and place it at the bottom), Dequeue (to remove data from the top), and Peek (to look at data at the top without removing it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVKwDYYkTitsmyef_DRqqg.png" /><figcaption>Source: <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Data_Queue.svg/1200px-Data_Queue.svg.png">https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Data_Queue.svg/1200px-Data_Queue.svg.png</a></figcaption></figure><h3>8. Tree</h3><p>Tree data structures function similarly to a family tree in terms of inheritance. There is a root node where all nodes are connected to. The root node is divided into a left and right node and so on. Nodes positioned under and linked to higher nodes are considered children. Nodes at the same level (that share a parent) are considered siblings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*87h2uhCJ5qztBNwfck2b6g.jpeg" /><figcaption>Source: <a href="https://www.tutorialspoint.com/data_structures_algorithms/images/binary_tree.jpg">https://www.tutorialspoint.com/data_structures_algorithms/images/binary_tree.jpg</a></figcaption></figure><h3>9. Binary Search Trees</h3><p>Binary search trees are a special kind of tree where the left node is smaller than the parent and the right node is larger. In order to add or delete a node, we must compare the value to the root node and then traverse to a specific point to do said insertion/deletion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*lAfSmSu2VCgahMiGhejJqA.png" /><figcaption>Source: <a href="https://www.gatevidyalay.com/wp-content/uploads/2018/07/Binary-Search-Tree-Example.png">https://www.gatevidyalay.com/wp-content/uploads/2018/07/Binary-Search-Tree-Example.png</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12defbd72917" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Tools To Your Technical Toolbox: JavaScript Edition II]]></title>
            <link>https://madelinestalter.medium.com/adding-tools-to-your-technical-toolbox-javascript-edition-ii-3e6c9aa07993?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e6c9aa07993</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 17 Feb 2021 15:14:26 GMT</pubDate>
            <atom:updated>2021-02-17T15:14:26.064Z</atom:updated>
            <content:encoded><![CDATA[<p>As previously stated, JavaScript is a powerful, object-oriented language that enables us to build dynamic, ultra responsive websites, handle API calls and more. Building upon the foundation laid in Edition I, I will continue to detail base concepts that every front end developer should know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tajZZ2w2JNhrXYIK.jpg" /><figcaption>Source: <a href="https://www.incimages.com/uploaded_files/image/1920x1080/getty_494605768_2000133320009280151_316966.jpg">https://www.incimages.com/uploaded_files/image/1920x1080/getty_494605768_2000133320009280151_316966.jpg</a></figcaption></figure><p>17. <strong>Objects </strong>are non-primitive data types (e.g., array, function). Objects are defined using:</p><pre>// 1. Object Literal Syntax</pre><pre><strong>const dog = {<br>}</strong></pre><pre>// 2. New Object Syntax</pre><pre><strong>const dog = new Object() </strong></pre><pre>// 3. Other Syntax</pre><pre><strong>const dog = Object.create()</strong></pre><p>You can also initialize an object using the new keyword before a function. The function is a constructor for that object where we can define parameters to setup the initial state of the object. For example:</p><pre><strong>function Dog(name, breed) {<br>  this.name = name<br>  this.breed = breed<br>}</strong></pre><pre><strong>const myDog = new Dog(&quot;Sidney&quot;, &quot;German Shepherd&quot;)</strong></pre><pre><strong>myDog.name</strong> // =&gt; &quot;Sidney&quot;<br><strong>myDog.breed</strong> // =&gt; &quot;German Shepherd&quot;</pre><p><em>Note</em>: Objects are always passed by reference. If you assign a variable the same value as another, if it’s a primitive type (e.g., string, integer), they are passed by value. For example:</p><pre><strong>const cat = {<br>  name: &quot;Peyton&quot;<br>}</strong></pre><pre><strong>const anotherCat = cat<br>anotherCat.name = &quot;Iris&quot;<br>cat.name</strong> // =&gt; &quot;Iris&quot;</pre><p>Objects have <strong>properties</strong> that are defined by a key-value pairs. The value of a property can be of any type (even other objects)! With the object literal syntax highlighted above, we can define a property in this way:</p><pre>// Here we have an engineer object with a property named name and a value Madeline</pre><pre><strong>const engineer = {<br>  firstName: &quot;Madeline&quot;,<br>  lastName: &quot;Stalter&quot;,<br>  age: 25<br>}</strong></pre><p>Note: Keys should be camelCased and can be any string — but invalid characters include spaces, hyphens, and other special characters.</p><p>We can retrieve the value of a property using dot notation and square brackets.</p><pre>// Dot Notation</pre><pre><strong>engineer.firstName </strong>// =&gt; &quot;Madeline&quot;</pre><pre>// Square Brackets - this is useful for keys with &quot;invalid names&quot; for example if firstName was labeled &quot;first name&quot;</pre><pre><strong>engineer[&quot;first name&quot;]</strong> // =&gt; &quot;Madeline&quot;</pre><pre>// If you try to access a non-existent property, undefined will be returned. </pre><pre><strong>engineer.language</strong> // =&gt; undefined </pre><p>As I previously mentioned, objects can have nested objects as properties. Such as:</p><pre><strong>const bike = {<br>  brand: {<br>    name: &quot;Cannondale&quot;,<br>    series: &quot;Quick Women&#39;s 4&quot;<br>  },<br>  color: &quot;Sage&quot;<br>}</strong></pre><p>To access nested properties, we can use the following syntax:</p><pre>// Dot Notation</pre><pre><strong>bike.brand.series</strong></pre><pre>// Square Brackets </pre><pre><strong>bike[&quot;brand&quot;][&quot;name&quot;]</strong></pre><p><em>Note</em>: You can update the value of a property after initializing the object; you can also add/remove properties after the fact:</p><pre><strong>let game = {<br>  name: &quot;Assassin&#39;s Creed&quot;<br>}</strong></pre><pre><strong>game.name = &quot;Modern Warfare&quot;</strong></pre><pre><strong>game.yearReleased = &quot;2019&quot;</strong></pre><pre><strong>delete game.yearReleased</strong></pre><p>Objects have <strong>methods</strong> by assigning function to function properties. In the following example, the start property has a function assigned and we can invoke that function using dot notation with parentheses at the end:</p><pre><strong>const game = {<br>  name: &quot;Call of Duty&quot;,<br>  console: &quot;Xbox&quot;,<br>  start: function() {<br>    console.log(&quot;Game Has Begun - Watch Out For Campers!&quot;)<br>  }<br>}</strong></pre><pre><strong>game.start()</strong></pre><p>Inside a method (defined using the function() {}) syntax we have access to the entire instance by using the this keyword. For example:</p><pre><strong>const game = {<br>  name: &quot;Call of Duty&quot;,<br>  console: &quot;Xbox&quot;,<br>  start: function() {<br>    console.log(`Started <br>      ${this.name} on ${this.console} - Watch Out For Campers!`)<br>  }<br>}</strong></pre><pre><strong>game.start()</strong></pre><p><em>Note</em>: We only have access to the this keyword if we use a plain function; this will not work with arrow functions as they’re not bound to the object.</p><p>Methods can also accept parameters, like plain functions:</p><pre><strong>const travel = {<br>  date: &quot;4/16&quot;,<br>  passenger: &quot;Madeline&quot;,<br>  transportation: &quot;Plane&quot;,<br>  destination: function() {<br>    console.log(`Exploring ${destination}!`)<br>  }<br>}</strong></pre><pre><strong>travel.destination(&quot;Italy&quot;)</strong></pre><p>18. <strong>Classes</strong> are a way to define a common pattern for multiple objects. They function as a blue print for all instances.</p><p>Let’s take a person object:</p><pre>// We can transform an object into a class so we can create many instances with ease.</pre><pre><strong>const city = {<br>  name: &quot;nyc&quot;,<br>  state: &quot;new york&quot;,<br>  population: &quot;8.419 million&quot;<br>}</strong></pre><pre><strong>class City {<br>  name<br>}</strong></pre><pre>// We can now initialize an object (or instance of the City class) like: </pre><pre><strong>const savannah = new City()</strong></pre><pre>// We can set the value of a property like: </pre><pre><strong>savannah.population = </strong>&quot;<strong>145.403 thousand</strong>&quot;</pre><pre>// We can access a property like: </pre><pre><strong>savannah.name = &quot;savannah&quot;</strong></pre><p>Classes can also hold methods. Methods are defined and invoked like:</p><pre><strong>class Student {<br>  greeting() {<br>    return &quot;Good morning professor!&quot;<br>  }<br>}</strong></pre><pre>// Creating an instance of the Student class</pre><pre><strong>let madeline = new Student()</strong></pre><pre>// Invoking the method</pre><pre><strong>madeline.greeting()</strong></pre><p>Class properties can also be initialized when we create a new instance of an object using the constructor() method.</p><pre><strong>class Student {<br>  constructor(name) {<br>    this.name = name<br>  }</strong></pre><pre><strong>  hello() {<br>    return &quot;Hi, I&#39;m &quot; + this.name + &quot;!&quot;<br>  }<br>}</strong></pre><pre>// Now we can instantiate a new object from the Student class by passing in a string to create a personalized greeting</pre><pre><strong>let nick = new Student(&quot;Nick&quot;)<br>nick.hello()</strong> // =&gt; &quot;Hi, I&#39;m nick!&quot;</pre><p>Typically, methods are defined on the object instance instead of the class. However, you can define a method on the class — this is considered to be a static execution.</p><pre><strong>class Student {<br>  static defaultWelcome() {<br>    return &quot;Hello&quot;<br>  }<br>}</strong></pre><pre><strong>Person.defaultWelcome() </strong>// =&gt; &quot;Hello&quot; </pre><p>19. A class can extend another class. As a result, all objects initialized using that class <strong>inherit</strong> all the methods of both classes. For example:</p><pre><strong>class Person {<br>  hello() {<br>    return &quot;Hello&quot;<br>  }<br>}</strong></pre><pre>// We can define a new class that extends Person. </pre><pre><strong>class Engineer extends Person {</strong></pre><pre><strong>}</strong></pre><pre>// Now if we instantiate a new object with the class Programmer, it has access to the hello() method in the Person class. </pre><pre><strong>let sophie = new Engineer()<br>sophie.hello()</strong> // =&gt; &quot;Hello&quot;</pre><pre>// Inside a child class, you can reference the parent class by calling super().</pre><pre><strong>class Engineer extends Person {<br>  hello() {<br>    return super.hello() + <br>      &quot;, I&#39;m a software engineer!&quot;<br>  }<br>}</strong></pre><pre><strong>const matthew = new Programmer()<br>matthew.hello() </strong>// =&gt; &quot;Hello, I&#39;m a software engineer!&quot;</pre><p>19. Without intervention, JavaScript runs synchronously — meaning that it executes lines of code one at a time; left to right, top to bottom. However, there are times when we cannot wait for a line of code to execute. It would seriously impede user experience if a program halted in order to load a large file. According to Kissmetrics, “47% of users expect a website to load in less than 2 seconds, and 40% of users will leave the website if the loading process takes more than 3 seconds.” This dramatic decrease in traffic due to slow loading speeds would be the death of a website/company! Instead, we can load that large file in the background while doing/displaying other things. JavaScript implements this problem solving approach using <strong>callbacks</strong>.</p><p>A simple example of callbacks leverages timers (made available in a JavaScript program from the browser and Node.js). One timer is setTimeout(); this timer accepts two arguments — a function and integer. The integer is the milliseconds that must pass before the function is run. For example:</p><pre>// By putting console.logs before and after the function that must wait 2 seconds before running, we can see the magic of the callback / we can see how the program is functioning asynchronously.</pre><pre><strong>console.log(&quot;Before&quot;)</strong></pre><pre><strong>setTimeout(() =&gt; {<br>  console.log(&quot;Inside the Function&quot;)<br>}, 2000)</strong></pre><pre><strong>console.log(&quot;After&quot;)</strong></pre><pre>// =&gt; &quot;Before&quot;<br>// =&gt; &quot;After&quot;<br>// =&gt; &quot;Inside the Function&quot;</pre><p>This is a very common pattern and especially useful for fetching data from the server, responding to events, etc.. Callbacks are implemented in code by passing them into functions and defining them as parameters.</p><p>When the code is ready to invoke the callback, we invoke it by passing the result:</p><pre><strong>doSomething = callback =&gt; {<br>  // some code<br>  const result = &quot;Result&quot;<br>  callback(result)<br>}</strong></pre><pre><strong>doSomething(result =&gt; {<br>  console.log(result)<br>})</strong></pre><p>20. <strong>Promises</strong> are an alternative (and arguably better) way to deal with asynchronous code. The main issue with callbacks is that if we need to use the result of the function in another part of our code, all code must be nested inside the callback. If we have to do 2–3 callbacks, there are many levels of functions indented into other functions:</p><pre><strong>doSomething(result =&gt; {<br>  doSomethingElse(anotherResult =&gt; {<br>    doSomethingElseAgain(yetAnotherResult =&gt; {<br>      console.log(result)<br>    })<br>  }) <br>})</strong></pre><p>With promises, instead of doing this:</p><pre><strong>doSomething(result =&gt; {<br>  console.log(result)<br>})</strong></pre><p>We can do this:</p><pre><strong>doSomething()<br>  .then(result =&gt; {<br>    console.log(result)<br>  })</strong></pre><p>We first call the function, then we have a then() method that is called when the function ends. You can detect errors using the catch() method:</p><pre><strong>doSomething()<br>  .then(result =&gt; {<br>    console.log(result)<br>  })<br>  .catch(error =&gt; {<br>    console.log(error)<br>  })</strong></pre><p>To be able to use this syntax, the doSomething() function must use the Promise API/declare it as a promise object and pass a function in the promise constructor. The function receives two parameters — the first is a function we call to resolve the promise, the second a function we call to reject the promise.</p><pre>const doSomething = new Promise(<br>  (resolve, reject) =&gt; {<br>    <br>})</pre><p>Resolving a promise means to complete it successfully (which results in calling the then() method). Rejecting a promise means ending it with an error (which results in calling the catch() method). For example:</p><pre>const doSomething = new Promise(<br>  (resolve, reject) =&gt; {<br>    //some code<br>    const success = /* ... */<br>    if (success) {<br>      resolve(&quot;Completed successfully&quot;)<br>    } else {<br>      reject(&quot;Rejected&quot;)<br>    }<br>  }<br>)</pre><p>21. <strong>Async</strong> functions return a promise. For example:</p><pre><strong>const getData = () =&gt; {<br>  return new Promise((resolve, reject) =&gt; {<br>    setTimeout(() =&gt; <br>      resolve(&quot;Some Data&quot;), 2000)<br>  })<br>}</strong></pre><p>Any code that wants to use this function will use the await keyword before the function:</p><pre><strong>const data = await getData()</strong></pre><p>By doing so, the data returned by the promise is going to be assigned to the data variable. Note: whenever we use the await keyword, we must do so inside a function defined as async:</p><pre><strong>const doSomething = async () =&gt; {<br>  const data = await getData()<br>  console.log(data)<br>}</strong></pre><p>Async functions allow us to simplify our code opposed to using promises or callback functions listed above. The efficacy of this simplification is seen when our code becomes more complex — for example, if we were fetching and parsing a JSON resource using promises:</p><pre>// This will: 1. get a list of all users from our server, 2. parse the JSON object, 3. select the first user, 4. obtain the first user&#39;s data, and 4. parse that JSON object.</pre><pre><strong>const getFirstUserData = () =&gt; {</strong><br>  <strong>return fetch(&quot;/users.json&quot;) </strong><br>    <strong>.then(response =&gt; response.json())</strong> <br>    <strong>.then(users =&gt; users[0]) </strong><br>    <strong>.then(user =&gt; <br>      fetch(`/users/${user.name}`)) </strong><br>    <strong>.then(userResponse =&gt; response.json()) <br>}</strong></pre><pre><strong>getFirstUserData()</strong></pre><p>Below is the same functionally using using await/async:</p><pre>// The async/await tells our program to wait until we have all the users data / json objects to proceed more specifically to the first user.</pre><pre><strong>const getFirstUserData = async () =&gt; {</strong><br>  <strong>const response = await fetch(&#39;/users.json&#39;) </strong><br>  <strong>const users = await response.json() </strong><br> <strong> const user = users[0] </strong><br> <strong> const userResponse = </strong><br>    <strong>await fetch(`/users/${user.name}`</strong>)<br>  <strong>const userData = await user.json() <br>  return userData<br>}</strong></pre><pre><strong>getFirstUserData()</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e6c9aa07993" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL: The Forgotten Younger Sibling of a Coding Bootcamp]]></title>
            <link>https://madelinestalter.medium.com/sql-the-forgotten-younger-sibling-of-a-coding-bootcamp-e181812270b9?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e181812270b9</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 10 Feb 2021 19:23:18 GMT</pubDate>
            <atom:updated>2021-02-10T19:23:18.704Z</atom:updated>
            <content:encoded><![CDATA[<p>In the job search process, it is very easy to focus on studying Object Oriented Languages for technical exams. However, writing to my audience candidly, I was rejected from an opportunity last week due to my lacking knowledge of the Structured Query Language (SQL). During the bootcamp, we glazed over SQL as we can automate this process by leveraging powerful frameworks, such as Rails; taking for granted what is going on “under the hood.”</p><p><em>*With such a statement, I would like to provide some color that the bootcamp did give students learning material regarding SQL and I am taking it upon myself to reexamine and build upon it. I am incredibly grateful to my bootcamp for teaching me how to build robust full stack web applications in 15 weeks.*</em></p><p>To demonstrate my desire to learn and grow as a junior developer, this week’s article will be an introduction to SQL that will develop in the following weeks as I continue my studies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*YL2Si-LVziTqSOq1ksEzEw.jpeg" /><figcaption>Source: <a href="https://codematters.online/wp-content/uploads/2018/11/SQLServer2019.jpg">https://codematters.online/wp-content/uploads/2018/11/SQLServer2019.jpg</a></figcaption></figure><p>SQL is a language designed for managing data in relational databases; in other words, its sole purpose is to “talk” to the database for data storage, access, and manipulation. Therefore it’s considered to be a “special purpose” or “domain specific” programming language. SQL is compatible with many different databases such as MySQL, Postgres, and SQLite; I will be using SQLite. While there are some minor differences, the fundamentals remain the same. SQL is invoked by writing declarative statements, often referred to as queries. There are many clauses that are used to write statements; some of the most common clauses include:</p><ul><li><strong>SELECT</strong>: extracts data from the database</li><li><strong>UPDATE</strong>: updates data from the database</li><li><strong>DELETE</strong>: deletes data from the database</li><li><strong>INSERT INTO</strong>: inserts new data into the database</li><li><strong>CREATE TABLE</strong>: creates a new table within a database</li><li><strong>ALTER TABLE</strong>: modifies a table within a database</li><li><strong>DROP TABLE</strong>: deletes a table from a database</li><li><strong>CREATE INDEX</strong>: creates an index (or search key)</li><li><strong>DROP INDEX</strong>: deletes an index</li></ul><p><em>Note</em>: Clauses are uppercased and each query must end with a semicolon. In a table, there is a column that includes a unique identifier (or primary key) that is used to identify a specific record. In relational databases, columns also contain foreign keys in order to denote relationships with other tables (e.g., in the dogs table below, it could contain a foreign key relating each dog to a specific owner from an owners table).</p><h3>Query Syntax</h3><pre>// <strong>*</strong> means all; to narrow the extraction, specify a column name</pre><pre><strong>SELECT</strong> * <strong>FROM</strong> table_name;<br><strong>SELECT</strong> column_name <strong>FROM</strong> table_name;</pre><pre><strong>UPDATE</strong> table_name <strong>SET </strong>column_name = new_value <strong>WHERE</strong> column_name = existing_value;</pre><pre><strong>DELETE </strong>column_name<strong> FROM </strong>table_name;<br><strong>DELETE</strong> <strong>FROM</strong> table_name <strong>WHERE</strong> column_name <strong>=</strong> existing_value;</pre><pre><strong>INSERT INTO</strong> table_name(column_name_1, column_name_2, column_name_3, ...) <strong>VALUES </strong>(value_1, value_2, value_3, ...);</pre><pre><strong>CREATE TABLE</strong> table_name (<br>column_1_name data_type,<br>column_2_name data_type,<br>column_3_name data_type,<br>...<br>);</pre><pre><strong>ALTER TABLE</strong> table_name <strong>ADD COLUMN</strong> column_name data_type;</pre><pre><strong>DROP TABLE </strong>table_name;</pre><pre><strong>CREATE INDEX </strong>index_name <strong>ON</strong> table_name(column_name); </pre><pre><strong>DROP INDEX </strong>index_name <strong>ON</strong> table_name;</pre><p>Examples:</p><pre><strong>SELECT </strong>* <strong>FROM</strong> dogs;<br><strong>SELECT</strong> name <strong>FROM</strong> dogs;</pre><pre><strong>UPDATE</strong> dogs <strong>SET </strong>age = 3 <strong>WHERE</strong> id = 1;<br><strong>UPDATE</strong> dogs <strong>SET</strong> name <strong>=</strong> &quot;Sid the Kid&quot; <strong>WHERE</strong> name <strong>=</strong> &quot;Sidney&quot;;</pre><pre><strong>DELETE </strong>age<strong> FROM </strong>dogs;<br><strong>DELETE</strong> <strong>FROM</strong> dogs <strong>WHERE</strong> id <strong>=</strong> 1;</pre><pre><strong>INSERT INTO</strong> dogs(id, name, age, owner_id) <strong>VALUES</strong>(1, &quot;Sidney&quot;, 2, 5);</pre><pre><strong>CREATE TABLE</strong> dogs (<br>id INTEGER <strong>PRIMARY</strong> <strong>KEY</strong>,<br>name TEXT, <br>age INTEGER,<br>owner_id INTEGER<br>);</pre><pre><strong>ALTER TABLE</strong> dogs <strong>ADD COLUMN</strong> breed TEXT;</pre><pre><strong>DROP TABLE </strong>dogs;</pre><pre><strong>CREATE INDEX </strong>idx_first_name <strong>ON</strong> dogs(name);</pre><pre><strong>DROP INDEX </strong>idx_first_name <strong>ON</strong> dogs;</pre><p><em>Note</em>: You can format the output of your SELECT statements by running the following commands and then executing your SELECT statement:</p><ul><li><strong>.headers</strong> <strong>on:</strong> outputs the name of each column</li><li><strong>.mode</strong> <strong>column</strong>:<strong> </strong>shifts into column mode, enabling us to run the next two .width commands</li><li><strong>.width auto</strong>: adjusts and normalizes column width</li><li>.<strong>width num_1</strong>: customizes column width (selecting any number you desire)</li></ul><p>For example, using the first command will transform the following output:</p><pre>1|Sidney|3|1|German Shepherd</pre><pre>//</pre><pre>id   name   age   owner_id   breed<br>---- ----   ----    ----      ----<br>1   Sidney   3       1    German Shepherd</pre><h3>Query Constraints</h3><p>Constraints can be added to specify the information that can be contained in a column; this is done when creating a new table. A constraint instructs the database to reject data that does not meet its condition. Some constraints include:</p><ul><li><strong>PRIMARY KEY</strong>: specifies the id column used to identify a row.</li><li><strong>UNIQUE</strong>: ensures each value in a column is unique.</li><li><strong>NOT NULL</strong>: ensures a value is submitted for each column when a new record is created.</li><li><strong>DEFAULT</strong>: creates an assumed value if nothing is specified.</li></ul><p>For example:</p><pre><strong>CREATE TABLE</strong> dogs (<br>id INTEGER <strong>PRIMARY</strong> <strong>KEY</strong>,<br>name TEXT UNIQUE, <br>age INTEGER NOT NULL,<br>breed TEXT DEFAULT &quot;Mixed&quot;,<br>owner_id INTEGER<br>);</pre><h3>Basic Queries / Keywords</h3><ol><li><strong>ORDER BY</strong>: allows us to order the table rows returned by a SELECT statement.</li></ol><pre><strong>SELECT </strong>column_name <strong>FROM</strong> table_name <strong>ORDER BY </strong>column_name <strong>ASC/DESC</strong>;</pre><pre><strong>SELECT </strong>* <strong>FROM</strong> dogs <strong>ORDER BY </strong>age <strong>ASC</strong>;</pre><p>2. <strong>LIMIT</strong>: used to determine the number of records you want returned from a dataset in conjunction with <strong>ORDER BY</strong> to select extreme values from a database table.</p><pre><strong>// </strong>ORDER BY displays the dogs from oldest to youngest, while LIMIT restricts the number of records to 1 - outputting the oldest dog</pre><pre><strong>SELECT </strong>column_name<strong> FROM</strong> table_name <strong>ORDER BY </strong>column_name <strong>DEC LIMIT </strong>num;</pre><pre><strong>SELECT </strong>* <strong>FROM</strong> dogs <strong>ORDER BY </strong>age <strong>DEC LIMIT </strong>1;</pre><p>3. <strong>BETWEEN</strong>: allows us to select all records between certain parameters.</p><pre><strong>SELECT </strong>column_name<strong> FROM</strong> table_name <strong>WHERE</strong> column_name <strong>BETWEEN </strong>value_1 <strong>AND </strong>value_2;</pre><pre><strong>SELECT </strong>name<strong> FROM</strong> dogs <strong>WHERE</strong> age <strong>BETWEEN </strong>1 <strong>AND </strong>3;</pre><p>4. <strong>IS</strong> <strong>NULL</strong>: used to add or search data with missing values.</p><pre>// if an animal shelter needs to input a dog at intake, but the dog doesn&#39;t have a name yet</pre><pre><strong>INSERT INTO </strong>dogs (name, age, breed) <strong>VALUES</strong> (<strong>NULL</strong>, 4, &quot;Belgian Shepherd&quot;);</pre><pre>// can also SELECT dogs with NULL values</pre><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> name <strong>IS NULL</strong>;</pre><p>5.<strong> IS NOT NULL</strong>: used to search for data with a specified value.</p><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> name <strong>IS NOT NULL</strong>;</pre><p>6. <strong>COUNT</strong>: is an aggregate function that operates on <em>groups</em> of records. COUNT will count the number of records that meet a specific condition. Other aggregate functions, for example, will retrieve the minimum and maximum values of a column, sum the values of a column, and get the average of a column’s values.</p><pre><strong>SELECT COUNT </strong>column_name <strong>FROM</strong> table_name <strong>WHERE</strong> column_name = some_value;</pre><pre><strong>SELECT COUNT </strong>owner_id <strong>FROM</strong> dogs <strong>WHERE</strong> owner_id = 1;</pre><p>7. <strong>GROUP BY</strong>: is another aggregate function that will group output by a specified column.</p><pre><strong>SELECT COUNT </strong>column_name <strong>FROM</strong> table_name <strong>WHERE</strong> column_name = some_value;</pre><pre><strong>SELECT</strong> column_name, <strong>COUNT</strong>(column_name) <strong>FROM</strong> table_name <strong>GROUP</strong> <strong>BY</strong> column_name;</pre><pre><strong>SELECT</strong> breed, <strong>COUNT</strong>(breed) <strong>FROM</strong> dogs <strong>GROUP BY</strong> breed;</pre><pre>// this example will return: </pre><pre>breed   owner_id   COUNT(breed)<br> ----     ----      ----<br>  GSD       1        1</pre><p>8. <strong>AS</strong>: allows columns or tables to be renamed using an alias.</p><pre>// the following statement would rename the age column to years old</pre><pre><strong>SELECT </strong>age<strong> AS </strong>years_old <strong>FROM</strong> dogs;</pre><p>9. <strong>DISTINCT</strong>: selects only unique values.</p><pre><strong>SELECT DISTINCT </strong>name <strong>FROM</strong> dogs;</pre><p>10. <strong>WHERE</strong>: selects data based on certain conditions (utilizing the following operators: =, &lt;, &gt;).</p><pre><strong>SELECT</strong> <strong>*</strong> <strong>FROM</strong> dogs <strong>WHERE</strong> name <strong>=</strong> &quot;Sidney&quot;;</pre><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> age &gt; 12;</pre><p>11. <strong>LIKE</strong>: compares similar values.</p><pre>// in the following statement, the underscore and percentage act as a placeholder; returning records where the name of a dog has three letters and ends in &quot;at&quot; regardless of the first letter (e.g., rat, cat, bat, hat - strange dog names, great example). </pre><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> name <strong>LIKE</strong> &quot;_at&quot;;</pre><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> name <strong>LIKE</strong> &quot;%at&quot;;</pre><p>12. <strong>AND</strong>: allows us to search for multiple criteria. A record must meet both.</p><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> age <strong>BETWEEN</strong> 3 <strong>AND</strong> 5 <strong>AND</strong> breed = &quot;German Shepherd&quot;;</pre><p>13. <strong>OR</strong>: allows us to search for multiple criteria. A record must meet at least one.</p><pre><strong>SELECT</strong> * <strong>FROM</strong> dogs <strong>WHERE</strong> age <strong>BETWEEN</strong> 3 <strong>AND</strong> 5 <strong>OR</strong> breed = &quot;German Shepherd&quot;;</pre><p><em>Note</em>: Now that we’re familiar with SELECT, there is an alternate syntax:</p><pre><strong>SELECT </strong>table_name.column_name<strong> FROM </strong>table_name;<br><strong> <br>SELECT</strong> dogs.name <strong>FROM</strong> dogs;</pre><pre>// this syntax is useful if we wanted to get the names of animals from both the cats and dogs tables</pre><pre><strong>SELECT</strong> dogs.name, cats.name <strong>FROM</strong> dogs, cats;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e181812270b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Tools To Your Technical Toolbox: JavaScript Edition I]]></title>
            <link>https://madelinestalter.medium.com/adding-tools-to-your-technical-toolbox-javascript-edition-i-abcb467cbf46?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/abcb467cbf46</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Thu, 04 Feb 2021 04:17:24 GMT</pubDate>
            <atom:updated>2021-02-04T04:22:41.521Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript is a powerful, object-oriented language that empowers us to do a lot of amazing things — from building dynamic, ultra responsive websites to handling API calls and more. However, in accordance with a colloquial phrase, in order to run we must first walk; in this article, I detail base concepts that every front end developer should know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*rVoAoUG1rgvmmHmmf1SsfQ.jpeg" /><figcaption>Source: <a href="https://lh3.googleusercontent.com/proxy/PvuOOzJDIHY9S97rV5ez4EXQPF2K4LxMRC1RNsxP8NNn-NVBaFqrVGY6MibSYCGcpxp6eYR2sKbSFuybNwkBUA1tE_f9uS2E8MwP">https://lh3.googleusercontent.com/proxy/PvuOOzJDIHY9S97rV5ez4EXQPF2K4LxMRC1RNsxP8NNn-NVBaFqrVGY6MibSYCGcpxp6eYR2sKbSFuybNwkBUA1tE_f9uS2E8MwP</a></figcaption></figure><h3>JavaScript is:</h3><ul><li><strong>High Level </strong>as it allows us to abstract concepts to decrease our mental load and write code efficiently without having to worry about what’s going on under the hood; it manages memory automatically using a garbage collector; and it provides many constructs to create reusable variables/objects.</li><li><strong>Dynamic </strong>as<strong> </strong>it executes at runtime giving us robust features like dynamic typing, late binding, reflection, functional programming, object runtime alteration, closures, etc.</li><li><strong>Interpreted </strong>as<strong> </strong>browsers are able to compile JavaScript before executing it thus increasing performance.</li><li><strong>Multi-Paradigm </strong>as<strong> </strong>the language does not enforce any particular programming paradigm (e.g., you can use class based and functional programming as of ES6).</li></ul><h3>Now For Your Tools:</h3><ol><li><strong>White Space </strong>is not meaningful in JavaScript. The amount of spaces and line breaks should be consistent throughout your application. A linter or styling tool, such as Prettier, can help with this.</li><li>JavaScript is <strong>Case Sensitive</strong>; variables should be declared using camelCase.</li><li><strong>Literals</strong> are values written in source code. For example:</li></ol><pre><strong>16<br>&quot;I am a string!&quot;<br>true<br>[&quot;Weights&quot;, &quot;Cardio&quot;]<br>{name: &quot;Sidney&quot;, breed: &quot;German Shepherd&quot;, color: &quot;Black &amp; Tan&quot;}</strong></pre><p>4. <strong>Identifiers</strong> are a sequence of characters that, as the name suggests, can be used to identify a variable, function, or object. It can start with a letter, dollar sign (commonly used to reference DOM elements), or underscore and can contain integers. <em>Note</em>: some names are reserved as keywords for JavaScript to use internally and therefore cannot be used as identifiers.</p><p>5. <strong>Comments</strong> are arguably one of the most important parts of an application; allowing us to annotate our thought process and give key insight for later use to not only ourselves, but other developers. Single-line comments are denoted using //, whereas multi-lined comments start with /* and end with */ with notes in-between.</p><p>6. <strong>Semicolons</strong> are used to mark the end of code lines. The use of semi-colons is good practice, but nowadays the JavaScript interpreter is smart enough to introduce semicolons for you.</p><p>7. <strong>Values</strong> are things such as peyton and 4, whereas string and integer are <strong>Types</strong> of those values. Types are then classified into <strong>Primitive</strong> and <strong>Object</strong>. Primitive data include integers, strings, booleans, symbols, null and undefined, while Object data have properties and methods.</p><p>8. When we need to reference a value, we assign it to a <strong>Variable</strong>. Variables must be declared before you can use them. There are two ways to declare variables — using const and let. const points to a <em>constant</em> reference to a value and must be initialized at the declaration (i.e., once assigned, you cannot change the value), whereas let is the exact opposite.</p><pre><strong>const m = 4</strong></pre><pre>//</pre><pre><strong>let m<br>m = 16</strong></pre><pre>// for both const and let you can assign multiple values</pre><pre><strong>const hello = 5, goodbye = 10<br>let hola = 15, adios = 20</strong></pre><p>It is recommended to only use let when you know you’ll need to reassign a value as this decreases potential sources for bugs via accidental reassignment.</p><p><em>Note</em>: Variables are untyped meaning you can assign a variable a value with some type (e.g., a string) and later reassign another type (e.g., an integer) without issue.</p><p>9. An <strong>Expression</strong> is a unit of code that JavaScript can evaluate and return a value. Naturally, expression vary in complexity.</p><pre>// primary</pre><pre><strong>2<br>&quot;Happy&quot;<br>true</strong></pre><pre>// arithmetic</pre><pre><strong>i++<br>1 / 2</strong></pre><pre>// string </pre><pre><strong>&quot;I&quot; + &quot;love&quot; + &quot;to&quot; + &quot;code&quot;</strong></pre><pre>// logical (use comparison operators and resolve to a boolean value)</pre><pre><strong>m &amp;&amp; s<br>m || s</strong></pre><pre><br>// more advanced expressions involve objects, functions, and arrays</pre><p>10. <strong>Operators</strong> allow you to combine expressions to create complexity in code.</p><pre>// Assignment Operator: used to assign a value</pre><pre><strong>let ten = 10</strong></pre><pre>// Addition Operator: used to perform addition as well as concatenate strings</pre><pre><strong>const three = 1 + 2<br>const three = &quot;thr&quot; + &quot;ee&quot;</strong></pre><pre>// Subtraction Operator: used to perform subtraction  </pre><pre><strong>const six = 12 - 6</strong></pre><pre>// Division Operator: used to perform division </pre><pre><strong>const five = 20 / 4</strong></pre><pre>// Multiplication Operator: used to perform multiplication</pre><pre><strong>const twelve = 6 * 2</strong></pre><pre>// Remainder Operator: used to calculate the remainder<br> <br><strong>const zero = 20 % 5</strong></pre><pre>// Exponentiation Operator: used to find the power of the 2nd operand</pre><pre><strong>cont four = 2 ** 2</strong></pre><p>11. <strong>Comparison Operators </strong>are used to check if specific conditions are met and, as a result, always return a boolean value.</p><ul><li><strong>Less Than</strong>: &lt; means &quot;less than&quot;</li><li><strong>Less Than or Equal To</strong>:&lt;=</li><li><strong>Greater Than</strong>:&gt; means &quot;greater than&quot;</li><li><strong>Greater Than or Equal To</strong>:&gt;=</li><li><strong>Equality</strong>: ===</li><li><strong>Inequality</strong>: !==</li></ul><p>12. <strong>Conditionals</strong> use if / if...else statements that instruct the program to perform specific actions depending on the result of an expression evaluation.</p><pre>if (true) {<br>  // do something<br>  console.log(&quot;Please hire me! :)&quot;)<br>}</pre><pre>//</pre><pre>if (true) {<br>  // do something<br>} else {<br>  // do something else<br>}</pre><p>13. <strong>Arrays</strong> are collections of elements, as well as objects. Arrays can hold any value (including other arrays)! You can access any element in an array by referencing its index which starts at 0.</p><pre><strong>const us = [&quot;NYC&quot;, &quot;Savannah&quot;, &quot;Boston&quot;]</strong></pre><pre>// You can find the number of elements in an array by calling .length</pre><pre><strong>cities.length // 3</strong></pre><pre>// You can add an element to the end of an array using .push</pre><pre><strong>cities.push(&quot;LA&quot;)</strong></pre><pre>// You can add an element to the beginning of an array using .unshift</pre><pre><strong>cities.unshift(&quot;DC&quot;)</strong></pre><pre>// You can remove an element from the end of an array using .pop</pre><pre><strong>cities.pop()</strong></pre><pre>// You can remove an element from the beginning of an array using .pop</pre><pre><strong>cities.shift()</strong></pre><pre>// You can combine two or more arrays using .concat or the spread operator</pre><pre><strong>const europe = [&quot;London&quot;, &quot;Berlin&quot;, &quot;Paris&quot;]<br>const world = cities.concat(europe)<br>const world = [...us, ...europe]</strong></pre><pre><strong>world // [</strong><strong>&quot;NYC&quot;, &quot;Savannah&quot;, &quot;Boston&quot;, &quot;London&quot;, &quot;Berlin&quot;, &quot;Paris&quot;]<br>us // [</strong><strong>&quot;NYC&quot;, &quot;Savannah&quot;, &quot;Boston&quot;]<br>europe // [&quot;London&quot;, &quot;Berlin&quot;, &quot;Paris&quot;]</strong></pre><pre>// You can check if an array contains a specific element using .includes</pre><pre><strong>cities.includes(&quot;Paris&quot;)<br>// true</strong></pre><p>14. <strong>Strings</strong> can be denoted using single or double quotes (as long as you’re consistent throughout your application). Backticks can be used to define multi-lined strings or to interpolate information within a string.</p><pre><strong>const long = `Wow! I just read the Great Gatsby for the 500th time. I absolutely love this book and want to watch the movie, but can&#39;t find it for free online.`</strong></pre><pre>// defined variables can be interpolated</pre><pre><strong>const variable = </strong><strong>`Hello! My name is ${name}.`</strong></pre><pre>// expressions can also be interpolated</pre><pre><strong>const expression = </strong><strong>`something ${foo() ? &#39;x&#39; : &#39;y&#39;}`</strong></pre><p>15. <strong>Functions</strong> are blocks of code that are self-contained. For example:</p><pre>function hello() {<br>  // do something<br>}</pre><pre>// In order to execute, functions must be invoked like so: </pre><pre>hello()</pre><p>A function can have one or more argument(s). When we pass arguments, we define parameters that must be met in invocation. Any value can be passed as a parameter (including other functions).</p><pre><strong>function hair(color, length) {<br>  // do something<br>}</strong></pre><pre><strong>hair(&quot;brown&quot;, 27)<br>hair(&quot;black&quot;)</strong></pre><pre>// In the second invocation, we did not pass in a length argument. Therefore, in that instance, length will be undefined. To avoid this, you can add default parameters if an argument is missing.</pre><pre><strong>function hair(color = &quot;blonde&quot;, length = 22) {<br>  // do something<br>}</strong></pre><p>By default, a function returns undefined, unless you add the return keyword with a value:</p><pre><strong>function hello() {<br>  // do something<br>  return &#39;Bonjour!&#39;<br>}</strong></pre><p>We can assign this return value to a variable when we invoke the function:</p><pre><strong>function hello() {<br>  // do something<br>  return &#39;Bonjour!&#39;<br>}</strong></pre><pre><strong>let greeting = hello()</strong></pre><pre><strong>greeting // Bonjour!</strong></pre><p>To return multiple values, you can return an object or array:</p><pre><strong>function madeline() {<br>  return [&quot;Madeline Rose Stalter&quot;, 25]<br>}</strong></pre><pre><strong>let [name, age] = madeline()</strong></pre><p>16. <strong>Arrow Functions </strong>are often favored over the aforementioned and must be assigned to a variable.</p><pre><strong>const getData = () =&gt; {<br>  // do something<br>}</strong></pre><pre><strong>getData()</strong></pre><p>Parameters are passed in the parentheses:</p><pre><strong>const getData = (name, height) =&gt; {<br>  console.log(name, height)<br>}</strong></pre><p>Arrow functions have implicit returns or values that are returned without having to use the return keyword. Aside from that, the two types function very similarly. The major difference will be discussed in Edition II.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abcb467cbf46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choose Your Character: Ruby Iterator Edition]]></title>
            <link>https://madelinestalter.medium.com/choose-your-character-ruby-iterator-edition-e821f1cb48e8?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e821f1cb48e8</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[iteration]]></category>
            <category><![CDATA[enumeration]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Wed, 27 Jan 2021 14:14:01 GMT</pubDate>
            <atom:updated>2021-01-27T14:14:01.865Z</atom:updated>
            <content:encoded><![CDATA[<p>Programming languages have many ways to repeat instructions. While others use loops, Ruby leverages iterators to accomplish this task. Deciding what iterator to use can be tricky, but I’m here to help! First, let’s explore some basic terminology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Qr9Bvazgv2DznViLyyXtaw.jpeg" /></figure><h4>Loop</h4><p>A Loop is a repetitive execution of a block of code; specified once and run until a specific condition is met. This action is particularly useful when you want to automate some repeatable action. An example of a loop would be:</p><pre>x = 0<br><br><strong>while</strong> x &lt; 5<br>  <strong>if</strong> x.even?<br>    puts x<br>  <strong>end</strong><br>  x += 1<br><strong>end</strong><br><br><strong># =&gt; 0</strong><br><strong># =&gt; 2</strong><br><strong># =&gt; 4</strong></pre><h4>Iterator</h4><p>An iterator is an object (or method) allowing us to iterate over a dataset (particularly arrays and hashes). To iterate over a dataset means that we can go through each object in a collection and do some repeatable action. Although similar, the defining difference between loops and iterators is that a loop needs an external object to work (e.g., x=0), whereas an iterator belongs a (or is a built in method for) a collection. An example of an iterator would be:</p><pre>video_game_array = [&quot;Call of Duty&quot;, &quot;Mortal Kombat&quot;, &quot;Mario Kart&quot;]<br><br>video_game_array.each <strong>do</strong> |item|<br>  puts item<br><strong>end</strong><br><br><strong># =&gt; Call of Duty</strong><br><strong># =&gt; Mortal Kombat</strong><br><strong># =&gt; Mario Kart</strong></pre><p>Now that we understand the basic terminology, we can now dive into the main types of iterators in Ruby.</p><h3>Filter/Select</h3><p>Two names for the same iterator! This iterator allows us to select specific elements from a collection based upon some condition. For example:</p><pre># I want to find all pet names that are shorter than 4 letters</pre><pre>pets_array = [&quot;Sidney&quot;, &quot;Stockli&quot;, &quot;Roo&quot;, &quot;Peyton&quot;]</pre><pre>pets_array.select{|pet| pet.length &lt; 4}</pre><pre><strong># =&gt; Roo</strong></pre><p>This is particularly helpful when you want to select a specific group of elements in a collection; you’re not interested in the whole collection, just a subset of it. <strong>Find_all</strong> behaves in the same way.</p><h3>Map/Collect</h3><p>Again, two terms for the same iterator. Map/Collect will return a new object based upon specified calculations; or in other words, map/collect will create a new collection. For example,</p><pre>numbers_array = [1, 2, 3]</pre><pre>numbers_squared = numbers_array.map{|number| number ** 2}</pre><pre>numbers_squared</pre><pre><strong># =&gt; [1, 4, 9]</strong></pre><pre>numbers_array</pre><pre><strong># =&gt; [1, 2, 3]</strong></pre><p>It’s important to note that the initial array did not change. We can use Map/Collect to generate a new collection based on an existing collection, but we won’t change the initial object.</p><h3>Find</h3><p>Find will return the first element that fulfills some specified condition (i.e., the result of this iteration will be a single element, not a collection). For example:</p><pre>bike_types_array = [&quot;Comfort&quot;, &quot;Hybrid&quot;, &quot;Road Bike&quot;]</pre><pre>bike_types_array.find{|bike| bike.include?(&quot;C&quot;)}</pre><pre><strong># =&gt; Comfort</strong></pre><p>Note: <strong>Include?</strong> is a string class method in Ruby which is used to return true if the given string contains a specified string or character.</p><h3>Each</h3><p>Each allows us to easily perform operations on elements in a collection. This iterator is also useful for when we just want to output some data to the console. For example:</p><pre># I want a list of my favorite cities to print out in uppercase</pre><pre>my_favorite_cities = [&quot;New York City&quot;, &quot;Savannah&quot;, &quot;Boston&quot;]</pre><pre>my_favorite_cities.each{|city| puts city.upcase}</pre><pre><strong># =&gt; NEW YORK CITY<br># =&gt; SAVANNAH<br># =&gt; BOSTON<br># =&gt; [&quot;New York City&quot;, &quot;Savannah&quot;, &quot;Boston&quot;]</strong></pre><p>It’s important to note that Each will not change the initial object; Each will always return the base, or original, collection.</p><h3>All?/Any?</h3><p>These iterators will return a boolean value after checking if a condition if met. All? will return true when all elements in a collection fulfill the condition, whereas Any? will return true if just one element in a collection fulfills the condition. For example:</p><pre>numbers_array = [1, 2, 3]</pre><pre>numbers_array.all?{|number| number.even?}</pre><pre><strong># =&gt; false</strong></pre><pre>numbers_array.any?{|number| number.even?}</pre><pre><strong># =&gt; true</strong></pre><h3>Times</h3><p>This iterator allows us to repeat tasks many times. Times is called on numbers (rather than a collection) and will return the numerical value of execution (instead of an original collection like Each). For example:</p><pre>5.times <strong>do</strong><br>  puts &quot;Ruby is the best language ever!&quot;<br><strong>end</strong></pre><pre><strong># =&gt; Ruby is the best language ever!<br># =&gt; Ruby is the best language ever!<br># =&gt; Ruby is the best language ever!<br># =&gt; Ruby is the best language ever!<br># =&gt; Ruby is the best language ever!</strong><br><strong>#  =&gt; 5</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e821f1cb48e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Technical Interview: Must Know Ruby on Rails Questions]]></title>
            <link>https://madelinestalter.medium.com/mastering-the-technical-interview-must-know-ruby-on-rails-questions-845134ebfa48?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/845134ebfa48</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[back-end-development]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Thu, 21 Jan 2021 01:33:04 GMT</pubDate>
            <atom:updated>2021-01-21T01:33:04.262Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Full-Stack Engineer and after my last article on React, it only seems right to also inform my readers about 22 essential questions regarding Ruby on Rails that will help them ace the verbal portion of the interview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bvUPO-W4aVqwrmfTfnjoA.jpeg" /><figcaption>Source: <a href="https://miro.medium.com/max/15366/1*TQmpa7zsU4zocFVdilhcZw.jpeg">https://miro.medium.com/max/15366/1*TQmpa7zsU4zocFVdilhcZw.jpeg</a></figcaption></figure><h3>1. What is Ruby on Rails?</h3><ul><li>Ruby is an objected oriented programming language that was created in 1995 by Yukihiro Matsumoto.</li><li>Rails is a back end framework that’s compatible with the Ruby library for building web applications.</li></ul><h3>2. How Does Ruby on Rails Use the MVC Framework?</h3><ul><li>MVC stands for Model View Controller and is an architectural pattern that favors convention over configuration.</li><li><strong>Model</strong>: A Ruby class that handles the domain logic of an application. In the model, you can perform complex database queries, draw data relationships, create custom algorithms, assign data attributes, and more.</li><li>The model utilizes the Active Record Library / inherits from ActiveRecord::base in order to form a bridge between the Ruby program code and the relational database. This inheritance allows the model to access a number of methods that assists in working with the database, without having the write them out explicitly.</li><li>It’s important to remember to follow the single responsibility principle here. If any methods in the model perform tasks that are out of scope, they should be moved to their own class.</li><li><strong>View</strong>: Renders any information the controller sends it from the database. This is implemented by using the Action View Library that is based on Embedded Ruby (ERB) and determines how data will be presented. <em>(Note: if you’re using a front end framework, the views folder will be empty).</em></li><li><strong>Controller</strong>: Manages data flow between the router, models, and views. Transmits data requests from the user to the model and then delivers data that is rendered in the view to the user. Utilizes 7 actions that allow the application to display the index page (index), display the show page (show), create a new instance (new, create), edit an instance (edit, update), and delete an instance (destroy).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h3cfk9H14FasbYO1Z5QtnQ.png" /></figure><h3>3. How Does Rails Implement Asynchronous JavaScript and XML (AJAX) Requests?</h3><ul><li>AJAX is a suite of technologies used to retrieve data from the server without having to refresh the webpage making that request. The Rails method of implementing AJAX operations is simple:</li><li>1. A trigger (e.g., a user clicking on a button to view a list of adoptable dogs) is fired.</li><li>2. The web client uses JavaScript to send data via an XMLHttpRequest from the trigger to an action handler on the server.</li><li>3. On the server-side, a Rails controller action receives the data and returns the corresponding HTML fragment to the client.</li><li>4. The web client receives the fragment and updates the view accordingly.</li></ul><h3>4. What is a Rails Migration?</h3><ul><li>A Rails Migration is a process that can be used to rename a table, add a column, change a column, drop a table, remove a column and more. Example commands include:</li><li>Rails g migration create_users name age:integer email_address</li><li>Rails g migration add_phone_number_to_users phone_number:string</li></ul><h3>5. What are Routes?</h3><ul><li>Routing in Rails allows for the application to know what view to render to the user. Rails routing connects incoming HTTP requests to the code in your application’s controllers and helps generate URLs without having to hard-code them as strings.</li><li>When a URL is entered into a browser, an HTTP request is made. That request is sent to the server where the application’s router (i.e., routes.rb file) interprets the request and sends a message to the controller mapped to that route.</li><li>The controller communicates with the view file mapped to the controller action.</li><li>The server returns that HTTP response, which contains the view page that can be viewed in the browser.</li><li>There are 7 standard RESTful routes. Defining routes with the “resources” method allows you to automatically generate all 7 routes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tdi00qbLIaGztFyiLugOtQ.png" /><figcaption>Source: <a href="https://miro.medium.com/max/2628/1*M0hdLsgbzelOFuq-1BVH-g.png">https://miro.medium.com/max/2628/1*M0hdLsgbzelOFuq-1BVH-g.png</a></figcaption></figure><h3>6. What are the HTTP Verbs?</h3><ul><li>The <strong>GET</strong> method retrieves whatever information is identified by the Request URI.</li><li>The <strong>POST</strong> method is used to send data enclosed in the request to the server. The server is expected to use this data to create some new resource.</li><li>The <strong>PATCH/PUT </strong>methods both represent the HTTP verbs that are used to update existing resources.</li><li>The <strong>DELETE</strong> method requests that the server delete the resource identified by the Request URI.</li></ul><h3>7. Why is *Almost* Everything in Ruby an Object?</h3><ul><li>Objects are considered to be bundles of data that we can perform methods on. In object-oriented programming, an object is an instance of a class. In Ruby, classes are also objects (all classes are instances of the class Class).</li><li>Only a handful of things are not objects such as blocks, methods, and conditional statements.</li></ul><h3>7. Is Ruby Statically or Dynamically Typed?</h3><ul><li>Ruby is dynamically typed meaning you can change the type and/or value of a variable without error.</li><li>Example:</li></ul><pre>x = 16<br>x = &quot;hello world&quot;</pre><h3>8. What’s the Difference Between Getter and Setter Methods?</h3><ul><li>Getter methods allow us to access instance variables, while setter methods allow us to set instance variables.</li><li>Ruby provides three accessor methods that allow us to get and set instance variables: attr_reader (getter), attr_writer (setter), and attr_accessor (setter and getter). Example:</li></ul><pre>class Dog<br>  attr_accessor :color<br>end</pre><pre>dog1 = Dog.new<br>dog1.color = &quot;black&quot;<br>puts dog1.color #=&gt; black</pre><h3>9. How Do You Call a Method In Ruby and What Happens When You Do?</h3><ul><li>You can call a method in Ruby using dot notation (or the dot operator).</li><li>For example, using our dog1 instance from above — we called dog1.color in order to return the color of that specific dog instance.</li></ul><h3>9. What is a Gemfile?</h3><ul><li>A Gemfile is where dependencies are specified; it is located in the project’s root directory.</li></ul><h3>10. What is a Gemfile.lock?</h3><ul><li>A Gemfile.lock contains records of exact versions of gems installed. This is done so that the same versions can be installed if another machine clones the project.</li><li>If you delete the Gemfile.lock or do not specify a specific version of gem, it will just install the latest version when cloning the project to a new machine.</li></ul><h3>11. What is the Difference Between Count, Length, and Size?</h3><ul><li>Count: executes a SQL query to count the number of records. This is useful if the number of records may have changed in the database vs. memory.</li><li>Length: returns the number of items in a collection in memory. Its lighter weight than count because no database transaction is performed. It can also be used to count characters in a string.</li><li>Size: is an alias for length and does the same thing.</li></ul><h3>12. What are Callbacks?</h3><ul><li>Callbacks are hooks in the object lifecycle where you can execute methods. A variety of callbacks exist around creating, updating, and destroying an object such as before_validation, after_save, and after_destroy.</li><li>Callbacks are useful for conditional logic; for example, when creating an associated record when a user record is created.</li></ul><h3>13. What is the Difference Between Class and Instance Methods?</h3><ul><li>As their names suggest, class methods are available on classes and instance methods are available on instances.</li><li>Class methods are denoted by:</li></ul><pre>def self.method_name<br>end </pre><ul><li>*Self refers to the current class.</li><li>For example, for a class Car, an instance method may check the average speed of a specific car, whereas the class method may assess the average number of miles driven across all cars.</li></ul><h3>14. Does Ruby Allow Multiple Inheritances?</h3><ul><li>Ruby does not allow inheriting from more than one parent class, but it does allow mixing modules with include and extend.</li></ul><h3>15. Is Ruby Strongly or Weakly Typed?</h3><ul><li>Ruby is strongly typed; you cannot concatenate data types.</li><li>For example, “hello” + 3 would throw an error in Ruby.</li></ul><h3>16. How do we Declare a Constructor Class in Ruby?</h3><ul><li>A constructor is defined with the initialize method that is called when a new instance of a class is created. For example:</li></ul><pre>class Puppy<br>  attr_reader :breed<br>  def initialize(breed)<br>    <a href="http://twitter.com/name">@b</a>reed = breed<br>  end<br>end</pre><pre>Sidney = Puppy.new(&quot;German Shepherd&quot;)<br>puts Sidney.breed # =&gt; German Shepherd</pre><h3>17. What is Rack?</h3><ul><li>Rack is an API sitting between the web server and Rails; it allows us to plug in and swap frameworks like Rails with Sinatra or web severs like Unicorn with Puma.</li></ul><h3>18. What is Yield?</h3><ul><li>Yield accesses a code block passed into a method. For example:</li></ul><pre>def yield_example<br>  puts &quot;first line&quot;<br>  yield if block_given?<br>  puts &quot;third line&quot;<br>  yield if block_given?<br>end</pre><pre>yield_example { puts &quot;yielding&quot; }<br># =&gt; first line<br># =&gt; yielding <br># =&gt; third line<br># =&gt; yielding</pre><h3>18. What’s the Difference Between a Hash and JSON?</h3><ul><li>A Hash is a collection of key/value pairs.</li><li>JSON is a string in a specified format for sending data.</li></ul><h3>19. What are Some Advantages of Rails?</h3><ul><li>User friendly; gentle learning curve given its prioritization of convention over configuration.</li><li>Widely backed by the open source community; lots of resources and support.</li></ul><h3>19. What are Some Disadvantages of Rails?</h3><ul><li>Run and boot time can be slow.</li></ul><h3>20. What is Spring?</h3><ul><li>Spring preloads applications; keeping the application running int he background so booting is not required when you run a migration or rake task.</li></ul><h3>21. What is the Difference Between Select, Map, and Collect?</h3><ul><li>Select: Used to grab a subset of a collection. Example:</li></ul><pre>i = [1,2,3,4,5]<br>i.select {|x| x % 2 == 0}<br># =&gt; [2, 4]</pre><ul><li>Map: Performs an action on each element of a collection and outputs an updated collection. Example:</li></ul><pre>i = [1,2,3,4,5]<br>i.map {|x| x+1}<br># =&gt; [2,3,4,5,6]</pre><ul><li>Collect: Is an alias of Map and does the same thing.</li></ul><h3>22. What are the Three Levels of Access Control?</h3><ul><li><strong>Public</strong>: Any object can call this method.</li><li><strong>Protected</strong>: Only the class that defined the method and its subclasses can call this method.</li><li><strong>Private</strong>: Only the object itself can call this method.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=845134ebfa48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Technical Interview: Must Know React Questions]]></title>
            <link>https://madelinestalter.medium.com/mastering-the-technical-interview-must-know-react-questions-847800fc6aa7?source=rss-b6d4f3aa08e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/847800fc6aa7</guid>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[technical]]></category>
            <dc:creator><![CDATA[Madeline Stalter]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 02:50:13 GMT</pubDate>
            <atom:updated>2021-01-14T02:50:13.698Z</atom:updated>
            <content:encoded><![CDATA[<p>You’re starting your job search — congratulations! As the elation of finishing your program wears off, your mind inevitably turns towards the technical interview. The mere thought of this can feel like you’re looking up at a mountain. However, I’m here to help! I have identified 15 key questions that will help you ace the verbal portion of the interview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*3Li27SZyeG16WDdwL-JqGw.png" /><figcaption>Source: <a href="https://tsh.io/wp-content/uploads/2019/12/react-meme1_.png">https://tsh.io/wp-content/uploads/2019/12/react-meme1_.png</a></figcaption></figure><h3><strong>1. What is React?</strong></h3><ul><li>React is a front end framework that’s compatible with the JavaScript library for building web and mobile applications.</li><li>It was developed by Facebook in 2011.</li><li>It allows developers to build reusable UI components and has support of a significant portion of the open source community.</li></ul><h3>2. What are Components?</h3><ul><li>Components are the fundamental building blocks of React that break a UI down into reusable parts.</li><li>React renders each UI component as needed (or independently from each other) which results in fast performance speeds.</li></ul><h3>3. What is the Difference Between Props and State?</h3><ul><li>State describes a default data value in a React component that can change over time (usually based on user actions that call for changes in the UI). State is managed internally by the component.</li><li>Props (short for properties) describe the way in which a React component is configured. Props are passed down from a parent and do not change.</li></ul><h3>4. What are Component Lifecycle Methods?</h3><ul><li>React component lifecycle methods are functions that a component can execute during specific lifestyle phases.</li><li>The component’s lifecycle includes its birth (the component being created and mounted on the DOM), its growth (the component being updated over time), and its death (the component is unmounted from the DOM).</li><li>For example, when building full stack web applications, I can leverage the componentDidMount lifecycle method to fetch data from external APIs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2QFVIm_irhm5XU9SzEeqA.png" /><figcaption>Source: <a href="https://miro.medium.com/max/4560/1*EnuAy1kb9nOcFuIzM49Srw.png">https://miro.medium.com/max/4560/1*EnuAy1kb9nOcFuIzM49Srw.png</a></figcaption></figure><h3>5. What is the Difference Between Class and Functional Components?</h3><ul><li>Functional Components are the most basic kind of React component, defined by the component’s props.</li><li>In contrast, Class Components are more complicated React components that allow developers to execute component lifecycle methods and manage a component’s state.</li></ul><h3>6. What are React Events?</h3><ul><li>Events are reactions that are triggered by specific user actions (e.g., clicking on a button in the UI).</li></ul><h3>7. What is JSX?</h3><ul><li>JSX stands for JavaScript XML and is an HTML-like syntax that lets developers write HTML style code in JavaScript.</li><li>Although we don’t need to use JSX to build applications with React, it is a helpful tool for reducing overall code complexity as it increases readability.</li><li>Facebook, React’s founder, also encourages using JSX in their documentation.</li></ul><h3>8. What is the Virtual DOM?</h3><ul><li>When the browser renders HTML documents, they create a representational tree of how the site or application is arranged. This representation tree is called the DOM.</li><li>Without React, the website or application will use HTML to update its DOM in order to make things “change” on screen without the user needing to manually refresh a page.</li><li>However, React takes a slightly different approach by creating the Virtual DOM which is a copy of the actual DOM.</li><li>React uses this copy to determine what parts of the actual DOM need to updated based on the user’s action (which causes discrepancies between the actual and virtual DOM).</li><li>React then takes the changes from the Virtual DOM and selectively updates the actual DOM (versus reloading the entire page). Over time and as an application scales, this leads to significant performance improvements.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*BcD-GDllCyyF58C4LEJVVw.png" /><figcaption>Source: <a href="https://miro.medium.com/max/800/1*CqdIWZy0NMPQhYx2rKzo9g.png">https://miro.medium.com/max/800/1*CqdIWZy0NMPQhYx2rKzo9g.png</a></figcaption></figure><h3>9. What are Some Debugging Tools in React?</h3><ul><li>You can use the wildly available React Developer Tools; accessed in browser by pressing and holding option, command, J on a Mac.</li><li>The developer tools’ console will allow you to console.log various parts of your code to verify you’re getting the correct information.</li><li>The developer tools’ elements will allow you to look at your code in terms of HTML to ensure you’re accessing the proper elements.</li><li>You can also install the React Components Chrome add on, that will allow you to visualize how elements are laid out on the page.</li><li>Linters (eslint, jslint) are also very helpful as they’re software that statically analyzes your code to fix problems; built in to most text editors and run as part of the CI pipeline.</li></ul><h3>10. What is the Difference Between React JS and React Native?</h3><ul><li>ReactJS is an open source JavaScript library used for building web applications.</li><li>React Native is an open source framework for building iOS and Android mobile applications.</li><li>The “native” portion of the mobile framework’s name refers to the integration of React components with native capabilities of mobile-specific platforms.</li></ul><h3>11. What are Some Advantages of React?</h3><ul><li>React offloads a lot of work brought forth by vanilla Javascript.</li><li>Increased application performance via the Virtual DOM.</li><li>Improved code efficiency with JSX.</li><li>Ability to reuse components across multiple projects.</li><li>Flexibility and extensibility through add-on tools provided by React’s open source community.</li></ul><h3>12. What are Some Limitations of React?</h3><ul><li>React is a JavaScript library and not a full-blown framework, meaning it might not be full service enough for some projects.</li><li>React’s library is extremely large and can take additional time and experience (past the initial learning phase) to really understand it.</li><li>JSX adds a new coding dimension for developers who haven’t used it before (though it does have a gentle learning curve).</li></ul><h3>13. What is Redux?</h3><ul><li>Redux is a library that’s compatible with and complementary to React.</li><li>It’s used for state management; diligently keeping track of data flow.</li></ul><h3>14. What are Some Advantages of Redux?</h3><ul><li>Adds structure to React; making code easier to maintain with more predictable results.</li><li>Includes developer tools that allow developers to track application performance from actions to state changes in real time.</li><li>Strong community support.</li></ul><h3>15. What are Hooks?</h3><ul><li>Hooks allow us to use functional components without having to refactor into class components to track state and use lifecycle methods. There are 2 hooks: useState and useEffect.</li><li>useState gives functional components access to “state.” State is in quotes because it does not have a state object (there is no this.setState); however, it does give the ability to manage its own state. Example: implementing a counter.</li><li>useEffect gives a functional component access to “lifecycle methods.” Lifecycle methods are in quotes again as they’re not true lifecycle methods; but can function similarly thanks to useEffect. With useEffect we can update a component based upon function logic (i.e., run this based upon the arguments I receive; similar to componentDidUpdate) and we can also remove logic (i.e., if my component is deleted remove this; similar to componentDidUnmount).</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847800fc6aa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>