<?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 Nathan Cox on Medium]]></title>
        <description><![CDATA[Stories by Nathan Cox on Medium]]></description>
        <link>https://medium.com/@tsuujin?source=rss-27c6dcf0a5ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*p-y5lhGo_ZSjuHJK.jpg</url>
            <title>Stories by Nathan Cox on Medium</title>
            <link>https://medium.com/@tsuujin?source=rss-27c6dcf0a5ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 10:14:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tsuujin/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[Reaching For The Stars]]></title>
            <link>https://medium.com/crystal-helix/reaching-for-the-stars-f024c07ccd01?source=rss-27c6dcf0a5ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/f024c07ccd01</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[meteor]]></category>
            <dc:creator><![CDATA[Nathan Cox]]></dc:creator>
            <pubDate>Sun, 20 Dec 2015 04:24:22 GMT</pubDate>
            <atom:updated>2015-12-20T19:51:05.695Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2wNzs-xTe4tVXvEx2Cegg.jpeg" /></figure><h4>Adventures with Meteor and React</h4><p>One thing that never ceases to amaze me is how quickly and eagerly the web community can adapt to change, while at the same time being vitriolically opposed to it. If you’ve worked in the industry for a while you have no doubt seen a familiar and highly amusing pattern of behavior towards new technologies; it goes something like this:</p><ol><li>A new concept, library, framework, et cetera is released which challenges something currently used.</li><li>The next day outrage ensues. The new whatever is terrible, doesn’t address points <em>A</em> through <em>F</em> of <em>current rant</em>, has no support and will die in a week.</li><li>One week later, the new something-or-other is amazing, and there’s just no damned point in using that <em>old</em> technology anymore. It would be foolish to even try.</li></ol><p>I am definitely guilty of this, and I’ll give you two real world examples off the top of my head.</p><p>When I first learned of a new trend in databases called ‘NoSQL’ I thought it was the dumbest, most poorly thought out, least useful technology anyone had ever designed. A decade of working with relational, ACID compliant databases had never steered me wrong, and losing referential integrity seemed like an absolute guarantee of failure.</p><p>Next, when I was first exposed to the idea of isomorphic javascript (i.e., NodeJS at the time) I thought it had finally usurped NoSQL as the worst thing ever created. Javascript was the bane of my existance, and I used it only because I didn’t have any choice. Any other language (barring <em>maybe </em>visual basic) would be better suited for any given task and I sure as hell didn’t want to burden myself trying to use it on the server; that was my <strong>escape</strong> from javascript!</p><p>Today I want to introduce you to two of the core components of my chosen tech stack: the isomorphic javascript framework Meteor; and MongoDB, the NoSQL database which powers its data layer.</p><h3>A brief history in the tech</h3><p>While my focus today is going revolve around my experiences using Meteor with React, I think it’s fair to give a brief overview of the tech stack in general.</p><h4>Meteor, isomorphic javascript it its best</h4><p>I’ve come a long way since my first (bigoted) impressions of Meteor, and in fairness so has Meteor. Over the last year I’ve watched it grow enormously and become a rock solid choice in the already overpopulated field of web technologies.</p><p>One of my favorite traits of Meteor is its amazing and enthusiastic community. There are plenty of role models to look up to and learn from (my personal hero is Arunoda of Kadira fame, you can <a href="https://voice.kadira.io/">read his blog here</a>), and a visit to <a href="https://atmospherejs.com/">Atmosphere</a>, the Meteor package repository, will probably cover most of your basic needs.</p><p>Meteor is basically magical when it comes to data integration; because of the way it integrates with Mongo changes to the database are instantly reflected on the page of every connected user, a technique known as reactivity. This is ideal for data driven apps, because it reduces the need for page reloads from the user and cuts down a ton of boilerplate AJAX code that developers would normally need to write.</p><h4>MongoDB, the NoSQL database which changed my mind</h4><p>Meteor sits on top of MongoDB in a very elegant way, and most of the time you won’t need to worry about exactly how Mongo works (which is awesome). This is partially because Mongo stores data in something equivalent to JSON format and the conversions are dead simple going from javascript to Mongo.</p><p>One of the nice things about working with an isomorphic framework is that you only need to know a single language to get everything to work, from the server to the client, and Mongo supports this fully. In fact, if you open a Mongo shell you can use pure javascript in the console, which definitely blew my mind.</p><h4>React, the thing I haven’t talked about yet</h4><p>React is a javascript library for creating web user interfaces, created by Facebook. You can frequently find it poking its head out of the turbulent waters created by Angular, Ember, Backbone, and all of the other javascript frameworks which on the surface seem to be trying to do the same thing.</p><p>What sets React apart is that it isn’t trying to be a single solution to all of your problems. React tackles interface implementation, and that’s all. It does one job, but it does it very well.</p><p>React is opinionated, and frequently attempts to guide you on the path to writing good, modular, encapsulated code.</p><h4>ES2015, the reason I gave JS a second chance</h4><p>A brief mention needs to go out to the fact that Meteor supports Babel transpilation of ES2015 to ES5 out of the box with no configuration needed. ES2015 addresses most of my scathing hatred of the javascript language and turns it into something that I actually quite enjoy working with. If you haven’t been exposed to it yet <a href="https://babeljs.io/docs/learn-es2015/">I highly suggest you take a look</a>.</p><h3>Making a good thing better</h3><p>Out of the box Meteor comes with a templating engine called Blaze, which uses the Spacebars templating language (there’s a theme here, if you haven’t noticed yet). Blaze is fine, but it doesn’t address one of the main problems I’ve always had with web tech stacks: the templating engine is trying to be something that it’s not.</p><h4>Enter JSX</h4><p>Most templating languages come with constructs that look a lot like javascript constructs. You can use an if block to conditionally print elements, for loops to iterate through server objects, et cetera. The problem is that while they work, they are never as good as the native versions of what they are trying to be.</p><p>React solves for this by giving you access to javascript everywhere. If you need to iterate through a list of objects, you just write a regular javascript for loop, or do something fancy like using a lodash forEach statement. If you can do it in javascript, you can do it in the template. To me, this is huge. It feels much more natural to write this way than to use any of the numerous alternatives out there.</p><p>To make this as simple as possible React provides the optional JSX format, which allows you to write your HTML directly inside of a javascript file without needing to use string concatenation. It is awesome, and you can <a href="https://facebook.github.io/react/docs/jsx-in-depth.html">learn more about it here</a>.</p><p>In practice, it looks something like this:</p><pre>Layout = React.createClass({</pre><pre>  renderArticle() {<br>    return (<br>      &lt;article&gt;<br>        This is some article content.</pre><pre>        It can &lt;span&gt;contain extra html too&lt;/span&gt;, or even<br>        &lt;a href=&quot;#&quot;&gt;have links and so forth&lt;/a&gt;<br>      &lt;/article&gt;<br>    );<br>  },</pre><pre>  render() {<br>    return (<br>      &lt;section&gt;<br>        &lt;h1&gt;This is a section!&lt;/h1&gt;<br>        {this.renderArticle()}<br>      &lt;/section&gt;<br>    );<br>  }<br>});</pre><h4>But isn’t it hard to get working with Meteor?</h4><p>Nope.</p><p>Meteor has an official integration with React which works great and includes automatic JSX transpilation. In fact, if the scope of this article were simply “how to get React and Meteor working together” the entire contents could have been:</p><pre>meteor add react</pre><h4>So what else you got?</h4><p>What if I told you that you could write your application’s templates entirely in React, without ever needing to have a plain HTML file to start including them? What if I also told you that it could be achieved as a robust SPA routing system?</p><p>For this we need to bring up my hero, Arunoda, again. He’s released a really kick-ass router system which the community has largely embraced called <a href="https://atmospherejs.com/kadira/flow-router">Flow Router</a>. Out of the box it works with Blaze, but he’s also created a tandem package <a href="https://atmospherejs.com/kadira/react-layout">React Layout</a> which can render React components directly from the router. It works great, and makes for some very clean, modular code. Rather than waste time trying to explain the implementation details here, you should go right to the source and <a href="https://kadira.io/academy/meteor-routing-guide">learn from the experts</a>.</p><h4>It can’t be that easy. What’s the catch?</h4><p>You’re right, nothing’s perfect. There are some gotchas involved which I’ve had to work my way through.</p><p>First and foremost, because you no longer have a direct HTML landing template, you don’t have direct access to the document head. This makes including things like meta tags virtually impossible. To address this you can use the killer <a href="https://atmospherejs.com/kadira/dochead">DocHead</a> package, which exposes an easy to use API for adding items to the document header on the fly. Using Flow router’s enter trigger you can easily set the title of the page, add open graph tags, et cetera.</p><p>Next, it’s more difficult to determine where to put google analytics. But that’s ok, because there’s an awesome package for that too: <a href="https://atmospherejs.com/okgrow/analytics">okgrow:analytics</a>.</p><p>After that… actually, that’s pretty much all the caveats I’ve run into so far.</p><h3>Final thoughts</h3><p>Hopefully today I’ve peaked your interest in using React with Meteor. Both of these awesome technologies deserve books worth of tutorials and information and I surely can’t have answered all of your questions here. In fact, I didn’t even try to help you with specific implementation.</p><p>A lot of prominent players in the field of Meteor are excited about React, and there are even rumors of a Blaze 2.0 which will be written on top of React to improve its Meteor reactivity out of the box. Like any solution, there are other alternatives. Aside from just using Blaze, Angular is officially supported by Meteor as well. However, because Angular is so large in scope it’s not ideal, in my mind, for use as a templating engine in a larger framework. Too many cooks in the kitchen and so forth.</p><p>Aside from Arunoda and the Kadira team, React is getting quite a bit of support from the folks at <a href="https://www.discovermeteor.com/">Discover Meteor</a>, who have recently published an <a href="https://www.discovermeteor.com/category/blaze-to-react/">excellent series</a> on integrating these two technologies and actually recommend that all new apps use React rather than Blaze.</p><p>The future is looking bright, and in keeping with the general theme: there is a universe of possibilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f024c07ccd01" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crystal-helix/reaching-for-the-stars-f024c07ccd01">Reaching For The Stars</a> was originally published in <a href="https://medium.com/crystal-helix">Crystal Helix | Facets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thoughts from a new business owner]]></title>
            <link>https://medium.com/crystal-helix/thoughts-from-a-new-business-owner-326cbb7af2b8?source=rss-27c6dcf0a5ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/326cbb7af2b8</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Nathan Cox]]></dc:creator>
            <pubDate>Sun, 13 Dec 2015 03:51:37 GMT</pubDate>
            <atom:updated>2015-12-15T09:10:52.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9SDjff_XSe6Kl_LSJrsKg.jpeg" /></figure><p>Having something which you are truly passionate about is an amazing thing; it can inspire you, give you confidence and strength, and push you to be better each day than you were the day before. Passions are much like fire, in that once lit they can burn brightly and grow uncontrollably.</p><p>My passions are many, but the greatest of them is web design. I love to learn, to expand my mind with the great ideas of others, and I absolutely hate to stagnate. The arena of web technologies is like the chaos of an endless storm. It is unpredictable, constantly changing and evokes powerful emotions from the people involved with it. Every day there is something new to learn; a new technology to explore, a new philosophy to embrace, a new challenge to current convictions. The status quo is a never taken for granted, and what is accepted as <em>good</em> today is cast aside as <em>terrible</em> tomorrow.</p><h4>Taking the next step</h4><p>At some point I learned that floating through the industry wasn’t enough for me, and I made the decision to forge my own path and co-founded a small company. It did not end well, and suffice it to say I am no longer involved with that endeavor. It did however give me a wealth of knowledge (mostly in what <em>not</em> to do) and a lesson in not trusting blindly.</p><p>Today I’m proud to say that I’ve started again, armed with more experience and with a strengthened resolve. I have a strong team behind me, the support of my wonderful family and I’m taking every day as a lesson to be learned.</p><h4>So what have I learned?</h4><p>My first lesson is that <em>starting a business is </em><strong><em>hard</em></strong>. There are many things to do, and you lose the ability to just be lazy and defer to someone else. You have to find clients, write contracts, fill out dozens of packs of legal paperwork, hire employees and still find time to actually produce results.</p><p>It is also <strong><em>expensive</em></strong>. You have to pay for business licences, lawyers, state fees, employees, marketing and more. The glorious catch-22 here is that in order to pay for all of these things you have to make money, but to make money you pretty much have to pay for these things.</p><p>Partially because of the above, it can also be extremely <strong><em>stressful. </em></strong>As a business owner in charge of a team you are essentially taking responsibility for their livelihoods. There is an implicit understanding that if you were to fail you will be negatively impacting the lives of everyone who has placed their faith in you to succeed. This is a weight that I can’t accurately relate through written word, but trust me when I say that it is ever-present and causes sleepless nights in its own right.</p><p>The final take away for the moment is that despite everything I’ve said above, it can also be extremely rewarding. Every small victory seems like an enormous triumph, and every paycheck received is a battle won. For every night I lay awake staring at the ceiling worried about how I’m going to make it through tomorrow there is a moment of jubilant celebration that seems to make it worth the effort.</p><h4>Going forwards</h4><p>I can’t present myself as a business expert, and I won’t presume to try. I try to gain every bit of knowledge and experience I can by associating myself with people I know and trust who are much better at this than I am. Every day there is something new to learn, some new challenge to overcome, and much like I have in the technical world I’m learning to enjoy it in its own right.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=326cbb7af2b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crystal-helix/thoughts-from-a-new-business-owner-326cbb7af2b8">Thoughts from a new business owner</a> was originally published in <a href="https://medium.com/crystal-helix">Crystal Helix | Facets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>