<?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 Ryan McCarty on Medium]]></title>
        <description><![CDATA[Stories by Ryan McCarty on Medium]]></description>
        <link>https://medium.com/@ryanmccarty_1138?source=rss-b07452279a64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rEcaD96Nt8Bn76G6</url>
            <title>Stories by Ryan McCarty on Medium</title>
            <link>https://medium.com/@ryanmccarty_1138?source=rss-b07452279a64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:04:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryanmccarty_1138/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[Augmenting reality with Expo AR]]></title>
            <link>https://medium.com/@ryanmccarty_1138/augmenting-reality-with-expo-ar-1fd9f50d8c13?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fd9f50d8c13</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Mon, 25 Mar 2019 14:32:47 GMT</pubDate>
            <atom:updated>2019-03-25T14:32:47.941Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the more recent additions to Expo’s large and ever growing toolkit of of components and APIs for React Native is <a href="https://docs.expo.io/versions/latest/sdk/AR/">support for augmented reality</a>. The expo AR API, which comes pre loaded in Expo “managed” projects (versus “bare” React Native projects) currently only offers support for ARKit and thus is only useful for developing iOS AR applications at the moment. Its (relative) ease of use and deep customizability make it one of the better tools for doing so right now. Getting started can be as simple as adding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*D5vhfMzWRuXHvf7IjzMabg.png" /></figure><p>to your code. However, this won’t actually get you very far. While Expo’s AR component does offer some very powerful methods on its own, such as facial recognition and 3D hit testing, its real power comes from its integration with <a href="https://threejs.org/">three.js</a> as <a href="https://github.com/expo/expo-three">expo-three</a>. Thus a more realistic import statement looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*oAa_OEZyD7AJBX5HAIUjhQ.png" /></figure><p>three.js is a powerful and expansive 3D rendering library that allows us to make our AR scenes dynamic and immersive by adding interactive graphical elements and the ability to manipulate to the geometry and perspective of the scenes rendered through the user’s camera. This is where the augmenting of reality truly begins as we can add custom 3D object files, 2D sprites, or custom geometry to our scenes and specify their positions, animations, and interactions with the user via three.js.</p><p>We can, for example, upload a transparent .png of an X, tell our code to render at a certain position if and only if certain conditions, such as the user’s device location, fall within a certain range, and make that X element interactive, animating and disappearing when tapped on turning an otherwise normal scene into something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwR5UjcGq0vduEOuaevO_w.png" /><figcaption>we can also give Austin magic fingers</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd9f50d8c13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New features in ES10]]></title>
            <link>https://medium.com/@ryanmccarty_1138/new-features-in-es10-275472c5b03f?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/275472c5b03f</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 14:17:15 GMT</pubDate>
            <atom:updated>2019-03-11T14:19:33.959Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript as we know it is an excitingly dynamic and changing language. Each year, <a href="https://github.com/tc39">TC39</a> publishes a document of the latest definitions and rules that define ECMAScript, the standard from which JavasScript as we know it is derived. While many are familiar with 2015’s ES6, largely due to the sheer number and scope of changes it introduced, there have been and continue to be smaller rollouts each year that keep the language fresh and consistent. In a <a href="https://tc39.github.io/ecma262/">draft published March 1st</a>, we received a look at some of the features we can expect to see in ES10 when it’s officially published later (probably during the summer) in 2019 such as…</p><h3>Array.prototype.{flat, flatMap}</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*qP8YKSw7sC-2zaaOsDyerQ.png" /><figcaption>fig a</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*uCELvYhlO3GBssEOy0HSEA.png" /><figcaption>fig b</figcaption></figure><p>Two new methods on the Array prototype, flat flattens nested arrays of any depth and flatMap does so with the added option of mapping a function over their elements in the process. As seen in fig a, flat takes an optional depth parameter which defaults to 1. For an array with a depth of two, calling it without any arguments will thus return an array of the elements contained in the first two levels and the the second nested array itself. Passing in Infinity will flatten an array of any depth. A use case of flatMap illustrated in fig b is the process of using a mapping function that itself returns arrays. When calling split on several different elements we will still end up with one flattened array.</p><h3>Object.fromEntries</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*ATSCXlZcI9AWpK2Lj_tJLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*HTzSAjIed6QtiyNVmJpffQ.png" /></figure><p>The Object.entries method, as seen in the first example, returns an array of subarrays each containing the enumerable key value pairs of the object passed to it as an argument. Object.fromEntries uses such an array and returns a new object built with the same properties. This is of course a brand new object, as we can see in the comparison between the new object made “fromEntries” and the original object those entries came from.</p><h3>String.prototype.{trimStart, trimEnd}</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*4GK34eEd699CcxkMW6icCQ.png" /></figure><p>Already implemented in some environments as trimLeft and trimRight, these two new additions simply remove whitespace from the beginning and end of strings, respectively.</p><h3>Function.prototype.toString</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*zDT0sFAB9dvUhKD0ZMFf6g.png" /></figure><p>An update to an existing method, Function.toString will now retain certain formatting that was previously removed from the function it was called upon. The example above shows the current implementation wherein comments and whitespace are trimmed and the function definition slightly altered. The new and improved toString will return the function as it is written, including comments.</p><h3>Symbol.prototype.description</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*k-CBOpHfZ-An0Sm1Iz6Hew.png" /></figure><p>Currently the easiest way to access information about a created Symbol is to call Symbol.toString which in the case of the above example would return “Symbol(‘Navi’).” Symbol.description in this way is a very straightforward quality of life improvement which will return the description the symbol was created with and nothing else.</p><h3>Array.prototype.sort</h3><p>Finally, an improvement to the existing sort method on the Array prototype. Sort will now be implemented as a stable sort. This means that if you were to sort an array that contained some series of adjacent elements with the same values they would not move from their starting position in the returned, sorted array. Contrast this with the quick sort method used in the current implementation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=275472c5b03f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Search & Deploy]]></title>
            <link>https://medium.com/@ryanmccarty_1138/search-deploy-1d0ed56d8757?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d0ed56d8757</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Fri, 08 Mar 2019 07:17:47 GMT</pubDate>
            <atom:updated>2019-03-08T07:17:47.992Z</atom:updated>
            <content:encoded><![CDATA[<p>The logical endpoint of building an exciting new application is sharing it with the world. To this end, there are a number of infrastructure management services readily available that make deploying and hosting your code a breeze such as Heroku and DigitalOcean. What these services offer in ease of use however, they lack in terms of deep customization and auxiliary services, particularly in comparison to the offerings of tech giants like Google Cloud, Microsoft Azure, and Amazon Web Services.</p><p>As I recently learned in the process of deploying my first app with AWS the breadth of these offerings and their relevant documentation can be somewhat overwhelming and difficult to navigate. For the scope of our project the deployment needs were very basic: a remote MySQL database instance and a remote server to connect to via SSH from which to host and run our application. Simple enough, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*e--uVKm2XKSwWSIuxFQyVQ.png" /><figcaption>AWS’s relational database options</figcaption></figure><p>AWS’s RDS service satisfied the first of those two needs handily. By restricting the available options to fall within AWS’s free tier the actual configuration needed to start up an instance running our 20GiB SSD was minimal. The most pertinent user input in the process seemed to be the DB engine version (MySQL 5.7.24 in our case) and the username and password used to login to the DB. Other options, such as the selection of a security group, the Virtual Private Cloud environment for the instance, and the port through which to access the DB, were created with or set to default values. Setting up our remote serve would be a slightly more convoluted endeavor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dM2HOZgNSjkZyvj9y5QmFg.png" /><figcaption>a (very small) selection of Amazon’s Web Services</figcaption></figure><p>Initially, services like the well advertised Elastic Beanstalk and descriptively named CodeDeploy seemed to be the way to go, but ultimately offered far more than we needed for the scale of our app. Thus we arrived at the process of creating a simple EC2 instance; a straightforward, no frills process that isn’t concerned with scalability or creating an interdependent network of AWS services. As with the RDS instance, a walkthrough guide aids in setting up the instance, however there are some more important decisions to be made in creating the EC2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*yRJuh_5YlYvxwwDtXYLWdQ.png" /></figure><p>First the AMI. Amazon offers a number of OSs to choose from, after an initial trial run with an Amazon Linux server we ended up scrapping it for Ubuntu. Next, the instance type. These range from powerhouse instances optimized variously for graphics, memory, and computing down to the general purpose “micro” instance perfect for hosting our app. The next step, configure instance, was left mostly as default in our case, though offers options for integrating with VPCs and Elastic Beanstalk. After that, set up some security group rules allowing us to SSH into the server and for general access via HTTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLfLGwy2gU7rlMztQnKdpA.png" /></figure><p>And finally, launch the instance! After following a prompt to generate a pair of SSH keys and waiting a few minutes for the instance to come online one can use these newly created keys to connect straight to the instance, pull down their code, and serve it up to the world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d0ed56d8757" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Loopity Scoop]]></title>
            <link>https://medium.com/@ryanmccarty_1138/the-loopity-scoop-f5ebad5b811?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ebad5b811</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Mon, 11 Feb 2019 14:10:31 GMT</pubDate>
            <atom:updated>2019-02-11T14:10:31.115Z</atom:updated>
            <content:encoded><![CDATA[<p>Javascript’s single-threaded nature seems to present a fundamental and obvious problem for its ability to run efficiently. That is, if only one thing is ever happening at a time what happens when we encounter a process, say an http request, that takes a long time to execute? If, as it seems, the single-threaded system were to perform this request synchronously everything would come to a halt and any further code execution would cease until a response from the request came back. This would be terrible. And from using any application or website built with Javascript we know this is not the case, so what exactly is going on?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dtWlvKLDIVZLxg7WKyTxQQ.png" /></figure><p>Consider this representation of Javascript’s runtime environment. Functions are added to and removed from the call stack as they are executed; they are only ever executed one at a time. Any events or asynchronous behavior triggered in a function are set aside with a callback function so that their processes can take place elsewhere without gumming up or “blocking” the call stack. Once those events transpire the callback is added to a queue to await its turn in the stack which will come as soon as the event loop sees that the stack is empty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1QGdVt1VpuxlAuAE" /></figure><p>Node.js’s interaction with the C library libuv further illustrates this relationship between the single-threaded, synchronous execution of function in the callstack and the async execution of tasks elsewhere. As we can see on the right side of the illustration above, libuv generates a thread each time a process is passed to it. These blocking processes can run concurrently and then make their way to the queue and eventually the stack as they complete.</p><p>The event loop is the core that keeps our single-threaded program running synchronously and smoothly while it performs asynchronous actions or sets certain behaviors to be triggered by events. It does not matter if an async request returns very quickly or takes a long time or if many events are triggered rapidly back to back: their callbacks are added to the queue in the order they transpired and executed one by one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ebad5b811" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Declaration of Dependence: invert & inject]]></title>
            <link>https://medium.com/@ryanmccarty_1138/declaration-of-dependence-invert-inject-ddd0d014fa79?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd0d014fa79</guid>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Tue, 05 Feb 2019 07:55:24 GMT</pubDate>
            <atom:updated>2019-02-05T07:55:24.756Z</atom:updated>
            <content:encoded><![CDATA[<p>Two oft recurring themes in the principles of good programming are simplicity and modularity. Do not repeat yourself, separate your concerns, encapsulate, isolate, and use loose coupling. These guiding concepts are beneficial in some obvious, similar ways. For example, it makes perfect sense not to rewrite code you’ve already written or to make sure your functions aren’t brought down by the failure of a single component. But is there a point during all of this division of labor at which we cross the line back into complexity? Could we not just implement behaviors on the components that need them? Or kill two birds with one stone and implement several of them in the same place? If you find yourself musing about and following through on this entangling ideation, you need to check your dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDyEmmCGX0TSywfmpQj3uw.png" /><figcaption>Check them before they wreck you</figcaption></figure><p>Dependencies are exactly what they sound like: parts of your code that other parts of your code are dependent on. Dependencies can, quite literally, make or break your code and it us thus important to understand the relationship between your components and any dependencies they may have. So important, in fact, that of the five design principles laid out in Robert Martin’s SOLID acronym an entire one of them (the ‘D’) is dedicated to the specific concept of dependency inversion. This principle states that high <em>and</em> low level modules should both “depend on abstractions” instead of concretions. Flipping the basic hierarchical relationship between classes and modules is not only useful but easy to do with dependency injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*B-qT8e1pfEwP8HT_lzMzIQ.png" /></figure><p>Dependency injection is the process by which a dependency or <em>service </em>is passed directly to a dependent object or <em>client </em>rather than have the client search for or build the dependency on its own. The specifics are abstracted away entirely by the service and thus any future modifications, additions, or tweaks can be implemented without having to alter the client code. Furthermore the service can be supplied directly to any client object that may need to make use of it. This kind of modular dependency allows for more stable and flexible components than those that are entangled, reliant upon one another, or maintain a strict hierarchical relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Db8CQ_tqkpkUu0iUCT2sgQ.png" /></figure><p>This separation of dependencies does necessarily imply the creation of more and smaller modules which may result in some disorganization and excess complexity if they are not well managed or many in number. Ultimately, though, the concept comes back around to keeping things simple and is itself a pretty simple concept to enforce. Whether using framework specific methods, like Angular’s injectable services, importing and exporting modules with Node’s require(), or an even simpler implementation separating and managing your dependencies will make your code much more flexible and maintainable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd0d014fa79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trimming the Trees: bringing order and balance with B-trees]]></title>
            <link>https://medium.com/@ryanmccarty_1138/trimming-the-trees-bringing-order-and-balance-with-b-trees-e707e02e6acb?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/e707e02e6acb</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 08:06:29 GMT</pubDate>
            <atom:updated>2019-01-28T08:06:29.982Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the more arcane and fascinating data structures out there is the B-tree. Distinct from but similar to its sibling, the binary search tree, the B-tree structure boasts logarithmic time complexities across the board and is great for storing large blocks of data. What exactly is it then? From the name we can tell that it’s a tree and that it likely has some special properties as denoted by the “B.” We’ll come back to the “B” but first let’s talk about trees.</p><p>Basic, unordered trees are a fairly simple and straightforward data structure. They begin with a parent node, which may contain any number of child nodes, which are themselves trees which may contain any number of children and so on. Beyond this hierarchical pattern though, there is no established relationship between parent and child nodes and thus no way to access and verify data without traversal of the entire tree which is, at least, inconvenient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/0*4qk8S7oL6E4pqgDK.png" /></figure><p>The binary search tree improves upon the tree by laying down some rules for how many children each node can have and where exactly each child node will be placed in relation to its parent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*7iGMfNYoYtzIo3Fy.jpg" /></figure><p>The B-tree takes this a step further and lays down many of its own rules for how data should organized. The most important and defining rules being: nodes can contain a variable amount of data, nodes can have a variable number of children, and all leaves (final children of the tree) must be on the same level. These properties make B-trees structurally flexible and make balance a necessary and defining feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/0*UiJbQVwm1QBkRHvE.png" /><figcaption>Inserting 1–7 into a B-tree structure</figcaption></figure><p>In the above example each internal node of the tree is necessarily either a “2-node” with one data value and two children or a “3-node” with two data values and three children. In order to maintain its structure and the sequential relationship between the data of nodes some nodes will end up having empty spaces to balance things out. In this way the B-tree does trade off space complexity for time complexity and may not be ideal for storing large amounts of data that is separated into many small blocks.</p><p>Back to the “B” then. Ed McRreight, one of the two men who came up with the B-tree, has said “the more you think about what the B in B-trees means, the better you understand B-trees.” So what is it referring to? Is it the <strong>b</strong>alance the tree must maintain while relationship between its nodes consistent? Is it the <strong>b</strong>road shape it must take on in order to keep all of its leaves on the same level? Is it the specific <strong>b</strong>ound placed on the variable number of values and children a node can have? Or a node’s specified <strong>b</strong>ranching factor?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/0*paX0cwKN4Aok_OE2.jpg" /><figcaption><strong>B</strong>ea Arthur?</figcaption></figure><p>It’s all of these things and none of them at the same time. Truly, the “B” doesn’t actually stand for anything in particular. There are many qualities of the B-tree to which it can be applied though because, well, there are many qualities of the B-tree. It is a unique and somewhat complicated data structure but one worth taking the time to get to know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e707e02e6acb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Instances cluttering your code with methods? Spark joy with prototype chains.]]></title>
            <link>https://medium.com/@ryanmccarty_1138/instances-cluttering-your-code-with-methods-spark-joy-with-prototype-chains-f51e4378c1e7?source=rss-b07452279a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/f51e4378c1e7</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ryan McCarty]]></dc:creator>
            <pubDate>Mon, 21 Jan 2019 06:46:15 GMT</pubDate>
            <atom:updated>2019-01-21T06:46:15.212Z</atom:updated>
            <content:encoded><![CDATA[<p>A guiding principal of writing good code (and programming generally) is to “keep it DRY.” That is, <strong>D</strong>o <em>not</em> <strong>R</strong>epeat <strong>Y</strong>ourself. Using constructors to create instances that share common properties and methods is a prime example of this principal in action. Rather than creating many similar objects individually and assigning them the same methods again and again we can create a constructor that takes all of these shared properties and assigns them to each new instance it creates.</p><p>However, by recreating and storing all of these methods on each new object instantiated aren’t we just repeating ourselves in a slightly tidier fashion? Wouldn’t it be nice if we could just create all of these methods once, store them in one place, and have instances call upon them when needed? With the prototypal instantiation pattern we can! Unlike functional patterns which create new objects, append methods to them, and return those new object, prototypal instantiation takes advantage of the <strong>Object.create()</strong> method to create new objects that reference another object’s prototype property.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*075X4-7P7f8imeSdGwtENg.png" /></figure><p>In the example above any cat objects created by the Cat constructor will have direct access to the methods stored in Cat.prototype. If we assign some methods to Cat.protoype…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*XX8EEcCjyZTlNUBjecxhAg.png" /></figure><p>…and construct a new instance of Cat…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*kzQcci9_hfxkxal0tVwBzw.png" /></figure><p>…what will we expect to happen when we call navi.eat() or navi.sleep()?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*_XRZnWEt20XQ2dirrI3QIA.png" /><figcaption>we will get a happy kitty.</figcaption></figure><p>The functions will be invoked successfully! Note that this is not because navi directly possesses the eat and sleep methods or a prototype property of her own. Rather, as is the case with all objects, navi was created with a __proto__ property that references the prototype of her constructor and allows the process of method calls following the prototype chain to take place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*ag5q-hI3ruAg6mUVzbbDkw.png" /></figure><p>When a call is made to a method not found stored on an object __proto__ is consulted, if no method is found on the referenced object its __proto__ is consulted and so on. This functionality allows us to greatly simplify and tidy up our code. In the event that we had many cat objects and we needed to add a new behavior or modify an existing one we could simply make alterations to the Cat.prototype from which they would all inherit.</p><p>ES6 and the pseudoclassical pattern further streamline the prototypal instantiation pattern with the “new” and “class” keywords eliminating, among other things, the need for the explicit call to Object.create(). Whichever pattern you prefer, keep in mind the advantages of prototype chains. The prototypal pattern greatly improves upon the basic functional instantiation patterns by making our code less repetitive and our instances more accessible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f51e4378c1e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>