<?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 Mike MacLean on Medium]]></title>
        <description><![CDATA[Stories by Mike MacLean on Medium]]></description>
        <link>https://medium.com/@mikemaclean?source=rss-66fe8b6950b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aTxaSRgGUIXXyHG0.</url>
            <title>Stories by Mike MacLean on Medium</title>
            <link>https://medium.com/@mikemaclean?source=rss-66fe8b6950b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:56:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mikemaclean/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[Control Flow and the Progression of Asynchronous JavaScript]]></title>
            <link>https://medium.com/@mikemaclean/control-flow-and-the-progression-of-asynchronous-javascript-936a0aaf336d?source=rss-66fe8b6950b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/936a0aaf336d</guid>
            <category><![CDATA[asyncawait]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[async-functions]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mike MacLean]]></dc:creator>
            <pubDate>Tue, 31 Oct 2017 06:36:01 GMT</pubDate>
            <atom:updated>2017-10-31T06:36:01.743Z</atom:updated>
            <content:encoded><![CDATA[<p>Got events to handle? Functions to execute? Get in sync or get in line…</p><p>As developers manipulating the DOM with temporally static documents, it’s hard to keep in mind that our code doesn’t do anything without an engine’s temporally dynamic processing real estate, widely known as control flow. To ensure we are on the same page: control flow refers to the specified order in which individual expressions and imperative function calls of a program are executed or evaluated. From the front end, most instances sent to the server can be invoked seamlessly, responded to with immediate execution. However, asynchronous applications, such as those often conducted with JavaScript, use functions that require special attention from the server engine.</p><p>THE RUN LOOP: the life of a browser</p><p>Thee Run Loop is an infinitely churning gear that leverages asynchronous programming. It deals with asynchronous programs with a never ending function that looks something like this:</p><pre>while(... get an event ...)<br>    ... handle event ...</pre><p>Even if it doesn’t hear an event, it keeps listening, because we need it to support our asynchronous calls and events, whenever they arrive. We need it to keep monitoring, because even for a website with virtually no traffic, there might eventually be a click, in which case it needs to handle an event. We need to appreciate that for the majority of the time, the browser is just looping its whole life, waiting to delegate…</p><pre>repeatForever<br>  doInternalUpkeep()<br>  queue.addAll(events.getTranspired())<br>  queue.length &amp;&amp; queue.dequeue</pre><p>So what happens when an asynchronous program is received? The browser, in the midst of the loop above, receives the program, opens it, and transpires all of the events, based on when they happen or when they request to run, delegates control to them using a hash table, prioritizing based on their arrival, first come first serve. Sounds like a queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*nYrp7q1o3PQediv81ni-HQ.png" /></figure><p>So the Run Loop opens a program, finds the asynchronous functions, and puts them in a cue. Then it runs them later, which could be at some time far past the timeouts or intervals intended, based on a number of variables. Some events even expire. However, because of the processing power of this Run Loop, and the increasing asynchronous capabilities of languages such as JavaScript, events are tough to block, and most of them can be expected to occur. This makes web applications smooth and reliable.</p><h3>Asynchronous Progress in JavaScript</h3><p>CALLBACKS</p><p>Asynchronous programming requires that functions and expressions are able to be delegated to other functions, such as that of the run loop, to be executed at a later time. This is how callbacks were born: in order not to invoke a function immediately in sync with the surrounding functions, it was realized that passing a function to another function as a parameter could ensure invocation at a later time, after the outer function finished its work.</p><p>Although this was an important concept for async events, we know that while working with callbacks it can get complicated and tedious to run things in parallel, sequentially or even mapping arrays using asynchronous functions. The JavaScript world started to look for solutions that could make asynchronous JavaScript development easier.</p><p>PROMISES</p><p>Eventually, the community adopted promises. A promise represents the eventual result of an asynchronous operation.The current JavaScript Promise specifications date back to 2012 and are available from ES6. Promises utilize callbacks as well, but have more flexible functionality. Both the then and the catch registers callbacks that will be invoked with either the result of the asynchronous operation or with the reason why it could not be fulfilled.</p><p>GENERATORS</p><p>Eventually the community began to use Generators and Yields, which allow us to pause our function at any point and calculate other things and perform other operations, even values that may be called back for resume. When we call a generator function it doesn’t start running, we will have to iterate through it manually. For writing asynchronous JavaScript, you can get a lot of functionality by coupling generators with Co, which is a generator based control flow for Node.js and the browser, which uses promises to avoid blocks.</p><p>ASYNC</p><p>Finally, keyword Async functions were introduced in ES7 — and currently only available using a transpiler like <a href="http://babeljs.io/">babel</a>. In essence, the async keyword does virtually the same as the performed combination of coand generators. Under the hood async functions utilize and return Promises. Async also has a very useful feature called await, which will wait for an array of promises to complete. That way you can queue parallel promises, and gate them.</p><p>OBSERVABLES</p><p>It is also worth noting that with ES7 in development, we are also looking forward to observables and streams, which can be better understood here: <a href="https://derickbailey.com/2017/06/06/3-features-of-es7-and-beyond-that-you-should-be-using-now/">https://derickbailey.com/2017/06/06/3-features-of-es7-and-beyond-that-you-should-be-using-now/</a></p><p>Observables have the ability to register and unregister an event handler, among other things that help with asynchronous API architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=936a0aaf336d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey to Software Engineering]]></title>
            <link>https://medium.com/@mikemaclean/my-journey-to-software-engineering-1b86f6e58d65?source=rss-66fe8b6950b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b86f6e58d65</guid>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Mike MacLean]]></dc:creator>
            <pubDate>Sun, 15 Oct 2017 01:21:14 GMT</pubDate>
            <atom:updated>2017-10-15T01:21:14.252Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>Begins general engineering curriculum in college; takes introductory classes to Java, fairs well, but does not continue with computer science as major degree</li><li>After college, teams up with some technologically savvy friends in Silicon Valley. Contributing knowledge of Business Development to the Solar Power industry, complemented by colleague’s adept mobile app development, deploys an app called Solar Home Referrals, which is eventually acquired by an undisclosed public company in San Francisco.</li><li>After working in solar panel manufacturing and sales for 4–5 years, becomes interested again in computer science after seeing so many close friends with computer science backgrounds join top 100 best companies to work for in the USA. Begins utilizing some free educational resources to find that the most currently popular languages are very enjoyable and rewarding to learn.</li><li>Resigns and departs old career after saving up enough funds to support a longer term educational plan. After researching schools and other options that feed students into progressive fast-growing companies, a well-renowned bootcamp surfaced as the best option for accelerated learning and industry immersion.</li><li>After studying for months, focusing solely on a brand new science and set of skills, receives acceptance and admission into Hack Reactor, a 3–6 month bootcamp with outstanding statistics for graduate outcomes.</li><li>So begins Hack Reactor: Remote Immersive Program on October 9th, 2014. So begins the adventure, excitement, struggle, and essentially, the most impressive educational transformation of a lifetime.</li><li>To be continued…</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b86f6e58d65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>