<?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 Dorothy M on Medium]]></title>
        <description><![CDATA[Stories by Dorothy M on Medium]]></description>
        <link>https://medium.com/@dorothy.codes?source=rss-60501d9ecf88------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YrReEuyCH9CIEZM26DVq-w.png</url>
            <title>Stories by Dorothy M on Medium</title>
            <link>https://medium.com/@dorothy.codes?source=rss-60501d9ecf88------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:24:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dorothy.codes/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[Getting started with Vue.js]]></title>
            <link>https://medium.com/dorothy-codes/getting-started-with-vue-js-beginner-gotchas-26c075656509?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/26c075656509</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Sat, 26 Aug 2017 19:42:14 GMT</pubDate>
            <atom:updated>2017-08-26T20:03:59.636Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wqYF-8Dmh7LhtLkKfERc3Q.png" /></figure><p>An experienced developer friend told me recently that Vue.js is becoming more and more popular at his software consulting firm. So when I needed an alternative to Angular in my latest project, a custom “bugs &amp; issues” tracker, I decided to investigate what all the fuss was about!</p><h3>Creating my first Vue app</h3><p>The <a href="https://vuejs.org/v2/guide/">“Getting Started” documentation on vuejs.org</a> is well written and easy to follow. Of course, I made my share of beginner’s errors, which I’ll document here.</p><p>My goal is to dynamically display a list of bugs &amp; issues, populating each row with one element in from an [issues] array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOawvs3dROYxO0KqNxTM2Q.png" /></figure><p>Here’s where I’ll be building my Vue app (issues.js):</p><pre>var issuesApp = new Vue({<br> el: &#39;#issues-container&#39;,<br> data: {<br>  foo: &#39;bar&#39;<br> }<br>})</pre><p>And here’s where I pull in the relevant scripts in issues.html:</p><pre>&lt;script type=&quot;text/javascript&quot; src=&quot;vue/dist/vue.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script type=&quot;text/javascript&quot; src=&quot;issues.js&quot;&gt;&lt;/script&gt;</pre><h3>Gotchas</h3><h4>Cannot find element</h4><p>If you try to load both of the above scripts in the &lt;head&gt; of the document, you’ll get this nasty error:</p><pre>vue@2.4.2:485 [Vue warn]: Cannot find element: #issues-container</pre><p>Moving the script tag that references vue.min.js to the bottom of the page (immediately before the closing body tag) didn’t help.</p><p>What worked was adding the defer attribute to the file where I invoked new Vue().</p><pre>&lt;script type=&quot;text/javascript&quot; src=&quot;issues.js&quot;&gt;&lt;/script&gt;</pre><p>I’m not sure if this is the ideal solution, but it worked for getting my first app up and running quickly.</p><h4><strong>Getting helpful feedback in the console</strong></h4><p>I found this helpful tidbit in the documentation for the <a href="https://github.com/vuejs/vue-devtools">vue-devtools</a> Chrome Extension:</p><blockquote>If the page uses a production/minified build of Vue.js, devtools inspection is disabled by default so the Vue pane won’t show up</blockquote><p>I switched to the un-minified version of vue.js that comes with the Vue node module, and presto, I’m able to view more warnings that are helpful for a newbie.</p><pre>[Vue warn]: v-bind without argument expects an Object or Array value</pre><pre>(found in &lt;Anonymous&gt;)</pre><p>This warning led me to understand that this is not the correct usage of v-bind:</p><pre>Foo is &lt;span v-bind=&quot;foo&quot;&gt;&lt;/span&gt; &lt;!-- don&#39;t do this! --&gt;</pre><p>It turns out that curly brackets work just fine:</p><pre>&lt;div&gt;Foo is {{foo}}&lt;/div&gt;</pre><h4>Tips for beginners in the console</h4><p>Side note: I love the tips that the developers of Vue provide in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*i6PG-XQo0Nswx7NS-SC2bg.png" /></figure><p>Why doesn’t every library do that?!? (Pssst… Angular, I’m looking at you! 😉)</p><h4>Deprecated lifecycle hooks</h4><p>I found out the hard way that some lifecycle hooks referenced in older tutorials existed in previous versions of Vue but have been deprecated in Vue 2.0. For example, ready() is no longer available, but mounted() or created() are alternatives, depending on <a href="https://alligator.io/vuejs/component-lifecycle/">when you want the function to run</a>:</p><pre>var issuesApp = new Vue({<br> el: &#39;#issues-container&#39;,<br> ready: function() { // this won&#39;t work<br>  this.loadIssues();<br> },<br> created: function() { // but this will<br>  this.loadIssues();<br> }, <br>})</pre><h4>Vue.component headaches</h4><p>I tried creating my first component as follows:</p><p><em>issues.js:</em></p><pre>Vue.component(&#39;issueitem&#39;, {<br>  template: &#39;&lt;div&gt;Hi!&lt;/div&gt;&#39;<br>})</pre><p><em>issues.html:</em></p><pre>&lt;issueitem&gt;&lt;/issueitem&gt;</pre><p>But I got the following error:</p><pre>Unknown custom element &lt;issueitem&gt;. Did you register the component correctly?</pre><p>Well, Vue, if I knew how to register the component correctly, we wouldn’t be having this conversation, now, would we??? 😄</p><p>It turns out that in addition to calling Vue.component, you have to add a components key when you invoke new Vue().</p><pre>var _issueitem = Vue.component(&#39;issueitem&#39;, {<br>  template: &#39;&lt;div&gt;Hi!&lt;/div&gt;&#39;<br>});</pre><pre>var issuesApp = new Vue({<br> el: &#39;#issues-container&#39;,<br> data: {<br>  foo: &#39;bar&#39;<br> },<br>  components: {<br>   issueitem: _issueItem<br>  }<br> });</pre><h4>Indicating an external template file in a component</h4><p>templateUrl, which I was familiar with from Angular, does not exist in Vue.</p><pre>Vue.component(&#39;issue&#39;, {<br>  templateUrl: &#39;views/issue.html&#39; // don&#39;t do this!<br>})</pre><p>As a temporary stopgap, I placed my template markup directly into .component, bookended by single backticks:</p><pre>var _issueitem = Vue.component(&#39;issueitem&#39;, {<br>  template: `<br>    &lt;div class=&quot;issue-row&quot; id=&quot;{{issue.id}}&quot;&gt;    <br>      &lt;div class=&quot;issue-col&quot;&gt;Site: {{issue.site}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;Issue: {{issue.issue}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;Page:{{issue.page}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;Browser:{{issue.browser}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;Severity: {{issue.severity}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;# Affected Users: {{issue.users}}&lt;/div&gt;<br>      &lt;div class=&quot;issue-col&quot;&gt;Status: {{issue.status}}&lt;/div&gt;<br>    &lt;/div&gt;<br>   `<br>});</pre><p>It feels a little uncomfortable plunking a big chunk of HTML in the middle of a JavaScript function, but my goal is to get this application up and running quickly [famous last words!], so I’ll leave this as is for now.</p><h4>Scoping</h4><p>Variables defined at the app level are not directly accessible inside components.</p><pre>var _issueitem = Vue.component(&#39;issueitem&#39;, {<br> template: &#39;&lt;div&gt;Foo is {{foo}}&lt;div&gt;&#39; // foo is undefined <br>});</pre><pre>var issuesApp = new Vue({<br> el: &#39;#issues-container&#39;,<br> data: {<br>  foo: &#39;baz&#39;<br> },<br> components: {<br>  issueitem: _issueitem<br> }<br>});</pre><p>However, if you define the variable within the component, it will be accessible to the component’s template:</p><pre>var _issueitem = Vue.component(&#39;issueitem&#39;, {<br> data: function() {<br>  return { <br>   foo: &#39;bar&#39;<br>  }<br> },<br> template: &#39;&lt;div&gt;Foo is {{foo}}&lt;/div&gt;&#39;<br>);</pre><pre>var issuesApp = new Vue({<br> el: &#39;#issues-container&#39;,<br> components: {<br>  issueitem: _issueitem<br> }<br>});</pre><p>(Seems obvious now — duh!)</p><h3>In summary</h3><p>If you’re familiar with another framework like Angular, Vue.js will not seem completely foreign. As with many open-source projects, there are a few holes in documentation for beginners, but with a little digging, it was possible to create my first front-end Vue app in just a few hours.</p><p>I hope this list of gotchas helps other newbies out there!</p><p><em>A note on sources: a big thank you to to Ryan Chenkie, author of “</em><a href="https://scotch.io/tutorials/build-an-app-with-vue-js-a-lightweight-alternative-to-angularjs"><em>Build an app with Vue.js</em></a><em>,” to Joshua Bemenderfer, author of “</em><a href="https://alligator.io/vuejs/component-lifecycle/"><em>Understanding Vue.js lifecycle hooks</em></a><em>,” and to the many contributors on StackOverflow who have already asked and answered questions similar to mine!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26c075656509" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/getting-started-with-vue-js-beginner-gotchas-26c075656509">Getting started with Vue.js</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I’m learning now: SQLite]]></title>
            <link>https://medium.com/dorothy-codes/what-im-learning-now-sqlite-ed77a52a52a6?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed77a52a52a6</guid>
            <category><![CDATA[sqlite]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Tue, 06 Jun 2017 00:21:21 GMT</pubDate>
            <atom:updated>2017-06-06T00:21:21.154Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m working on an application that will allow my team to track broken integrations in an easy-to-read, easy-to-maintain format.</p><p>I had used <a href="http://docs.sequelizejs.com/">Sequelize</a>, a NodeJS ORM, in bootcamp and remember loving it. Perusing the available database options that Sequelize supports, I settled on <a href="https://sqlite.org/index.html">SQLite</a>. Here’s why:</p><ul><li>The application will be low-traffic (most likely &lt;500 page loads/ day) with &lt; 10 users at any given time, and my database would have only one user (the web application, which runs on the same server), so I don’t need to be concerned about supporting high concurrency writes, or requests to the database from across a network.</li><li>You can load CSV files into SQLite (useful because our current tracking information is stored in a spreadsheet).</li><li>Data is stored in a single file that can be uploaded to GitHub and shared with colleagues who are working on the project.</li><li>The documentation is comprehensive and easy to read</li><li>It’s still under active development</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed77a52a52a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/what-im-learning-now-sqlite-ed77a52a52a6">What I’m learning now: SQLite</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My happiest hackathon ever]]></title>
            <link>https://medium.com/dorothy-codes/my-happiest-hackathon-ever-2efba9f00e3b?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/2efba9f00e3b</guid>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Sun, 04 Jun 2017 17:06:19 GMT</pubDate>
            <atom:updated>2017-06-04T17:06:19.569Z</atom:updated>
            <content:encoded><![CDATA[<p><em>My best hackathon experience was less about writing code, and more about planning, scoping, and teamwork</em></p><p>Halfway through my most recent Hack Day — Intent Media’s quarterly two-day hackathon — I realized that this was my favorite hackathon ever!</p><p>What made this one unusually good?</p><h3>Picking the right amount of challenge</h3><p>Initially, I wanted to incorporate the <a href="https://angular.io/">newer Angular</a> version in my project. I’m keen on learning it, and I know it’s a meaty topic, substantially different from <a href="https://angularjs.org/">AngularJS</a>.</p><p>However, after skimming the surface of <a href="http://angular.io/">Angular.io</a>, I could tell the learning curve was going to be too steep for a two-day hackathon. So I fell back to AngularJS, which I had used in past projects.</p><p>In the space of 1–2 hours, I had to refamiliarize myself with AngularJS, since it’d been 9 months since I’d done any active development with this library. Fortunately, I recalled some of the common mistakes I had made in the past — such as paths to client-side JS files not working because of errors with express.static — and was able to get a basic Angular app up and running quickly.</p><p>I was a little disappointed that I wasn’t able to tackle the new Angular this time around, but now I know that it will require more time to get up to speed.</p><h3>Attention to scoping</h3><p>Toward the end of Day 1, it became clear that all the features I wanted to add to my application were not going to get done in a 48-hour period. After discussion with a coworker, I narrowed it down to four features that would make up a Minimum Viable Product — each with a clear path ahead in terms of development.</p><p>Bell-and-whistle features, form validation, back-end data constraints, even automated testing, would have to wait.</p><p>I felt a little uneasy about this last part—omitting automated testing — since as a junior developer, I’d rather be forming good habits, especially with respect to test-driven development.</p><p>In a “real world” situation, I’m not sure that there would be any less time pressure.</p><p>However, for the time being, I realized that I’d have to live with an untested application STRICTLY for demo purposes — with the understanding that before this code goes into production, it should have unit tests and (hopefully) E2E tests incorporated.</p><h3>Supportive, enthusiastic colleagues</h3><p>I shared my Hack Day idea with my supervisor and a co-worker before the hackathon started, and both of them were encouraging and supportive, and saw how my idea could benefit our team.</p><p>Even better, my co-worker was able to pitch in and contribute to designing the data model. With him having done the thinking and planning, I was able to take his output and jump almost immediately into putting it into code.</p><p>That was a wonderful surprise, and big a boost in morale. It means a lot when a peer believes in your vision and is willing to volunteer time and effort to help.</p><p>In short, the factors that made this my happiest hackathon ever had less to do with coding, and more to do with planning, accepting limitations, and teamwork.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2efba9f00e3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/my-happiest-hackathon-ever-2efba9f00e3b">My happiest hackathon ever</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The beauty of binary search]]></title>
            <link>https://medium.com/@dorothy.codes/the-beauty-of-binary-search-1fa4e11f1611?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fa4e11f1611</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Thu, 02 Jun 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-06-04T17:09:52.057Z</atom:updated>
            <content:encoded><![CDATA[<p><em>It wasn’t until today that I fully grasped the power of this algorithm.</em></p><p>I’ve been working my way through <em>Cracking the Coding Interview</em>, which points out common search algorithms that interviewees should be familiar with. The concept of binary search comes up pretty early in the book as one way to solve this problem:</p><blockquote><em>Given a sorted array of integer values, determine if a given value </em><em>x is present.</em></blockquote><p>My go-to method of traversing an array has always been a plain-vanilla for loop that iterates through all values in the array. Well, that&#39;s a big ol&#39; waste of Big-O time if you have a sorted array!</p><p>If you’re looking for a value in an <em>already-sorted array</em>, binary search is faster than a for loop that traverses every item. Why? Upon each successive iteration, it halves the number of items you have to examine! So if you start out with an array of 1000 numbers to search, you immediately at the first step can eliminate 500 possibilities.</p><p>Very cool, right? This results in a Big O of log n.</p><p>(Of course, an even better solution to this problem would be a hash table, but that’s a story for another blog post.)</p><p><em>For further reading on binary search, check out this </em><a href="https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/a/binary-search"><em>excellent tutorial</em></a><em> from Khan Academy.</em></p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/beauty-of-binary-search-tree/"><em>www.dorothy.codes</em></a><em> on June 2, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fa4e11f1611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Variable typing in JavaScript]]></title>
            <link>https://medium.com/dorothy-codes/variable-typing-in-javascript-f8080664a203?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8080664a203</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Fri, 13 May 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-05-24T22:13:36.034Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>What’s the difference between strong and weak typing, and static and dynamic typing, and how does this play out in JS?</em></strong></p><p>Up until now, I’ve had a vague notion that variable typing is different in JavaScript versus C++. It’s time to turn that vague understanding into something more concrete!</p><h3>Strong vs. weak typing</h3><p>I always understood JavaScript to be a “loosely typed” language — — in other words, you could define a variable early in your code, but later in that same scope, reassign data of a different type to that same variable (accidentally or on purpose), and the compiler will not generate an error:</p><pre>var x = 10; <br>console.log(x); <br>x = &quot;Hello&quot;; <br>console.log(x);</pre><p>It seems like “strong vs weak” describes side effects of either static typing or dynamic typing, so let’s explore what those mean.</p><h3>Static vs. dynamic typing</h3><p>I find it helpful to rephrase these as “static type checking” and “dynamic type checking,” since it implies some sort of validation that the compiler is doing.</p><ul><li>For <em>statically typed languages</em>, type checking happens at <em>compile time</em>.</li><li>For <em>dynamically typed languages</em> (scripts), type checking happens at <em>run time</em>.</li></ul><p>In other words, if you mess up the data types of your variables in a statically typed language, you’ll see an error at compile time and won’t even get to run your program.</p><p>In JavaScript, by contrast, since compiling happens right at run time, you’ll see errors at execution.</p><h3>Implicit type casting / type conversion</h3><p>At run time, the JS compiler will make some “best guesses” about how to convert data types if you mix them in a single expression or operation.</p><p>This can lead to some unexpected consequences: for example, if you try to “add” ann integer to a string, the integer will be cast into a string for the purposes of that operation, and you will end up with concatenation rather than addition:</p><pre>var x = 4; <br>var y = &quot;3&quot;; <br>console.log(x+y)</pre><p>But it will convert a string into an integer if you try to do multiplication:</p><pre>var a = &quot;7&quot;; <br>var b = 5; <br>console.log(a*b);</pre><p>There can also be confusion if you try to use the double equals sign comparison operator to compare two variables of different types. Here are <a href="http://es5.github.io/#x11.9.3">the rules, for reference</a>.</p><p>Bottom line, it seems that JavaScript’s loose/dynamic type checking can be convenient while you’re writing a program, but can lead to confusion later on.</p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/variable-typing/"><em>www.dorothy.codes</em></a><em> on May 13, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8080664a203" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/variable-typing-in-javascript-f8080664a203">Variable typing in JavaScript</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adventures with Metalsmith]]></title>
            <link>https://medium.com/dorothy-codes/adventures-with-metalsmith-a0d5e1f4f89b?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0d5e1f4f89b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Mon, 25 Apr 2016 00:12:03 GMT</pubDate>
            <atom:updated>2017-06-04T17:10:09.303Z</atom:updated>
            <content:encoded><![CDATA[<p><em>My first time using a static site generator</em></p><p>On the advice of a <a href="https://natelandau.com/how-to-stay-current-in-web-technology/">wise and experienced friend</a>, I started looking into static site generators. I wanted to create a new portfolio site to retire my old Drupal-based portfolio, and integrate it with my blog, which I was ready to move off of Tumblr.</p><p>Having used Drupal for several years, I was both puzzled and intrigued by this concept. What — no database to store our content?? How will we be able to separate our content into semantically appropriate chunks that can later be reassembled? Are there any security risks? Does this provide benefits performance-wise?</p><p>In the end, I decided to go this route mainly because I couldn’t face creating a DB seed file with my old blog posts.</p><p>A static site generator that reads both markdown and HTML seemed like an efficient way to go — just export my old posts as CSVs, cut them into separate files, and — abracadabra — new site!</p><p>I was attracted to Metalsmith because it runs on NodeJS and seems friendly to JS developers. Just having completed full-stack JavaScript bootcamp, I figured there wouldn’t be too much of a learning curve.</p><h3>The good stuff</h3><p>After having used Metalsmith for a few days, I’m very happy with the following:</p><ul><li>It’s easy to write posts in markdown. What a relief not to have to use a WYSIWYG editor!</li><li>The re-build process is quick.</li><li>I don’t have to worry about cluttering up a database with test entries, re-seeding the database, tinkering with schemas, etc.</li><li>Working with flat files to store content is a breeze because it’s so easy to see your content right in your text or code editor.</li></ul><h3>Rough patches</h3><p>I did hit a few awkward moments while getting up and running:</p><h3>1. Build files output as .html</h3><p>I was a little taken aback at first to see build files being output with an .html extension. Fortunately, you can get around this using the metalsmith-permalinks plugin</p><h3>2. Documentation</h3><p>I would love to help the author(s) add a bit more documentation. Metalsmith is billed as “simple”, but the labyrinth of Readme files and links on GitHub are a bit of a puzzle. As an intermediate developer, I learn best by looking at completed examples, rather than by trying to assemble a bunch of disconnected code snippets on multiple pages. Some of the linked blog entries are super helpful, but ideally this should be contained in the core documentation.</p><h3>3. Collections and their logic</h3><p>This was probably my biggest stumbling block before I could get up and running. To create a collection, you can either either add a field in the front-matter for each .md file, or group files into collections based on their filepath.</p><p>My advice: think through all of the ‘groupings’ you want to have on your site before organizing your files into directories.</p><p>For instance, if you want group files into collections by filepath, and have one page showing all articles, one subpage for blog posts, and one subpage for projects, you could nest folders as follows:</p><pre>- articles<br> -- blog posts<br>  --- post1.md<br>  --- post2.md<br>  --- post3.md<br> -- projects<br>  --- project1.md<br>  --- project2.md<br>  --- project3.md</pre><p>I wasn’t able to figure out how to display all blog posts at /blog while maintaining individual blog URLs at /blog/post1, so I ended up creating &#39;collection&#39; pages as follows:</p><pre>- articles<br> -- [all article content under here]<br>- all-blog-entries<br>- all-projects</pre><p>I’m guessing there may be way to do this through a combination of the metalsmith-collections and metalsmith-permalinks modules---just haven&#39;t figured it out yet.</p><h3>More to come</h3><p>I’m just getting started with Metalsmith, and I know I’ve just scratched the surface…. More to come later as I explore!</p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/adventures-in-metalsmith/"><em>www.dorothy.codes</em></a><em> on April 24, 2016. Note: I have since moved dorothy.codes out of Metalsmith — but it was still a fun trip into the world of static site generators.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0d5e1f4f89b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/adventures-with-metalsmith-a0d5e1f4f89b">Adventures with Metalsmith</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A buzzword cheatsheet]]></title>
            <link>https://medium.com/dorothy-codes/a-buzzword-cheatsheet-22c340d53a1b?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/22c340d53a1b</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Mon, 18 Apr 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-05-24T19:08:58.760Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Cliff’s notes for a few terms I wasn’t familiar with</em></strong></p><p>While applying for web developer jobs, I’ve come across a number of terms in job descriptions that are not 100% meaningful to me. Here are this week’s Cliff’s Notes.</p><p><em>Django:</em> an MVC framework for Python. Includes elements like a web server, a template system, an ORM, a caching framework, access to a testing framework, etc.</p><p><em>Elasticsearch:</em> a popular enterprise search engine that uses JSON over HTTP</p><p><em>YAML:</em> a data display format that allows humans to understand the represented data structure based on markup and whitespace. Follows from the need to serialize data — i.e. to represent or translate complex data structures into a format that can be stored by a machine.</p><p><em>Houdini:</em> a CSS specification under development that will allow access to additional stages in the browser rendering process. For example, being able to define new layout modules that can be used with display:, or being able to assign a transition value to properties in addition to elements.</p><p><em>HandlebarsJS:</em> a JavaScript-based templating system for HTML that allows you to store content in an object-like (JSON-like?) format and, through the use of handlebar expressions interspersed with your template HTML, substitute content from that object into your template HTML.</p><p><em>MustacheJS:</em> a minimalist templating system that puts content from values in an object (?) into tags. Emphasis on simplicity and lack of logic — just replaces tags with values.</p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/buzzword-cheatsheet/"><em>www.dorothy.codes</em></a><em> on April 18, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22c340d53a1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/a-buzzword-cheatsheet-22c340d53a1b">A buzzword cheatsheet</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Thoughts on Express]]></title>
            <link>https://medium.com/dorothy-codes/first-thoughts-on-express-65b23f713ebd?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/65b23f713ebd</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Wed, 20 Jan 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-05-24T21:55:20.238Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>What a timesaver!</em></strong></p><p>Today was my first time using Express. We installed it to help run some common Node.js tasks, like listening for GET requests on particular paths. Express makes it so (seemingly) easy!</p><pre>app.get(&#39;/foo&#39;, function(request, response) { response.send(“&lt;p&gt;Here&#39;s the response for foo!&lt;/p&gt;”);<br> })</pre><p>The part that blew my mind, though, was the disassociation between URIs with slashes and file paths.</p><p>Typically, I associate a forward slash with navigation to a ‘true’ subdirectory.</p><p>For instance, www.example/test/foo/index.html would indicate that a file, index.html, is present in parent directory foo, which is present in grandparent directory test.</p><p>But with a platform like Node or Express, paths like those don’t necessarily have an association with file hierarchies!</p><p>You can easily set up a listener for any path that is in fact served by a file at the root of the directory:</p><pre>app.use(&#39;/test/foo&#39;, function(request,response) {<br> response.send(‘You found foo!&#39;);<br> })</pre><p>Seems so simple — I know this is how Drupal operates, but seeing it here really hit home. Paths really don’t seem to have much meaning any more, except perhaps as a visual indicator, or maybe for search.</p><p>Fascinating!</p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/first-thoughts-on-express/"><em>www.dorothy.codes</em></a><em> on January 20, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65b23f713ebd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/first-thoughts-on-express-65b23f713ebd">First Thoughts on Express</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A note on dot notation vs. bracket notation]]></title>
            <link>https://medium.com/dorothy-codes/a-note-on-dot-notation-vs-bracket-notation-957623d19d47?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/957623d19d47</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Wed, 13 Jan 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-05-24T21:52:22.622Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>They’re not interchangeable!</em></strong></p><p>I was under the impression that dot notation and bracket notation were more or less interchangeable when referring to object properties. Turns out that’s not the case when dealing with variables!</p><p>Take this object:</p><pre>var pet = {<br> color: &quot;brown&quot;,<br> type: &quot;rabbit&quot;,<br> name: &quot;Peter&quot;,<br> age: 2 <br>}</pre><p>Now suppose you’d like to print the key-value pairs. Using dot notation won’t work as expected:</p><pre>for(var key in pet) {<br> console.log(key,&quot;:&quot;,pet.key); <br>}</pre><p>Here, pet.key is undefined.</p><p>In the above example, .key is interpreted to be the actual name of the key (rather than a variable to be substituted out for the actual key label).</p><p>In contrast, the following way will return the expected output:</p><pre>for(var key in pet) {<br> console.log(key,&quot;:&quot;,pet[key]); <br>}</pre><p>In other words, pet.key is interpreted to have the same meaning as pet[&#39;key&#39;].</p><p>Very helpful!</p><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/dot-notation-vs-bracket-notation/"><em>www.dorothy.codes</em></a><em> on January 13, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=957623d19d47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/a-note-on-dot-notation-vs-bracket-notation-957623d19d47">A note on dot notation vs. bracket notation</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thoughts on Array.prototype.reduce()]]></title>
            <link>https://medium.com/dorothy-codes/thoughts-on-array-prototype-reduce-b20671e38cb1?source=rss-60501d9ecf88------2</link>
            <guid isPermaLink="false">https://medium.com/p/b20671e38cb1</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dorothy M]]></dc:creator>
            <pubDate>Sun, 10 Jan 2016 17:00:00 GMT</pubDate>
            <atom:updated>2017-05-24T18:18:50.030Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Parsing the meanings of “current” and “previous”</em></strong></p><p>The reduce method of Javascript arrays has been a bit of a sore point for me, but I finally realized today that it’s partially a nomenclature problem: I was mixing up the meanings of “current” and “previous”.</p><p>To me, “previous value” and “current value” are misnomers. “Previous value” seems to indicate ‘the element at the previous index’. But it’s not — it actually refers to the result of the previous operation. To me, a better way to describe this concept would be accumulator, running tally, or subtotal.</p><p>Conversely, “current value” to me seems to imply a running tally. But it’s not — it’s just the value at the current index (i.e. arr[i] where i is the current index in array arr).</p><p>To think about this sequentially in an array of four elements:</p><ul><li>‘Zeroth’ iteration: Previous value comes from second parameter of reduce function, if present. Current value is the value at the current index (i = 0)</li><li>First iteration: Previous value is the result of the operation in the zeroth iteration. Current value is the value at the current index (i = 1)</li><li>Second iteration: Previous value is the result from the first iteration. Current value is the value at the current index (i = 2)</li><li>Third iteration: Previous value is the result from the second iteration. Current value is the value at the current index (i = 3)</li></ul><p>I made the sketch below to try to solidify this concept. Now I just have to remind myself to stop looking at the wording in the MDN docs…. :-)</p><h3>My cheat sheet for Array.prototype.reduce()</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*bgzUcnNMa4quT0Mj.png" /></figure><p><em>Originally published at </em><a href="http://www.dorothy.codes/content/blog/array-prototype-reduce/"><em>www.dorothy.codes</em></a><em> on January 10, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b20671e38cb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dorothy-codes/thoughts-on-array-prototype-reduce-b20671e38cb1">Thoughts on Array.prototype.reduce()</a> was originally published in <a href="https://medium.com/dorothy-codes">Dorothy Codes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>