<?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 Jathmel Gordon on Medium]]></title>
        <description><![CDATA[Stories by Jathmel Gordon on Medium]]></description>
        <link>https://medium.com/@jathmel?source=rss-9afb8efe41b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Jathmel Gordon on Medium</title>
            <link>https://medium.com/@jathmel?source=rss-9afb8efe41b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:18:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jathmel/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[It’s about Trees]]></title>
            <link>https://medium.com/@jathmel/its-about-trees-51fbed0e4ef6?source=rss-9afb8efe41b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/51fbed0e4ef6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[binary-search-tree]]></category>
            <category><![CDATA[data-type]]></category>
            <dc:creator><![CDATA[Jathmel Gordon]]></dc:creator>
            <pubDate>Tue, 17 Jul 2018 18:25:25 GMT</pubDate>
            <atom:updated>2018-07-17T20:46:00.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A3JeFI5Jpm-WbWBY" /><figcaption>Photo by <a href="https://unsplash.com/@jleeems?utm_source=medium&amp;utm_medium=referral">Jason Leem</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In JS we were introduce to the DOM as a tree like structure that are made up of nodes that can be added and removed at any given time from the root or parent node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*LA6AXbzvC0IQ_d2H8v3NCw.gif" /><figcaption>Source: W3Schools</figcaption></figure><p>The above structure is a representation of the of the HTML-JavaScript DOM. As you can see it begins at a single source the “D<strong><em>ocument</em></strong>” then moves down an each node below is consider a descendant of “Document”.</p><p>A <strong>tree</strong> as it relates to programming and computer science is is a widely used A<a href="https://www.geeksforgeeks.org/abstract-data-types/">bstract Data Type (ADT)</a> or data structure implementing this ADT, that simulates a hierarchical <strong>tree</strong> structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.</p><p>To better understand trees there are a few terminology that I will define below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*87h2uhCJ5qztBNwfck2b6g.jpeg" /><figcaption>Source: TutorialsPoint</figcaption></figure><ul><li><strong>Root</strong>: Top node of the Tree</li><li><strong>Child</strong>: A node directly connected to another node when moving away from the root.</li><li><strong>Parent</strong>: A notion that this node has a child</li><li><strong>Sibling</strong>: A group of nodes with the same parent</li><li><strong>Descendants</strong>: A node reachable by repeated proceeding from parent to child.</li><li><strong>Ancestor</strong>: A node reachable by repeated proceeding from child to parent.</li><li><strong>Leaf</strong>: A node with no children.</li><li><strong>Degree</strong>: For a given node, its number of children. A leaf is necessarily degree zero.</li><li><strong>Edge</strong>: The connection between one node and another.</li><li><strong>Path</strong>: A sequence of nodes and edges connecting a node with a descendant.</li><li><strong>Level</strong>: The level of a node is defined as: 1 + the number of edges between the node and the root.</li></ul><h4>Types of Trees</h4><p>There are many types of trees in programming, below I will briefly discuss a few:</p><ul><li><strong>Binary Search Tree</strong>- sometimes called <strong>ordered</strong> or <strong>sorted binary trees</strong>, are a particular type of container: data structures that store “items” (such as numbers, names etc.) in memory. They allow fast lookup, addition and removal of items, and can be used to implement either dynamic sets of items, or lookup tables that allow finding an item by its <em>key</em> (e.g., finding the phone number of a person by name). The space complexity for this data structure is <em>O(n)</em>, while the time complexity for searching, insertion, deleting is <em>O(log n) </em>on average with the worst case being <em>O(n)</em></li><li><strong>Red-Black tree</strong> is a kind of self-balancing binary search tree in computer science. Each node of the binary tree has an extra bit, and that bit is often interpreted as the color (red or black) of the node. These color bits are used to ensure the tree remains approximately balanced during insertions and deletions. The space complexity for this data structure is <em>O(n)</em>, while the time complexity for searching, insertion, deleting is <em>O(log n).</em></li><li><strong>Trie</strong> also called digital tree and sometimes radix tree or prefix tree (as they can be searched by prefixes), is a kind of search tree — an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings.</li></ul><h4>Tree Traversal</h4><p>Traversing a tree is the process of moving from node to node, there are two major ways to traverse a tree : Depth-First and Breadth-First. Take the tree below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*9rwBRZjmNcR5oFvgXEljWw.png" /></figure><p><strong>Depth-First</strong>:</p><ul><li>Preorder (Root, Left, Right) = A-B-D-I-J-F-C-G-K-H</li><li>Inorder (Left, Root, Right) = I-D-J-B-F-A-G-K-C-H</li><li>Postorder (Left, Right, Root) = I-J-D-F-B-K-G-H-C-A</li></ul><p><strong>Breadth-First or Level-Order</strong>: = A-B-C-D-F-G-H-I-J-K</p><h4>Tree Operations:</h4><p>there are many operation that can be done a tree, the ones’ mention below are those done in regards to Binary Search Trees(BST)</p><p>Inserting a Node into a tree</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*Rme184FZEpXAhbrCoMwFJg.png" /></figure><p>Deleting a Node from a Tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*E45pu6-sI7Co3g6CwrAgSw.jpeg" /></figure><h4>Conclusion:</h4><p>In closing trees are a very popular and cool ADT. This blogs just scratches the surface of what a tree are and can do sometime within the near I will be either updating this blog or writing part with a more in depth look at trees</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51fbed0e4ef6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Currying in JavaScript]]></title>
            <link>https://medium.com/@jathmel/intro-to-currying-in-javascript-9b3adfa77dbb?source=rss-9afb8efe41b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b3adfa77dbb</guid>
            <category><![CDATA[currying]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Jathmel Gordon]]></dc:creator>
            <pubDate>Tue, 26 Jun 2018 18:59:31 GMT</pubDate>
            <atom:updated>2018-06-26T18:59:31.665Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9M8AEcK-PYJaoXbYZmLrg.jpeg" /><figcaption>google images</figcaption></figure><p><strong>Currying</strong> refers to the process of taking a function with n arguments and transforming it into n functions that each take a single argument. It essentially creates a chain of partially applied functions that eventually resolves with a value.</p><p>While JavaScript has functional capabilities and currying is elemental in languages such as Haskell and Scala, which are built around functional concepts. Currying isn’t built into to JavaScript by default (at least not in current versions of the language). But there are some functional tricks, we can use to make currying work for us in JavaScript, too.</p><p>We are going to look a function sum the takes 3 arguments and return the value of their sum.</p><pre>function <strong>sum</strong>(x, y, z) {<br>  return x + y + z;<br>}</pre><pre>console.log(sum3(1, 2, 3) // 6</pre><p>The curried version of sum3 behaves a little differently. For starters, it accepts <strong>only one argument</strong> and returns a function. The returned function also accepts one argument and also returns a function.This cycle keeps going until the returned function accepts the last argument. This function, the last one in the chain, finally returns the sum.</p><pre>function sum3(<strong>x</strong>) {<br>  return (<strong>y</strong>) =&gt; {<br>    return (<strong>z</strong>) =&gt; {<br>      return x + y + z;<br>    };<br>  };<br>}<br>console.log(<strong>sum3(1)(2)(3)</strong>) // 6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*R92-avOsWOpB2H46gGuvuQ.jpeg" /></figure><p>The above curried function was made possible by the exsis</p><blockquote>A closure is the combination of a function and the lexical environment within which that was declared. <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures">-MDN</a></blockquote><h3>Currying in Haskell vs JavaScript</h3><p>In most functional languages, like Haskell, all we have to do is define the function and it gets curried <em>automagically</em>.</p><pre>let <strong>sum3</strong> x y z = x + y + z</pre><pre>sum3 1 2 3<br><em>-- 6</em></pre><pre>:t sum3 <em>-- print the type of sum3()</em><br><em>-- sum3 :: Int -&gt; Int -&gt; Int -&gt; Int</em></pre><pre><strong>sum3</strong> :: Int -&gt; Int -&gt; Int -&gt; Int  -- function name<br>sum3 :: <strong>Int -&gt; Int -&gt; Int</strong> -&gt; Int  -- curried function definition<br>sum3 :: Int -&gt; Int -&gt; Int -&gt; <strong>Int</strong>  -- final return</pre><p>JavaScript</p><pre>function <strong>_sum3</strong>(x, y, z) {<br>  return x + y + z;<br>}</pre><pre>function <strong>sum3</strong>(<strong>x</strong>) {<br>  return (<strong>y</strong>) =&gt; {<br>    return (<strong>z</strong>) =&gt; {<br>      <strong>return _sum3(x, y, z);</strong><br>    };<br>  };<br>}<br>sum3(1)(2)(3)// 6  &lt;--  It works</pre><p>We can also use a wrapper function to achieve the same result. The a higher-order function that returns a series of nested accumulator functions that invoke the callback function (fn) in the end.</p><pre>function <strong>curry</strong>(<strong>fn</strong>) {<br>  return (x) =&gt; {<br>    return (y) =&gt; {<br>      return (z) =&gt; {<br>        return <strong>fn</strong>(x, y, z);<br>      };<br>    };<br>  };<br>}</pre><pre>const <strong>sum3</strong> = <strong>curry</strong>((x, y, z) =&gt; {<br>  return x + y + z;<br>});</pre><pre>sum3(1)(2)(3) // 6  &lt;--  It works!</pre><h3>Why is Currying Useful</h3><blockquote>Currying gives us the ability to compose concise and reusable functions.</blockquote><blockquote>We use these functions as clean, testable units of logic to compose the more logically complex parts of our programs.</blockquote><blockquote>With currying, any function that works on single elements can be converted into a function that works on arrays (lists), simply by wrapping it with <em>map</em>.</blockquote><h3>Conclusion</h3><p>In conclusion currying refers to the process of transforming a function with multiple arguments into the same function with one argument. It utilizes JavaScript closure to remember the arguments used in the previous invocations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b3adfa77dbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TESTING TESTING TESTING…]]></title>
            <link>https://medium.com/@jathmel/testing-testing-testing-544e6b387afc?source=rss-9afb8efe41b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/544e6b387afc</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[bdd]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Jathmel Gordon]]></dc:creator>
            <pubDate>Tue, 05 Jun 2018 18:50:38 GMT</pubDate>
            <atom:updated>2018-06-05T18:50:38.654Z</atom:updated>
            <content:encoded><![CDATA[<p>Software testing is an activity to check whether the actual results match the expected results and to ensure that the software system is defect free. Software testing is an important part of the development process, it allows engineers to produce error free Software, it also helps to identify errors, gaps or missing requirements in contrary to the actual requirements.</p><h3><strong>Test Driven Development (TDD)</strong></h3><p>A common development process is to write the application code and then later develop some test coverage on important parts of that code. <em>Test-driven development</em> reverses that process and dictates that tests, not application code, should be written first, and then application code should only be written to pass already written specs.</p><ul><li>Code written is guaranteed to be testable because you are writing the code specifically to pass a test</li><li>Developers avoid writing lots of extra functionality that is not included in the specs because they engage in the spec-writing process first (enforces YAGNI — “you ain’t gonna need it”)</li><li>Ensure you have excellent test coverage because no application code is written without already written tests</li><li>Tight development workflow (red, green, refactor) makes for happy, productive developers</li><li>Encourages a focus on modularity because the developer is forced to think about the application in small, testable chunks</li><li>Encourages a focus on a module’s/class’s public interface (i.e. on how the module will be used rather than on how it’s implemented)</li></ul><h4>Red, Green, Refactor describes the proper TDD workflow.</h4><ol><li>Red: Write the tests and watch them fail (go red). It’s important to ensure the tests initially fail so that you don’t have false positives.</li><li>Green: Write the (minimum amount of) code to make the tests pass (go green).</li><li>Refactor: Refactor the code you just wrote. Your job is not over when the tests pass; you got it working, now make it clean.</li></ol><p>Generally, TDD developers keep their Red, Green, Refactor loop pretty tight. They’ll write a few related tests, then implement the functionality, then refactor, then repeat. You keep the units small.</p><h3>Behavior Driven Development</h3><p>Behavior Driven Development (BDD) is a synthesis and refinement of practices stemming from Test Driven Development (TDD) and Acceptance Test Driven Development (ATDD).</p><blockquote>Behavior-driven development borrows the concept of the <em>ubiquitous language</em> from domain driven design. A ubiquitous language is a (semi-)formal language that is shared by all members of a software development team — both software developers and non-technical personnel. The language in question is both used and developed by all team members as a common means of discussing the domain of the software in question. In this way BDD becomes a vehicle for communication between all the different roles in a software project. (Wikipedia)</blockquote><h4>Teams already using TDD or ATDD may want to consider BDD for several reasons:</h4><ul><li>BDD offers more precise guidance on organizing the conversation between developers, testers and domain experts</li><li>tools targeting a BDD approach generally afford the automatic generation of technical and end user documentation from BDD “specifications”</li></ul><h4>RSpec test for a hashtable might look like this</h4><pre>describe Hash <strong>do</strong><br>  let(:hash) { Hash[:hello, &#39;world&#39;] }<br><br>  it { expect(Hash.new).to eq({}) }<br><br>  it &quot;hashes the correct information in a key&quot; <strong>do</strong><br>    expect(hash[:hello]).to eq(&#39;world&#39;)<br>  <strong>end</strong><br><br>  it &#39;includes key&#39; <strong>do</strong><br>    hash.keys.include?(:hello).should be true<br>  <strong>end</strong><br><strong>end</strong></pre><h4>Difference between BDD and TDD</h4><p>The difference between BDD and TDD are very subtle, What holds them together is that they all require a group of people, specifying how the software should behave, collaboratively, before implementing it.</p><blockquote><em>Behavior-Driven Development approach</em></blockquote><blockquote>it &quot;adds a reminder date when an invoice is created&quot;<br>it &quot;sends an email to the invoice&#39;s account&#39;s primary contact after the reminder date has passed&quot;<br>it &quot;marks that the user has read the email in the invoice&quot;</blockquote><blockquote>Test-Driven Development approach, and write out pending tests</blockquote><blockquote>it &quot;after_create an Invoice sets a reminder date to be creation + 20 business days&quot;<br>it &quot;Account#primary_payment_contact returns the current payment contact or the client project manager&quot;<br>it &quot;InvoiceChecker#mailer finds invoices that are overdue and sends the email&quot;</blockquote><h3>Conclusion</h3><p>Software Testing ensures that our programs are deployed error-free and we are meeting requirements. Both the TDD and BDD involves the creating test-cases first then implementing the code to pass those test-case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=544e6b387afc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Intro to Algorithms]]></title>
            <link>https://medium.com/@jathmel/an-intro-to-algorithms-68bd0e9b6f07?source=rss-9afb8efe41b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/68bd0e9b6f07</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Jathmel Gordon]]></dc:creator>
            <pubDate>Tue, 29 May 2018 18:34:51 GMT</pubDate>
            <atom:updated>2018-05-29T18:49:40.879Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Algorithms? What are they really? How are they important?</blockquote><p>Algorithm is this cool and mysterious word that is usually thrown around by programmers and mathematicians.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*QNKJ04VG0PUTh2pWI36YPg.png" /></figure><p>“<em>In mathematics and computer science, an algorithm is an unambiguous specification of how to solve a class of problems. Algorithms can perform calculation, data processing and automated reasoning tasks.</em>”</p><p>A simpler definition is: “<em>An algorithm is a set of guidelines that describe how to perform a task</em>.”</p><p>Here are some different types of algorithms:</p><ul><li>a search algorithm</li><li>facebook algorithm</li><li>how to make a grilled cheese sandwich</li><li>how to make a friend</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*esfpyQ5GqWIq9y93Q6V58A.png" /></figure><h3>Expressing Algorithms</h3><p>Algorithms can be expressed in many kinds of notation, including natural languages, pseudocode, flowcharts or programming languages. Natural language expressions of algorithms tend to be verbose and ambiguous, and are rarely used for complex or technical algorithms.</p><p>Pseudocode, flowcharts are structured ways to express algorithms that avoid many of the ambiguities common in natural language statements. Programming languages are primarily intended for expressing algorithms in a form that can be executed by a computer, but are often used as a way to define or document algorithms.</p><pre><strong>Algorithm</strong> LargestNumber</pre><pre>  Input: A list of numbers <em>L</em>.<br>  Output: The largest number in the list <em>L</em>.</pre><pre>  <strong>if</strong> <em>L.size</em> = 0 <strong>return</strong> null<br>   <em>largest</em> ← <em>L</em>[0]<br>   <strong>for each</strong> <em>item</em> <strong>in</strong> <em>L</em>, <strong>do</strong><br>    <strong>if</strong> <em>item</em> &gt; <em>largest</em>, <strong>then</strong><br>      <em>largest</em> ← <em>item</em><br>  <strong>return</strong> <em>largest</em></pre><h3>Importance of Algorithm</h3><p>Imagine you are traveling to a new place — you don’t have GPS, you don’t even have a map. It would be extremely difficult to find this new place without any guide, like how difficult it is for Sheldon to make new friends (it’s really hard for him.) This is the reason algorithms are important, because they give us a guide line to follow when solving or navigating a problem. They help us to optimize the way we solve a problem by making the process more efficient. People revise algorithms all the time to create more efficient ones. For example, GPS routes need to be constantly updated to provide the most efficient paths.</p><p>As programmers algorithms are very important to us. As it offer ways to make our programs more efficient, but for programmers just starting out algorithms are very as many interview will have an algorithm portion, so having an understanding of how algorithms work and which would best solve the problem.</p><h3><strong>tl;dr</strong></h3><p>Algorithm is word meaning just a bunch of steps to solved a particular problem, mainly used by people in tech, but they exist in everything around us</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68bd0e9b6f07" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>