<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Patrick Steele-Idem</title>
        <description>Web Development, JavaScript, Node.js and open source software.</description>
        <link>http://psteeleidem.com/</link>
        <lastBuildDate>Thu, 07 Apr 2016 20:57:16 GMT</lastBuildDate>
        <docs>http://blogs.law.harvard.edu/tech/rss</docs>
        <copyright>All rights reserved 2014, Patrick Steele-Idem</copyright>
        <generator>Feed for Node.js</generator>
        <item>
            <title><![CDATA[Improving the Module Factory Pattern in Node.js]]></title>
            <link>http://psteeleidem.com/node-module-factory-pattern/</link>
            <guid>http://psteeleidem.com/node-module-factory-pattern/</guid>
            <pubDate>Mon, 12 Jan 2015 07:00:00 GMT</pubDate>
            <description><![CDATA[<p>There&#39;s a common design pattern in the Node.js community that has been bothering me for some time since it results in less readable code. The issue relates to designing modules that export a single <em>factory</em> function. Let&#39;s take a look at some example code using the popular <a href="https://www.npmjs.com/package/express">express</a> module:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">var</span> app = express();
</code></pre>
<p>The above code first requires the <code>express</code> module to get a reference to a function that, when invoked, will create a new Express app instance.</p>
<p>The following code has equivalent results, but it has been reduced to a concise one-liner, albeit less readable:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> app = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>)();
</code></pre>
<p>The implementation for this pattern will be similar to the following:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Foo</span>(<span class="hljs-params">options</span>) </span>{
    <span class="hljs-comment">// ...</span>
}

Foo.prototype = {
    <span class="hljs-comment">// ...</span>
}

<span class="hljs-built_in">module</span>.exports = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">options</span>) </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> Foo(options);
}
</code></pre>
<p><a href="http://psteeleidem.com/node-module-factory-pattern/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
        <item>
            <title><![CDATA[Bypassing Express View Rendering for Speed and Modularity]]></title>
            <link>http://psteeleidem.com/bypassing-express-view-rendering-for-speed-and-modularity/</link>
            <guid>http://psteeleidem.com/bypassing-express-view-rendering-for-speed-and-modularity/</guid>
            <pubDate>Wed, 05 Nov 2014 07:00:00 GMT</pubDate>
            <description><![CDATA[<p>Check out my post on the StrongLoop blog to learn how bypassing the Express view rendering engine can improve the speed and modularity of your web application. Please visit:<br><a href="http://strongloop.com/strongblog/bypassing-express-view-rendering-for-speed-and-modularity/">StrongLoop Blog: Bypassing Express View Rendering for Speed and Modularity</a></p>
<p><a href="http://psteeleidem.com/bypassing-express-view-rendering-for-speed-and-modularity/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
        <item>
            <title><![CDATA[The JavaScript Templating Landscape]]></title>
            <link>http://psteeleidem.com/the-javascript-templating-landscape/</link>
            <guid>http://psteeleidem.com/the-javascript-templating-landscape/</guid>
            <pubDate>Thu, 23 Oct 2014 06:00:00 GMT</pubDate>
            <description><![CDATA[<p>Choosing a template may seem inconsequential at first, but it can have a big impact on a project. Many templating languages have a certain design philosophy that may put restrictions on how you build your app. In addition, there can be significant performance implications that can increase rendering times or add to the weight of your page. It is also important to consider maintainability, usability and debuggability of a templating language, which can have a big impact on developer productivity.</p>
<p>This guide hopes to help you navigate the JavaScript templating landscape. This document is not, however, meant to be comprehensive guide that compares all possible JavaScript templating languages. Instead, I have picked a few templating languages that I believe highlight the different types of templating languages.</p>
<p><a href="http://psteeleidem.com/the-javascript-templating-landscape/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
        <item>
            <title><![CDATA[Marko versus Dust]]></title>
            <link>http://psteeleidem.com/marko-versus-dust/</link>
            <guid>http://psteeleidem.com/marko-versus-dust/</guid>
            <pubDate>Wed, 22 Oct 2014 06:00:00 GMT</pubDate>
            <description><![CDATA[<p>This guide aims to compare <a href="https://github.com/marko-js/marko">Marko</a> and <a href="https://github.com/linkedin/dustjs">Dust</a> to help guide developers deciding between the two. However, even if you are considering other templating languages, such as Handlebars or Mustache, this guide should still be helpful.</p>
<p>Why Marko and Dust? Dust represents a well-established text-based templating language and Marko represents a well-established HTML-based templating language. Marko was created as an alternative to Dust when Dust was first starting to be used at eBay.</p>
<p><em>Disclaimer: This guide is my opinion, and as the author of Marko it is very difficult for me to be unbiased. Also, I&#39;ve used Dust enough to be proficient in it, but I would not claim to be a Dust expert. If you feel that anything is misleading or wrong then please let me know and I will correct it. Also, my goal was to be as objective and as fair as possible, but some things are inherently subjective.</em></p>
<p><a href="http://psteeleidem.com/marko-versus-dust/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
        <item>
            <title><![CDATA[Announcing Marko!]]></title>
            <link>http://psteeleidem.com/announcing-marko/</link>
            <guid>http://psteeleidem.com/announcing-marko/</guid>
            <pubDate>Tue, 21 Oct 2014 06:00:00 GMT</pubDate>
            <description><![CDATA[<p>We are excited to announce the release of <a href="https://github.com/marko-js/marko">Marko</a>! Earlier this year, we undertook the task of making substantial usability improvements to the Marko language and API based on the feedback received from the community. We also made significant performance improvements that resulted in Marko being far faster <em>and</em> leaner than all competitors (see <a href="https://github.com/marko-js/templating-benchmarks">benchmarks</a>).</p>
<p>If you are not familiar with Marko, it is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser. Marko was founded on the philosophy that an HTML-based templating language is more natural and intuitive for generating HTML.</p>
<p>In this release the language is fundamentally the same, but we have removed the friction that made it more difficult to adopt Marko templates in the past. Notably, we have switched from an XML parser to an HTML parser. In addition, the AMD-based modules were replaced with CommonJS-based modules for better compatibility with the Node.js module loader.</p>
<p><a href="http://psteeleidem.com/announcing-marko/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
        <item>
            <title><![CDATA[Introduction]]></title>
            <link>http://psteeleidem.com/intro/</link>
            <guid>http://psteeleidem.com/intro/</guid>
            <pubDate>Wed, 23 Apr 2014 06:00:00 GMT</pubDate>
            <description><![CDATA[<p>A little about myself, I’m currently a Senior Platform Architect at eBay. I started out building web applications, but I now focus mostly on building the platform so that others can build applications more easily. Building frameworks, platforms and tools is a much better fit for me because if I were tasked with building a web application I would typically end up spending too much time on the underlying architecture. </p>
<p>This blog gives me a chance to share my vision for how building web applications can be made easier. I am an open source advocate and you can find many of my projects linked to from this site.</p>
<p><a href="http://psteeleidem.com/intro/">Continue Reading on http://psteeleidem.com/ &raquo;</a></p>]]></description>
            <content:encoded/>
            <author>
                <name>Patrick Steele-Idem</name>
                <email>pnidem@gmail.com</email>
            </author>
        </item>
    </channel>
</rss>