<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bradley Black</title>
    <description>The latest articles on DEV Community by Bradley Black (@bradleyblacksound).</description>
    <link>https://dev.to/bradleyblacksound</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F563376%2Fad1cc196-aa61-47b2-95f7-6628aca905a1.JPG</url>
      <title>DEV Community: Bradley Black</title>
      <link>https://dev.to/bradleyblacksound</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bradleyblacksound"/>
    <language>en</language>
    <item>
      <title>GitHub Actions: Rise of the Machines (Automating CI, Workflow, and More on Your Favorite Open Source Platform)</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Fri, 21 May 2021 22:22:19 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/github-actions-rise-of-the-machines-automating-ci-workflow-and-more-on-your-favorite-open-source-platform-1e9j</link>
      <guid>https://dev.to/bradleyblacksound/github-actions-rise-of-the-machines-automating-ci-workflow-and-more-on-your-favorite-open-source-platform-1e9j</guid>
      <description>&lt;p&gt;There’s good reason for Github’s ubiquity in the world of development. Its open source structure reflects what’s best about the web: free, accessible, and communal. It’s a habitat for tech giants like Facebook and rogue bands of hackers alike. Curious developers can dive deep into source code, point out bugs and suggestions, and fork public repositories to version things as they see fit. Of course, the way Github sits within the larger world of app development and publication is fairly patterned. Projects born on Github eventually move into a production environment or are published to a platform like NPM. To simplify this process, there’s Github Actions.&lt;/p&gt;

&lt;p&gt;Github Actions is a range of automation services for increasing the functional breadth of your codebase. Developers can identify a specific workflow that is repetitive or time consuming and design a way to automate the process. Think of a Github Action as an event listener for a repo. If a specific action is taken, then the specified reaction occurs.&lt;/p&gt;

&lt;p&gt;These actions and reactions are laid out in a YAML file, but first the user must specify a new workflow. This process begins under the Actions tab on a repo’s main page. Here a list of popular template workflows are available. Developers can also simply build a workflow from scratch. Whether a custom workflow is selected or a template, Github will launch a new YAML file nested in a .github/ folder in the main project directory. A YAML file takes on the following format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: learn-github-actions
on: [push]
jobs:
  runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
      - run: npm install -g bats
      - run: bats -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some of the basic commands/features of a Github Actions YAML are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name: an optional attribute for IDing the action&lt;/li&gt;
&lt;li&gt;On: this is the action you’re listening for. It can be a merge, a feature request, bug report, or any interaction that takes place with a repo or within an organization&lt;/li&gt;
&lt;li&gt;Jobs: the list of commands to execute when an On event is triggered. &lt;/li&gt;
&lt;li&gt;Runs-On: establishes the type of virtual machine Github will use to execute the following commands. &lt;/li&gt;
&lt;li&gt;Steps: this is a sequence of actions to work through sequentially&lt;/li&gt;
&lt;li&gt;Run: an executable command for the virtual machine terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most common usage of Github Actions is continuous integration, but there are several other popular uses. In addition to publishing libraries to NPM or Github Packages, Github offers template Actions for deployment. To achieve complex tasks, Github publishes a number of popular workflows developers can use. Think of these as dependencies for a specific action. The checkout action, for example, does exactly what it says. It pulls a specified repository or branch into the virtual machine for the steps that follow.&lt;/p&gt;

&lt;p&gt;This open source approach to some of the more tedious aspects of app development can really simplify the software development and deployment process. Github Actions is capable of deploying on all major platforms, and, because of the use of virtual machines, can be utilized for practically any language or configuration necessary. If a project already lives on Github, configuring automations with Actions couldn’t be easier.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Command Line Deployment with Terraform
</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 10 May 2021 18:22:07 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/command-line-deployment-with-terraform-17le</link>
      <guid>https://dev.to/bradleyblacksound/command-line-deployment-with-terraform-17le</guid>
      <description>&lt;p&gt;Terraform is an infrastructure as code (IaC) service that greatly reduces the complexity faced by developers during deployment. Developers want great agility when choosing platforms. Typically with deployment, a platform will play nicely with other in-house tech, and less so with the services of competitors. Of course, great software shouldn’t be guided by what a platform's maker deems convenient or inconvenient.&lt;/p&gt;

&lt;p&gt;What’s the solution? First, it would be beneficial to use a service that minimizes interactions with these platforms, and gives developers direct access to the resources themselves (an AWS EC2, for example). The service should also minimize discrepancies in how developers interact with each company's products. Many of the differences platform to platform amount to proprietary flare. Product A and B will have different terminology and UI, but ultimately the tools offered are quite similar. Whether it be Azure, AWS, or GCP, there should be no need to become too deeply rooted in one offering or another. By bringing deployment away from these platforms and to the command line, Terraform allows developers to focus their energy where it ought to be: devising the best possible deployment strategy for their application.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Declarative Approach to Infrastructure
&lt;/h2&gt;

&lt;p&gt;The declarative nature of Terraform takes shape in the Terraform config file. Here, programmers simply list out the technologies and configurations they require.&lt;/p&gt;

&lt;p&gt;You’ll notice there are no execution commands, simply a declaration of what to use. Terraform reduces complexity by internally formulating a plan that will bring a developer’s request to fruition. There’s no need to define step by step instructions. This is beneficial when first sketching out the framework of a project. It’s also beneficial when creating copies of frameworks for development, staging, and production.&lt;/p&gt;

&lt;p&gt;Most importantly, It simplifies the process of modifying a framework. This is revealed in how Terraform is designed. The Terraform core accepts two arguments: the project state and the config file. If there are differences between the two, Terraform will devise a strategy to bring them into harmony. This means developers don’t need to spend time on breaking down existing infrastructure to improve configuration. It also means less code, as new strategies will simply take the place of old strategies in the config file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interacting with the Terraform Core
&lt;/h2&gt;

&lt;p&gt;The 5 basic commands for Terraform are as follows:&lt;br&gt;
Init: initialize a directory as a Terraform project&lt;br&gt;
Validate- check the contents of the config file for validity, and clarify any changes that need to be made&lt;br&gt;
Plan - print the step-by-step strategy Terraform can execute to bridge the gap between the desired configuration and current program state&lt;br&gt;
Apply- this is the command to execute the plan devised by the previous command.&lt;br&gt;
Destroy- shut down an infrastructure in the proper order&lt;/p&gt;

&lt;p&gt;To see these commands in action, first create a project directory and create a main.tf file to serve as your config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "aws" {
    region = "us-east-1"
}

resource "aws_instance" "ec2main" {
    ami = "ami-example"
    instance_type = "t2.micro"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, this declarative syntax simply lists the provider of a resource (AWS, in this case), and the resource needed (an ec2 instance). By running &lt;code&gt;$terraform init&lt;/code&gt;, a terraform lock file will be created, and any dependencies will be downloaded. Now, running &lt;code&gt;$terraform validate&lt;/code&gt; will check the contents of the config file to determine if it can be executed. If there are no issues, run &lt;code&gt;$terraform plan&lt;/code&gt; to see the outcome of executing the config file. Finally, &lt;code&gt;$terraform apply&lt;/code&gt; will put the Terraform core into action. It will communicate directly with the provider (AWS) to get the resource requested, and, if successful, bring the status of your project into state.&lt;/p&gt;

&lt;p&gt;Often with deployment, the proprietary quirks of each platform can make for some unwanted concessions. Either use a platform with which you’re already familiar, or spend time learning to navigate an unfamiliar interface. Terraform sees these platforms as what they are: providers and resources. With infrastructure as code services like Terraform, testing different strategies, trying new technologies, and tuning a deployment approach is a much smoother process.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Improving Accessibility with Voice Control and Voice Access</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 10 May 2021 02:35:21 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/improving-accessibility-with-voice-control-and-voice-access-2h36</link>
      <guid>https://dev.to/bradleyblacksound/improving-accessibility-with-voice-control-and-voice-access-2h36</guid>
      <description>&lt;p&gt;The shift towards phones and tablets, and away from desktops and laptops, greatly informs web design in 2021. The web must accommodate visitors on a wide variety of devices. This has led to uncluttered design, larger buttons and text, and a clearer navigation system. There’s also the requirement that websites be navigable with a variety of input sources: mouse, keyboard, touch, voice, etc. While these developments are for the benefit of all users, they’re especially accommodating for users with disabilities.&lt;/p&gt;

&lt;p&gt;The World Wide Web consortium (W3C) issues a set of recommendations for design known as the Web Content Accessibility Guidelines (WCAG). Last updated in 2018, the previous update occurred in 2008. That was around the invention of the smartphone. It’s always true that technology changes so rapidly that regulations and standardizing or practice don’t follow until much later. So while the recent WCAG offers a good framework for designing for disability, they don’t mention some of the more powerful tools available that accommodate users with disabilities It is still important to consider these four key features of accessible design:&lt;br&gt;
Perceivable (example: alternate text for non-text content)&lt;br&gt;
Operable (example: complete keyboard accessibility)&lt;br&gt;
Understandable (feedback from DOM, clarifying suggestions)&lt;br&gt;
Robust (usable on a wide range of devices)&lt;/p&gt;

&lt;p&gt;15% of people have a disability that may affect their ability to use the web. Included in this 15% are users with motor function impairment. For users who cannot operate a mouse, keyboard, or touchscreen, voice navigation has emerged as a powerful tool. &lt;/p&gt;

&lt;p&gt;Apple’s Voice Control (for iOS and OS) and Google’s Voice Access (for Android) offer a nearly identical palette of tools for users. The goal is to break down the DOM for fast, fluid interaction by voice. This can be done by listing operable aspects of a page by name, by assigning a number, or by locating them on a grid.&lt;/p&gt;

&lt;p&gt;After turning on Voice Control or Voice Access, a user can reveal names of buttons, text fields, and interactive elements by saying “show names” (VC) or “show labels” (VA):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t9W2Tyst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkjusmfcgwt27wkbsopp.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t9W2Tyst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkjusmfcgwt27wkbsopp.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;support.apple.com&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To navigate, the user simply then has to speak the name/label of the feature. Similarly, “show numbers” on both platforms will assign a number command to each page element:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lOMRNyed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1i0crif5afqkn4rzsff.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lOMRNyed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1i0crif5afqkn4rzsff.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;support.apple.com&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For certain applications, and for websites/apps that won’t compile names/numbers correctly, the “show grid” command is helpful:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---QdqeUCW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nub1u5bze1h1ocdnhm51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---QdqeUCW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nub1u5bze1h1ocdnhm51.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;support.apple.com&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If a clickable element exists on one of the grids, the command “double click 15”, for example, would be a way to progress through a site. &lt;/p&gt;

&lt;p&gt;When developing for iOS, programmers are required to acknowledge the necessities of accessible design. It makes sense that Apple, with a great deal of lateral power due to its grip on mobile development, can then push accessible development further than an organization like the W3C. Regardless of the platform, all developers should consider the accessibility of their applications and strive to make the web as welcoming as possible.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Supercollider: Putting a Synth on a Server</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Tue, 27 Apr 2021 05:54:16 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/supercollider-putting-a-synth-on-a-server-264b</link>
      <guid>https://dev.to/bradleyblacksound/supercollider-putting-a-synth-on-a-server-264b</guid>
      <description>&lt;h1&gt;
  
  
  supercollider
&lt;/h1&gt;

&lt;p&gt;Just as it is a powerful tool for communication and collaboration in all mediums, the web can be a framework for creating music. This is largely due to server architecture. Musicians have long relied on a single source of truth when composing and collaborating. Often this is simply the physical space they share, but servers and the web allow players to bridge distances and work collectively in a similar fashion.&lt;/p&gt;

&lt;p&gt;Supercollider is a language and platform for music creation that builds on a client-server relationship. For Supercollider, any user, or input source, takes on the roll of the client. The server is the synth engine itself. This structure has several key benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clients can take on any number of forms (humans, algorithms, other)&lt;/li&gt;
&lt;li&gt;Clients can be of any number&lt;/li&gt;
&lt;li&gt;Multiple clients can simultaneously engage with a single server&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  osc
&lt;/h1&gt;

&lt;p&gt;Supercollider uses OSC to transmit data between client and server. As a result, any client capable of producing OSC messages can join in. OSC is somewhat of a successor to MIDI. The benefit of OSC is that its 32-bit format offers much richer, detailed, performance data over Midi, which is only 8-bit. In modern music practice, one is often transpiled to the other. While MIDI still holds a place in the field, and physical MIDi ports continue to be implemented in music equipment, OSC has proven to be an incredibly versatile language that musicians without a great deal of programming knowledge can use.&lt;/p&gt;

&lt;h1&gt;
  
  
  sclang
&lt;/h1&gt;

&lt;p&gt;One large aspect of the Supercollider experience is the coding environment. The client runs on a native language called sclang. C and C++ programmers, and even Javascript programmers like myself, will find the code simple to understand and implement. It is object-oriented in nature, and uses a library of built-in classes for the majority of its functionality.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(
play(
    {
        var f;
        f = MouseY.kr(4000, 200, 'exponential', 0.8);
        SinOsc.ar(
            freq: f+ (f*SinOsc.ar(7,0,0.02)),
            mul: MouseX.kr(0, 0.9)
        )
    }
)
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you can see the MouseY, SinOsc, and MouseX classes being invoked. They all have access to ar and kr methods, which are audio rate and control rate, respectively. The variable f is invoked to store whatever Y value is currently held by a mouse or trackpad. It is then combined with an LFO for musicality, combined with the X value of the mouse for amplitude, and these signals are combined to generate a specific pitch by a sine wave oscillator.&lt;/p&gt;

&lt;h1&gt;
  
  
  scsynth
&lt;/h1&gt;

&lt;p&gt;Interaction with a Supercollider server is done with the command line using native scsynth language. These commands are used to dictate the behavior of audio busses, nodes, and synths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scscynth -u 57117 &amp;gt;synth_log &amp;amp; scsynth -N score.osc _ out.aiff 48000 AIFF int24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This chain instructs a synth what port to use (57117), where to log output info, what file to read for osc instructions, and what sample rate and bitrate to use. &lt;/p&gt;

&lt;h1&gt;
  
  
  quarks
&lt;/h1&gt;

&lt;p&gt;Javascript uses the npm package manager to empower coders to build and download tools and libraries for their projects. Similarly, Supercollider users quarks. Quarks are hosted on github, and can be implemented with the Quarks class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Quarks.gui //launches an interface for the entire quarks library
Quarks.install(/*quark name here*/)
    Quarks.uninstall(/*quark you no longer need*/)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  summary
&lt;/h1&gt;

&lt;p&gt;The open-source and server-based approach to music making is what appeals most to be about Supercollider. Although it’s more exclusive to programmers than languages like Max/MSP or Pure Data, the ability to build instruments, controllers, and networks from the ground up opens up an endless number of paths for creative pursuits.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Swift and the Evolution of Modern Programming Languages
</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Tue, 20 Apr 2021 02:40:57 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/swift-and-the-evolution-of-modern-programming-languages-1oe4</link>
      <guid>https://dev.to/bradleyblacksound/swift-and-the-evolution-of-modern-programming-languages-1oe4</guid>
      <description>&lt;p&gt;In the modern tech world, there’s significant overlap among the key players. Google and Apple, for example, develop augmented reality technologies side-by-side. In fact, they share an AR API of the same name. However, instead of consolidating around this shared interest, a competition emerges. This approach can absolutely lead to great tech, but it creates a conundrum for developers. Big tech firms tend to frame their breakthroughs within their product ecosystem, and devote fewer resources to cross-platform support. As a result, developers who want the agility to work across all tech platforms often find themselves in a bind. One step towards Google, or Microsoft, is a step taken away From Apple, or vice versa.&lt;/p&gt;

&lt;p&gt;Meanwhile, an interesting thing tends to happen to incumbent technology. Its creators become tasked with its maintenance and upkeep, and can focus less on innovation. Meanwhile, competing companies looking for a greater foothold have to push exciting ideas into the marketplace to compete. Inevitably, this dynamic swings interest away from the incumbent and they are forced to reconcile their out-moded approach with new demands. One example of this is Apple’s Swift programming language.&lt;/p&gt;

&lt;p&gt;Swift aims to bridge the gap between Apple’s keystone Objective-C language and popular scripting languages like Javascript and Typescript. Objective-C’s run began in the 1980’s, and in 2014 Apple decided it was time to begin its inevitable phase out. &lt;/p&gt;

&lt;p&gt;Like Javascript and Typescript, the code is structured in a way that reads naturally. Of course, there’s no shortage of proprietary flourishes to distinguish it from its competitors. But the structural similarities are clear.&lt;/p&gt;

&lt;h1&gt;
  
  
  Syntax
&lt;/h1&gt;

&lt;p&gt;In Javascript, const and let lend different types of functionality to variables. In Swift, there is no const, and the variable let is actually more similar to the Javascript const. The only difference is its value can be declared after initialization. &lt;/p&gt;

&lt;p&gt;Swift&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let greeting
Greeting = ‘hello world’
//cannot be changed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let greeting = ‘hello world’
Greeting = ‘new greeting’
//can be reassigned
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;String literals in Javascript and Typescript rely on backticks to create a string that can interpret variables. In Swift, this process is accomplished with a ‘\’ escape character followed by the variable name in parenthesis. &lt;/p&gt;

&lt;p&gt;Swift&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let timelyGreeting = “Good \(timeOfDay)!”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let timelyGreeting = `Good ${timeOfDay}!`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arrays in Swift and Javascript are identical&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Var colors = [“red”, “green”, “blue”]
Colors[3] = “orange”
//valid in both Swift and Javascript!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary&lt;/p&gt;

&lt;p&gt;This is just a brief exploration of the reasons for Swift’s recent rise in popularity and the way the language interprets to Javascript and Typescript.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fixing Your Dependency Issues w/ Docker</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 15 Mar 2021 07:06:56 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/fixing-your-dependency-issues-with-docker-536e</link>
      <guid>https://dev.to/bradleyblacksound/fixing-your-dependency-issues-with-docker-536e</guid>
      <description>&lt;p&gt;Great software relies on other programs to do much of the heavy lifting. Utilizing node libraries, database management services, and APIs makes for apps that require interconnectivity between a number of very powerful components.&lt;/p&gt;

&lt;p&gt;The modular nature of these services allows developers to build tech-stacks with great experimentation and speed. This web of dependencies becomes as critical to an application's success as the code itself. However, dependencies pose a challenge when a program is passed between different machines, with different versions of libraries, and different hardware, and different network settings, etc etc.&lt;/p&gt;

&lt;p&gt;All these unique factors that comprise a coding environment can lead to programs that run smoothly in certain settings and crash and burn in others. Ultimately, there's no certainty to how a program's dependencies will perform outside of the initial coding environment. And when there are issues, the debugging process can be quite time-consuming and frustrating. One tool to combat this is known as containerization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting to Know Containers
&lt;/h2&gt;

&lt;p&gt;Containers are a means for lightweight software virtualization. Their popularity is an acknowledgement that dependency libraries are foundational building blocks of modern apps. Containers are airtight coding environments. They include code, dependencies, and all necessary configuration information to successfully launch a program. Since containers are self-contained, they're also super portable, and they offer a much needed solution to the complexity created by dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Containers, Images, and Registries
&lt;/h2&gt;

&lt;p&gt;Docker is one of the most popular container platforms. There are three keys to the Docker system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Containers- Containers are isolated live development environments. They are a virtualization of the host operating system. While similar to traditional virtual machines, containers utilize the host's operating system instead of launching complete, and heavy, isolated operating systems for every guest. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Images- An image is a container in a static, read-only state. Images are easily transferable, and can be uploaded to a registry, stored locally, or shared with others in a development team. These files are multi-layered and comprise all the instructions required to launch a container.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Registry- An archive of images. Docker offers a public library where programmers can publish their images and download the work of others.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Docker can be run directly from a terminal via the command line. There is also a stand-alone desktop application. Each gives programmers access to local and online libraries of images from which they can create new containers.&lt;/p&gt;

&lt;p&gt;The docker daemon is the workhorse of the docker engine. Interactions with either the command line or desktop application kick the daemon into action. The daemon takes on the tasks of packaging containers into images, image manipulation, and image management. A restful API resides between the client and the daemon, as part of the daemon's responsibilities are uploading and pulling images from remote locations.&lt;/p&gt;

&lt;p&gt;Once installed, running docker is as simple as launching any other program in a bash terminal. For example, if you're launching from a mac, you can create a Linux container by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
Digest: sha256:b4f9e18267eb98998f6130342baacaeb9553f136142d40959a1b46d6401f0f2b
Status: Downloaded newer image for ubuntu:latest
root@f37912e87219
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Welcome to the command line of your new Ubuntu container, which has been launched from a now locally stored Ubuntu image. Following in the terminal, you can see how this process begins with the daemon looking locally for the image you've requested. If it's not there, it will pull it from the docker registry. The container ID for this instance is listed in the command line. Running multiple ubuntu containers in multiple terminals is as simple as running the same command, but now they will launch from the image file stored locally to your machine. Each container will have a unique ID and a random name generated as a courtesy, as you can see using the list container command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container ls --all
CONTAINER ID   IMAGE     COMMAND       CREATED          STATUS                        PORTS     NAMES
fb7481161193   ubuntu    "bash"        5 minutes ago    Exited (0) 12 seconds ago               sweet_northcutt
40fefcb85c40   ubuntu    "/bin/bash"   5 minutes ago    Exited (0) 5 minutes ago                hardcore_thompson
f37912e87219   ubuntu    "bash"        12 minutes ago   Exited (130) 12 minutes ago             wizardly_agnesi
2000232fa0cf   ubuntu    "bash"        15 minutes ago   Exited (0) 15 minutes ago               recursing_shtern
127e12f73185   ubuntu    "bash"        16 minutes ago   Exited (0) 15 minutes ago               frosty_torvalds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The speed and ease at which a programmer can access and share fully realized development environments is why containerization has become a standard practice in professional development. Docker makes quick work of dependency management, and frees programmers from the tedium of resolving why a build works on one machine but not others.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Classes or Hooks: Managing State in React</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 08 Mar 2021 05:59:35 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/classes-or-hooks-managing-state-in-react-3f7a</link>
      <guid>https://dev.to/bradleyblacksound/classes-or-hooks-managing-state-in-react-3f7a</guid>
      <description>&lt;p&gt;When learning to program with the React Javascript library, a central theme begins to emerge: dynamism with stability and simplicity. Modern applications are built for interaction. So much so that programs feel less like lines of code and more like living organisms. This is a useful lens for viewing React’s architecture. Like living things, React has centralized higher-level logic and functionality. One of the key pieces of this centralized structure is known as state.&lt;/p&gt;

&lt;p&gt;State is used to maintain all the parts of an application that have dynamic potential. Elements in the DOM are mere sensory triggers that relay user behavior and display information dictated by state. So how does one interact with their application’s state?&lt;/p&gt;

&lt;p&gt;Prior to the release of React 16.8, state was a feature exclusive to class components. Class components, unlike their functional counterparts, could access state on the React component constructor method. However, 16.8 now allows developers to utilize state in functional components as well. This is done with a set of methods totally distinct from those used by classes. It’s important to remember that these methods are exclusive to each type of component! In other words, it’s impossible to implement class state methods on functional components, and vice versa.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structure of State
&lt;/h2&gt;

&lt;p&gt;Not only are the class and functional state methods distinct, the structure of state itself is unique to each component. For class components, state is an object. The state object’s keys represent dynamic elements in an application, and the values of these keys reflect the current state of each element.&lt;/p&gt;

&lt;p&gt;When accessing state in functional components, you bypass this object structure and engage with the values directly. Values held in state are simply assigned to a variable, and through a unique function that couples closely to the variable, its value can be manipulated. &lt;/p&gt;

&lt;h2&gt;
  
  
  setState of Class Components
&lt;/h2&gt;

&lt;p&gt;Setting/changing state of class components is accomplished with the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Pizza extends React.Component {
  constructor(props) {`
    super(props);
    this.state = {
      customer: '',
      size: '',
      toppings: [],
      count: 0,
    };
    this.handleChange = this.handleChange.bind(this)
  }

  handleChange() {
    this.setState({
      customer: 'Isidro',
      size: 'medium',
      toppings: ['spinach', 'musrooms', 'onions', 'garlic'],
      count: this.prevState.count + 1
    })
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this example, the values in the handleChange method have been hard-coded for simplicity. The setState method must return an object. The object will reference a key that has been added to state, and it will reassign the state value to the one being returned. Conveniently, a return object that only contains a single key/value pair will not cause other key/values in state to be removed. Only the key returned by the setState method will be affected.&lt;/p&gt;

&lt;p&gt;In a situation where the current value of state must be accessed to properly reassign state (represented in this example by the customer’s customerLoyaltyCount), prevState is passed into setState as an argument, and all state properties can be referenced on the prevState object.&lt;/p&gt;

&lt;p&gt;To summarize class components: a key/value is initialized on the this.state object, and it is manipulated with the setState method.&lt;/p&gt;

&lt;h2&gt;
  
  
  useState of Functional Components
&lt;/h2&gt;

&lt;p&gt;Functional components acknowledge state with es6 destructuring syntax and the useState method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Pizza() {
  const [customer, setCustomer] = useState('')
  const [size, setSize] = useState('')
  const [toppings, setToppings] = useState([])
  const [count, setCount] = useState(0)

  const handleChange= () =&amp;gt; {
    setCustomer('Isidro')
    setSize('medium')
    setToppings(['spinach', 'musrooms', 'onions', 'garlic'])
    setCount(count + 1)
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;useState initializes a property to state. The argument provided sets the initial state value. It returns a tupple with the state value at index 0 and a function to alter this value at index 1. Destructuring allows programmers to assign this value/function pair to unique variable names. So, instead of using setState to access state, and then specifying the property that needs to be changed, one simply calls the named function that achieves this result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Adding state to functional components has given developers an alternate way to add interactivity though React. Also, because functional components don’t utilize constructors or bindings, the syntax is much cleaner than that of class components. This exemplifies how React aims to simplify and super-charge the tools programmers use to make modern applications.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SQL and NoSQL Data structures</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 01 Mar 2021 05:34:30 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/sql-and-nosql-data-structures-37am</link>
      <guid>https://dev.to/bradleyblacksound/sql-and-nosql-data-structures-37am</guid>
      <description>&lt;p&gt;For every benefit of a data structure, there will be some tradeoff. Consider cooking: say you want to prepare a meal that is cheap, fast, and delicious. You realize that you’ll only ever be able to achieve two of these qualities. So, then, it’s about ordering your priorities. And your priorities for a weeknight meal will differ from meal planning on the weekend. The same give and take is true of databases. Any application will have unique data storage priorities. These priorities are largely outlined by the CAP theorem:&lt;/p&gt;

&lt;p&gt;C: Consistency&lt;br&gt;
A: Availability&lt;br&gt;
P: Partition Tolerance&lt;/p&gt;

&lt;p&gt;Imagine these qualities as a triangle, and a given database resides on one of the triangle’s vectors. &lt;/p&gt;

&lt;p&gt;SQL would reside on the vector between consistency and availability. NoSQL would reside between Availability and Partition Tolerance. Choosing which data storage type is right for an application means choosing the greatest priority, and understanding it will come at the expense of a lower priority.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL
&lt;/h2&gt;

&lt;p&gt;SQL has been in practice for over two decades, and takes advantage of a relational format that increases durability and safeguards data. Data in one table can reference data from another table using keys. For deeply structured data (think anything that can cleanly be represented on an Excel spreadsheet), MySQL creates a powerful interconnected web of data that is ideal for advanced analytics. Structured Query Language is also programmer friendly. The highly structured format makes easy work of iterating through a table, filtering data, or joining data into a single collection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0s7YoDul--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru5d2ah1ey11r2wi1i3j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0s7YoDul--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru5d2ah1ey11r2wi1i3j.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For large data systems, the table-based architecture exemplified here simply scales upwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  NoSQL
&lt;/h2&gt;

&lt;p&gt;As storage needs have tilted due to the sheer volume of data collected and utilized in applications, availability and accessibility of storage have become a priority. This is where MongoDB and other NoSQL database systems thrive. By using an unstructured format, any type of data, and importantly, varying volumes of data, can easily be stored. Unstructured storage is also the optimum format for data that might not currently have much utility in a program, but could be useful in the future.&lt;/p&gt;

&lt;p&gt;MongoDB stores data in the JSON format. JSON, or Javascript Object Notation, utilizes a key value system that is less rigid than the table system used by SQL databases. JSON’s ubiquity makes the process of formatting data for storage in MongoDB fairly straightforward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ajP8wSXy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6atqvbesrrk8lqmhb8t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ajP8wSXy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6atqvbesrrk8lqmhb8t.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's important to note that there are a variety of options for adding advanced analytics functionality to MongoDB. While these methods won't be native to MongoDB as they are to MySQL, they offer programmers the opportunity to capture some of the functionality of structured databases. &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;To summarize, structured data storage like SQL is ideal for applications where advanced analytics are required. On the other hand, NoSQL databases like MongoDB allow programmers greater flexibility for data that is difficult to structure. MongoDB also utilizes the popular JSON format. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Unit Testing with Sinon Spies</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Mon, 22 Feb 2021 08:02:52 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/unit-testing-with-sinon-spies-5g1i</link>
      <guid>https://dev.to/bradleyblacksound/unit-testing-with-sinon-spies-5g1i</guid>
      <description>&lt;h1&gt;
  
  
  Unit Testing
&lt;/h1&gt;

&lt;p&gt;Unit testing is a key tool for auditing, troubleshooting, and maintaining code. The basic principle of a unit test is that it runs on code that is locally available, and it doesn’t create side-effects.&lt;/p&gt;

&lt;p&gt;APIs, databases, and other components outside of a coder’s control can complicate the troubleshooting process. That’s where unit testing comes in handy. When unit testing, programmers can emulate the behavior of these components with stand-ins . Not only can these stand-ins emulate the behavior of other parts of a program, they can also provide valuable feedback on how a program is running.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sinon Spies
&lt;/h1&gt;

&lt;p&gt;Sinon’s library of modules and methods provide programmers with tools to write powerful unit tests. One of these tools is spies. The functionality of Sinon spies lines up well with the definition of spy. IRL spies covertly collect and report information on a given target’s activities, movements, and plans. This isn’t far off from the behavior of a Sinon spy.&lt;/p&gt;

&lt;p&gt;Spies wrap around existing functions, and mimic their functionality. They can also be used as an anonymous function, and, say, be fed into another function as its argument. The benefit of these practices is revealed when looking through the spy’s methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alwaysCalledOn: ƒ ()
alwaysCalledWith: ƒ ()
alwaysCalledWithExactly: ƒ ()
alwaysCalledWithMatch: ƒ ()
alwaysCalledWithNew: ƒ ()
alwaysReturned: ƒ ()
alwaysThrew: ƒ ()
callArg: ƒ ()
callArgOn: ƒ ()
callArgOnWith: ƒ ()
callArgWith: ƒ ()
calledAfter: ƒ (l)
calledBefore: ƒ (l)
calledImmediatelyAfter: ƒ (l)
calledImmediatelyBefore: ƒ (l)
calledOn: ƒ ()
calledWith: ƒ ()
calledWithExactly: ƒ ()
calledWithMatch: ƒ ()
calledWithNew: ƒ ()
create: ƒ (l,n)
formatters: {c: ƒ, n: ƒ, D: ƒ, C: ƒ, t: ƒ, …}
getCall: ƒ (l)
getCalls: ƒ ()
invoke: ƒ (l,n,u)
invokeCallback: ƒ ()
matches: ƒ (l,n)
matchingFakes: ƒ (l,n)
named: ƒ (l)
neverCalledWith: ƒ ()
neverCalledWithMatch: ƒ ()
printf: ƒ (l)
reset: ƒ ()
returned: ƒ ()
spyCall: ƒ ()
threw: ƒ ()
throwArg: ƒ ()
withArgs: ƒ ()
yield: ƒ ()
yieldOn: ƒ ()
yieldTo: ƒ ()
yieldToOn: ƒ ()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the spy is set up to reveal information relevant to a function’s behavior. For example, coders can use these methods to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Count the number of times a function is called&lt;/li&gt;
&lt;li&gt;Record the order in which functions execute&lt;/li&gt;
&lt;li&gt;Record arguments that are passed into a function&lt;/li&gt;
&lt;li&gt;Store a function's output on a specified call&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code Example
&lt;/h1&gt;

&lt;p&gt;The function uniqueCall should accept array and callback parameters. Also, if the array includes duplicate values, the callback function should only run on those values which are unique.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const uniqueCall = (array, callback) =&amp;gt; {

}

let array1 = [1, 2, 2, 3]
let spy1 = sinon.spy()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An array with a duplicate value, and a Sinon spy have been initialized. The spy can be used in place of any function. In this instance, it will be given to the uniqueCall function as an argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const uniqueCall = (array, callback) =&amp;gt; {
    array.forEach(value =&amp;gt; {
            callback(value)
    })
}

let array1 = [1, 2, 2, 3]
let spy1 = sinon.spy()
uniqueCall(array1, spy1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A v1 of uniqueCall has been implemented. The callCount method can be called on spy1 to see if the function’s behavior matches expectations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; spy1.callCount
&amp;lt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since this isn’t the expected result, a v2 of uniqueCall will need to be implemented:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const uniqueCall = (array, callback) =&amp;gt; {
    const calledValues = [];
    array.forEach(value =&amp;gt; {
        if (!calledValues.includes(value)) {
            calledValues.push(value)
            callback(value)
        }
    })
}

let array1 = [1, 2, 2, 3]
let spy1 = sinon.spy()
uniqueCall(array1, spy1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; spy1.callCount
&amp;lt; 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a fairly simple example of how spies and their methods can be utilized for testing. When used to debug and optimize code, Sinon gives programmers valuable feedback so they can quickly make necessary changes.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript Prototypes DIY</title>
      <dc:creator>Bradley Black</dc:creator>
      <pubDate>Wed, 20 Jan 2021 22:01:58 +0000</pubDate>
      <link>https://dev.to/bradleyblacksound/javascript-prototype-diy-2p4d</link>
      <guid>https://dev.to/bradleyblacksound/javascript-prototype-diy-2p4d</guid>
      <description>&lt;h2&gt;
  
  
  What Are Prototypes?
&lt;/h2&gt;

&lt;p&gt;Javascript prototypes scale up to the global level, and down to individual objects and elements coded into an environment. Global prototypes that come native to JS simply append to this object-oriented structure. Of course, coders can build upon this existing structure with their own prototypes.&lt;/p&gt;

&lt;p&gt;So what are prototypes, and why use them?&lt;/p&gt;

&lt;p&gt;Prototype methods are functionally the same as non-prototype methods, but, in most cases, prototype methods are the more efficient option. This is because non-prototype methods are copied within every instance of that datatype. The result is higher memory usage.&lt;/p&gt;

&lt;p&gt;On the other hand, prototypes are stored as a single instance, thus taking up less memory.&lt;/p&gt;

&lt;p&gt;The question of whether or not to use prototypes hinges on how frequently they’ll be accessed. If your method will only be used sporadically, then a prototype is probably the best bet. The native methods of JS also adhere to this approach.&lt;/p&gt;

&lt;p&gt;These are (some of) the non-prototype methods for arrays:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OWHJUU9j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2k8yc88mtoptkc9ppas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OWHJUU9j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2k8yc88mtoptkc9ppas.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here are (some of) the prototypes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zg2MfJ41--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zhegvchp68jinmhjamn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zg2MfJ41--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zhegvchp68jinmhjamn3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Thinking Globally
&lt;/h2&gt;

&lt;p&gt;In every JS environment, the global Object reigns, and all other complex data types inherit its prototypes. These complex data types themselves are objects, and they have access to their own set of methods and prototypes.&lt;/p&gt;

&lt;p&gt;To see this in action, enter Object.prototype in the Dev Tools console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B4XnMcRJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wraiw1eunsh29pqnig9l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B4XnMcRJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wraiw1eunsh29pqnig9l.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the global Window object, or any new objects that are created, these prototypes are available.&lt;/p&gt;

&lt;p&gt;Now check the global Array prototypes by entering Array.prototypes. You’ll see a set of functions stored under the “proto” label.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D86PCIJ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fjriqzyfle4i2ebhx1fa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D86PCIJ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fjriqzyfle4i2ebhx1fa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look familiar? You can see how the Array object has inherited all of the global Object’s prototypes. Notice these prototype methods are actually all functions. Also, notice how the functions have access to their own folder of global function prototypes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prototype DIY
&lt;/h2&gt;

&lt;p&gt;Understanding this, you can see the functional symmetry between global objects and objects you code into a JS environment. Array methods and prototype methods are simply key/value pairs assigned to the global Array object, and, since they’re stored globally, any arrays you create will be able to access them.&lt;/p&gt;

&lt;p&gt;Now we can, say, create a printMoney method that translates any array into dollar signs, and make it globally available for all arrays:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dtVbHI5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f1xcfvtcy142c7wey0mo.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dtVbHI5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f1xcfvtcy142c7wey0mo.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
