<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Scribbles &amp; Bits</title>
  
  
  <link href="/blog/atom.xml" rel="self"/>
  
  <link href="http://derek.io/blog/"/>
  <updated>2019-09-26T18:01:48.999Z</updated>
  <id>http://derek.io/blog/</id>
  
  <author>
    <name>Derek Gathright</name>
    
  </author>
  
  <generator uri="http://hexo.io/">Hexo</generator>
  
  <entry>
    <title>YUI Benchmark</title>
    <link href="http://derek.io/blog/2013/yui-benchmark/"/>
    <id>http://derek.io/blog/2013/yui-benchmark/</id>
    <published>2013-11-25T08:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p><img src="https://i.imgur.com/NMX7BG0.jpg" alt="speedometer"></p><p><a href="https://github.com/derek/yui-benchmark" target="_blank" rel="noopener">YUI Benchmark</a> is a new toolkit for JavaScript performance testing. Despite “YUI” being in the name, it can be used for any type of JavaScript application, including vanilla JS, YUI, Dojo, jQuery, Node.js, and anything else you can think of. The project was something I was working on at Yahoo to help with YUI’s CI performance testing needs, and since its quiet open-sourcing a few weeks ago, I’ve <a href="http://derek.io/blog/2013/on-leaving-yahoo/">had some time</a> to clean it up, fix bugs, and introduce some new functionality.</p><p>Before we get into what it is, let’s first look at why it is useful.</p><a id="more"></a><h2 id="Prelude"><a href="#Prelude" class="headerlink" title="Prelude"></a>Prelude</h2><p>I believe the current state of JavaScript performance testing is a little inadequate. While there are certainly some developers who use tools like <a href="https://code.google.com/p/jslitmus/" target="_blank" rel="noopener">JSLitmus</a>, [Benchmark.js])<a href="http://benchmarkjs.com/)" target="_blank" rel="noopener">http://benchmarkjs.com/)</a>, or manual profiling to gather performance metrics, most don’t actively test performance of their code. Instead, most developers write performant code to the best of their ability and call it a day. I don’t think this is due to lack of interest in the idea. Rather, I just think it is due to a lack of flexible and easy-to-use tools. For instance, <a href="http://jsperf.com/" target="_blank" rel="noopener">JSPerf.com</a> is awesome at what it does, but due to it being web-only, its usefulness is a bit limited. What about developers who want the ease of JSPerf, but want something command-line driven? Perhaps in a CI environment? Benchmark.js is handy, but it requires lots of boiler-plate for browser-testing as well as a custom test runner for integration into CI. Shouldn’t this be easier?</p><p>We went through this before. If you look back 5+ years, few JavaScript developers were unit testing their JavaScript code. Even some of the popular JS libraries weren’t shipping fully tested code. We first started with <a href="http://jsunit.berlios.de" target="_blank" rel="noopener">JsUnit</a>, then came <a href="http://yuilibrary.com/yui/docs/test/" target="_blank" rel="noopener">YUI Test</a>, <a href="http://qunitjs.com/" target="_blank" rel="noopener">QUnit</a>, <a href="http://pivotal.github.io/jasmine/" target="_blank" rel="noopener">Jasmine</a>, <a href="http://visionmedia.github.io/mocha/" target="_blank" rel="noopener">Mocha</a>, <a href="http://vowsjs.org/" target="_blank" rel="noopener">Vows</a>, and a variety of others. As the number of available tools grew, so did our acceptance of the idea that our code needed to be rock-solid stable. Now, often times the only way to deploy code is through <a href="http://en.wikipedia.org/wiki/Continuous_integration" target="_blank" rel="noopener">continuous integration</a> systems (such as <a href="http://jenkins-ci.org/" target="_blank" rel="noopener">Jenkins</a>, <a href="https://travis-ci.org/" target="_blank" rel="noopener">Travis CI</a>) that run your code through a gauntlet of unit tests. Heck, a few weeks ago I was talking to a fellow developer and he said <em>“Know when code can be considered ‘legacy’? When it isn’t unit tested.”</em></p><p>Our priorities, expectations, and workflows have changed since 2008. So with JavaScript unit testing now a mostly solved problem, I think we can now turn our attention to the problem of performance testing. If this field is of interest to you, here’s a tool that can probably help you out.</p><h2 id="What-is-YUI-Benchmark"><a href="#What-is-YUI-Benchmark" class="headerlink" title="What is YUI Benchmark?"></a>What is YUI Benchmark?</h2><p>Think of YUI Benchmark as the glue that combines <a href="http://nodejs.org/" target="_blank" rel="noopener">Node.js</a>, <a href="http://benchmarkjs.com/" target="_blank" rel="noopener">Benchmark.js</a>, <a href="http://phantomjs.org/" target="_blank" rel="noopener">Phantom.js</a>, <a href="http://yeti.cx/" target="_blank" rel="noopener">Yeti</a>, and was designed around the workflow of YUI developers and CI testing environments. To dive in a bit more, it is a Node.js application that utilizes Benchmark.js to measure performance of a given function in various environments, including Node.js and web browsers.</p><p>Here’s a quick demo executing <a href="https://github.com/derek/yui-benchmark/blob/master/examples/vanilla.js" target="_blank" rel="noopener">this simple test</a>.</p><pre><code>// vanilla.js - A test suite to compare array creationvar suite = new PerfSuite({    name: &apos;Simple test&apos;,    tests: [        {            name: &apos;new Array()&apos;,            fn: function () {                var arr = new Array();            }        },        {            name: &apos;[]&apos;,            fn: function () {                var arr = [];            }        }    ]});</code></pre><p><img src="http://i.imgur.com/ZI941MA.gif" alt="YUI Benchmark demo"></p><p>The idea is that you provide simple performance tests (<a href="https://github.com/derek/yui-benchmark/blob/master/examples/" target="_blank" rel="noopener">examples</a>), which contain only the code you want to test performance for, and you get to forget all the boiler-plate code. YUI Benchmark will read your test file, then compile it to either a <code>.html</code> file (for browser testing) or a <code>.js</code> file (for Node.js testing), execute it in the environment(s) of your choice, then dump the human readable results to the command-line or a raw JSON file. Flexible, and simple.</p><p>Bonus features include the ability to test in multiple browsers at the same time (thanks Yeti!), as well as multi-version testing for development on the YUI project. In addition to built-in support for YUI, it also offers the ability to test jQuery and Dojo as well. Here’s <a href="https://github.com/derek/yui-benchmark/blob/master/examples/yui-jquery-dojo.js" target="_blank" rel="noopener">an example</a> of that.</p><p>So that’s the quick intro. I could go into more details here, but it would be duplicating much of the details and demos that can be currently found in the <a href="https://github.com/derek/yui-benchmark/blob/master/README.md" target="_blank" rel="noopener">README</a>. So go check that out for more information on the project and details on how to get started. <em>(Hint: <code>npm install -g yui-benchmark</code>)</em></p><h2 id="Roadmap"><a href="#Roadmap" class="headerlink" title="Roadmap"></a>Roadmap</h2><p>YUI Benchmark is still a young project and has only been used in YUI’s CI system as well as a few select developers. While the feedback so far has been great, there’s probably still some rough edges to iron out. So aside from improving stability and usability, I’d love to eventually add some features to the project so it can realize it’s full potential. Here’s a few ideas…</p><ul><li><p><strong>Generalize multi-version testing for all projects, not just YUI</strong>. Multi-version support is valuable in performance testing because duplicating testing conditions for comparative analysis when results are gathered sometimes months apart, is not ideal. It’s often times far easier to execute tests against select versions of your code in the same test run and compare your results.</p></li><li><p><strong>Machine state intelligence</strong>. I believe this is the most exciting aspect of an application like this. With the possibility of YUI Benchmark code executing in the client and server <em>while</em> your performance tests are executing, insight can be gathered about the state of your machine and factored into test results. Did your CPU max during testing? Are you swapping memory? Are your objects leaking? Any of these problems could be detected to inform the user that the results are less than ideal.</p></li><li><p><strong>Phantom.js cluster support</strong>. Currently tests are run serially, one after another, after another, after another. If your project is like YUI, you can have dozens of tests suites containing hundreds of test cases, and at approx 6 seconds per test, this pretty quickly fails to scale. One solution could be to farm out the test files to phantom.js clusters on low-powered VMs so the tests could be run synchronously. Important to note that while <em>performance</em> testing on low-powered VMs seems counter-intuitive, it’s important to realize that this type of testing is comparative, not discrete. The key metric you are looking for <strong>is not</strong> how many operations per second your code ran, instead, it is how much faster it ran than your other result.  Also, I’d target “low-powered VMs” because that is commonly what you get in CI environments.</p></li><li><p><strong>Introduce threshold support to trigger regression/failure in CI</strong>. Currently multi-version results require manual analysis to determine if your code is regressing. It isn’t possible to always trigger a failure if your test is running slower due to the fact that swings of +/- 5% are not uncommon. My suspicion is this will require the introduction of a threshold to accommodate highly variable tests. In the future, more intelligence can be used to compare against historical deltas and automate the process of determining the regression threshold value.<br><li><strong>More intelligent analysis of gathered statistics</strong>. Any performance testing toolkit should provide accurate and detailed statistics so the developer can make the most informed decision for appropriate fixes. Currently, YUI Benchmark simply relays the statistics Benchmark.js calculates, but greater analysis can be done with multiple <code>–iterations</code> to expunge outliers and re-execute the suite.</li></p></li><li><p>And more!</p></li></ul><p>Thanks for reading, and I look forward to your <a href="https://github.com/derek/yui-benchmark/issues" target="_blank" rel="noopener">feedback</a> and <a href="https://github.com/derek/yui-benchmark/pulls" target="_blank" rel="noopener">contributions</a>!</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://i.imgur.com/NMX7BG0.jpg&quot; alt=&quot;speedometer&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/derek/yui-benchmark&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;YUI Benchmark&lt;/a&gt; is a new toolkit for JavaScript performance testing. Despite “YUI” being in the name, it can be used for any type of JavaScript application, including vanilla JS, YUI, Dojo, jQuery, Node.js, and anything else you can think of. The project was something I was working on at Yahoo to help with YUI’s CI performance testing needs, and since its quiet open-sourcing a few weeks ago, I’ve &lt;a href=&quot;http://derek.io/blog/2013/on-leaving-yahoo/&quot;&gt;had some time&lt;/a&gt; to clean it up, fix bugs, and introduce some new functionality.&lt;/p&gt;
&lt;p&gt;Before we get into what it is, let’s first look at why it is useful.&lt;/p&gt;
    
    </summary>
    
      <category term="Projects" scheme="http://derek.io/blog/categories/Projects/"/>
    
    
      <category term="javascript" scheme="http://derek.io/blog/tags/javascript/"/>
    
      <category term="perfmatters" scheme="http://derek.io/blog/tags/perfmatters/"/>
    
      <category term="performance" scheme="http://derek.io/blog/tags/performance/"/>
    
      <category term="testing" scheme="http://derek.io/blog/tags/testing/"/>
    
  </entry>
  
  <entry>
    <title>Leaving Yahoo</title>
    <link href="http://derek.io/blog/2013/leaving-yahoo/"/>
    <id>http://derek.io/blog/2013/leaving-yahoo/</id>
    <published>2013-11-07T08:00:00.000Z</published>
    <updated>2019-09-26T18:01:49.001Z</updated>
    
    <content type="html"><![CDATA[<p>A week ago I walked out of Building E for the last time. There are a lot of emotions as I reflect back on everything that has happened over the last 4 years <a href="http://derek.io/blog/2009/im-a-yahoo">since I joined</a>, the jubilant successes, the lesson-learning failures, and everything in between. I have to think that in the end, it will likely go down as one of the more fun and rewarding periods of my life.</p><a id="more"></a><h2 id="Some-highlights"><a href="#Some-highlights" class="headerlink" title="Some highlights"></a>Some highlights</h2><ul><li><p>Attending, speaking, and mentoring hackers at dozens of conferences and events. The YDN crew is world-class, and despite all the free food and nice benefits, working with them is one of the best perks of being an engineer at Yahoo. At least I think so. Special thanks to Anil, Havi, and Stacy for all their support at Hackdays, and helping organize SoCal meetups.</p></li><li><p>I feel fortunate to have been around for the beginning stages of what everyone hopes will be Yahoo’s “big turnaround”. We probably won’t know for another 2 or 3 years if it will ultimately succeed, but the changes made in the first 18 months have been exciting to witness. While I don’t envision myself taking over a struggling Fortune 500 company anytime soon, learning some lessons for what it takes to turn that ship around been invaluable. Communicate, set goals, accomplish, repeat. Simple, right? We’ll find out.</p></li><li><p>I also feel fortunate to have had the unique opportunity to work on <a href="http://yuilibrary.com/" target="_blank" rel="noopener">a project</a> that reaches, what… 1/7th of the Earth’s population in a given month? Kinda mindblowing when you think about it. And to top it off, you get to do it while working with a really talented and passionate group of people.</p></li><li><p>It was especially great being able to see the internals of how to effectively manage a large open-source project. Since YUI is on a never-ending quest to open up as much as possible, looking back on where it was in 2009 compared to now is pretty remarkable. Some of that praise should of course be given to Github, for producing such an amazing product for open-source organizations and letting developers focus on developing. The entire culture around open-source has evolved greatly in the last few years, and I think YUI has responded remarkably well.</p></li><li><p>Hacks! Especially ones with YQL. Between things like the <a href="https://github.com/yahoo/yql-executor" target="_blank" rel="noopener">YQL Executor</a>, <a href="http://derek.io/blog/2010/how-to-secure-oauth-in-javascript/">Secure OAuth in JavaScript</a>, hacking YUI inside of YQL, SoCal Hackdays, Hacker Movie Nights, late-night scripting competitions with Dan Beam, and my projects from internal Hackdays. I couldn’t tell you if Paul Graham was right about Yahoo’s <a href="http://www.paulgraham.com/yahoo.html" target="_blank" rel="noopener">dead hacker culture</a> in 1998, but it certainly doesn’t apply in 2013. As one of my hack-discuss memos once said, “Let a thousand hacks bloom!”</p></li><li><p>The Purple Kitten Tracker. One of these days, purple kittens will make an appearance in URLs, and it will be glorious.</p></li><li><p>Y! Sports Karaoke.</p></li><li><p>But most of all, the biggest highlight was simply setting a career goal, <a href="http://derek.io/blog/2010/return-to-sunnyvale">accomplishing it</a>, then <a href="http://derek.io/blog/2011/joining-yui">again</a>.</p></li></ul><h2 id="To-conclude"><a href="#To-conclude" class="headerlink" title="To conclude"></a>To conclude</h2><p>It was a pleasure to work with so many smart and passionate people, which was the entire reason <a href="http://derek.io/blog/2011/the-best-career-advice-youll-ever-get">why I joined Yahoo</a>. If you are the smartest person in the room and not the CEO, go find a smarter room. If you are working for a company that doesn’t believe in you, it’s time for a change. Ultimately, your career is about you, and the best way to succeed is to have the support of a company that can help you reach your goals. Yahoo gave me an immense amount of support over the years, and I’ll always be grateful. So thanks to my managers Michael, Dan, Thomas, and Jenny.</p><h2 id="What’s-Next"><a href="#What’s-Next" class="headerlink" title="What’s Next?"></a>What’s Next?</h2><p>Believe it or not, in my four years at Yahoo I only took one vacation. So, I’m going to spend a few months off, Hawaii next week, travel more after that, hack on new projects, contribute to open-source, and eventually find my next adventure! If you are interested in speaking to me about opportunities, you can <a href="http://www.linkedin.com/in/derekgathright" target="_blank" rel="noopener">connect with me on LinkedIn</a>, and find any other relevant links at <a href="http://derek.io/">derek.io</a>.</p><p>Well Yahoo… So long, and thanks for all the fish!</p><p><img src="http://i.imgur.com/rJVteIv.jpg" alt="ride off into sunset"></p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;A week ago I walked out of Building E for the last time. There are a lot of emotions as I reflect back on everything that has happened over the last 4 years &lt;a href=&quot;http://derek.io/blog/2009/im-a-yahoo&quot;&gt;since I joined&lt;/a&gt;, the jubilant successes, the lesson-learning failures, and everything in between. I have to think that in the end, it will likely go down as one of the more fun and rewarding periods of my life.&lt;/p&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
    
      <category term="Yahoo" scheme="http://derek.io/blog/tags/Yahoo/"/>
    
  </entry>
  
  <entry>
    <title>Velocity 2013 - Building a Faster and Stronger Web</title>
    <link href="http://derek.io/blog/2013/velocity-2013-building-a-faster-and-stronger-web/"/>
    <id>http://derek.io/blog/2013/velocity-2013-building-a-faster-and-stronger-web/</id>
    <published>2013-07-16T07:00:00.000Z</published>
    <updated>2019-09-26T20:13:18.581Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://farm8.staticflickr.com/7411/9083212144_c916b6f5e1.jpg" alt="Velocity 2013">(<a href="http://www.flickr.com/photos/oreillyconf/9083212144/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p>If there’s one thing we’ve learned in 20+ years of building Web sites, it’s that performance matters. Browsers need to fetch, parse, and render pages quicker. JavaScript needs to execute faster, HTTP servers need to generate and serve content more efficiently, and caching layers need to be more pervasive. All in effort to make the browsing experience more enjoyable for the user so they browse, click, engage, and buy more. The effect performance has on the bottom-line has been <a href="http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/" target="_blank" rel="noopener">very</a> <a href="http://www.codinghorror.com/blog/2011/06/performance-is-a-feature.html" target="_blank" rel="noopener">well</a> <a href="http://www.fastcompany.com/1825005/how-one-second-could-cost-amazon-16-billion-sales" target="_blank" rel="noopener">documented</a> over the years, and the interest in “fast” is doing anything but slowing down.</p><a id="more"></a><p>So every year, the industry’s experts on speed gather at the Santa Clara Convention Center for <a href="http://velocityconf.com/" target="_blank" rel="noopener">Velocity</a>, a conference all about Web performance and operations. Myself, along with other members of the <a href="http://yuilibrary.com/" target="_blank" rel="noopener">YUI</a> and <a href="http://developer.yahoo.com/cocktails/mojito/" target="_blank" rel="noopener">Mojito</a> teams were fortunate to be on hand again this year to discuss our experiences and learn from others. It was an insightful and inspirational 3 days, and in this post I’ll recap and share some of what we learned with you.</p><h2 id="Day-0"><a href="#Day-0" class="headerlink" title="Day 0"></a>Day 0</h2><p><img src="http://i.imgur.com/mgNjVBZl.jpg" alt="Steve Souders"><br>(Steve Souders | <a href="http://www.youtube.com/watch?v=bGYgFYG2Ccw" target="_blank" rel="noopener">“The Illusion of Speed”</a>)</p><p>The first day of Velocity-related events consisted of workshops and short <a href="http://igniteshow.com/" target="_blank" rel="noopener">Ignite</a> talks, some of which you can find on O’Reilly’s <a href="http://www.youtube.com/playlist?list=PL055Epbe6d5b1ymaQ6cgUW5q6cmoX-eMM" target="_blank" rel="noopener">Ignite Velocity YouTube playlist</a>.</p><p>One particular talk to highlight is <a href="https://twitter.com/souders" target="_blank" rel="noopener">Steve Souders</a>‘ <strong>“The Illusion of Speed”</strong>, which was especially eye-opening on the importance of speed, or rather the importance of <strong>perceived</strong> speed. <em>“As much as I love data and metrics, that’s the tail wagging the dog. The real thing we’re after is to create an experience that people love and they feel is fast. We might be front-end engineers, we might be devs, we might be ops, but what we really are, is perception brokers.”</em> In other words, the winner is the experience that makes users the happiest, not necessarily the fastest. Often those are correlated, but not always. Checkout out the <a href="http://www.youtube.com/watch?v=bGYgFYG2Ccw" target="_blank" rel="noopener">video of his talk</a> to learn why.</p><h2 id="Day-1"><a href="#Day-1" class="headerlink" title="Day 1"></a>Day 1</h2><h3 id="Johan-Bergstrom-Lund-University"><a href="#Johan-Bergstrom-Lund-University" class="headerlink" title="Johan Bergström - Lund University"></a>Johan Bergström - Lund University</h3><p><img src="http://farm6.staticflickr.com/5492/9089461244_e203a8826d.jpg" alt="Johan Bergström">(Johan Bergström | <a href="http://www.flickr.com/photos/oreillyconf/9089461244/sizes/m/in/photostream/" target="_blank" rel="noopener">photo credit</a>)</p><p>Velocity Conference 2013 kicked off with <a href="https://twitter.com/bergstrom_johan" target="_blank" rel="noopener">Johan Bergström</a>‘s <a href="http://prezi.com/m4y8-5e5lvio/what-where-and-when-is-risk-in-system-design/" target="_blank" rel="noopener">presentation</a> about risk management. Bergström is an Associate Professor at Lund University, and while he isn’t an expert on anything Web-related, he is an expert in the field of <a href="http://www.journals.elsevier.com/safety-science/" target="_blank" rel="noopener">safety science</a>. He was brought to Velocity to enhance and enlighten our understanding of risk factors in linear and relational systems and provide us with tips to minimize incidents that can lead to errors and downtime in our Web applications.</p><p>The main takeaway I got from his 25-minute keynote (which is <a href="http://www.youtube.com/watch?v=Pb_zYs8G6Co" target="_blank" rel="noopener">available on YouTube</a>) was that <strong>safety is just an illusion and no systems are actually safe, they are just made less unreliable</strong>. Since risk is never truly gone, you should never ignore its presence and continually discuss it amongst your team.</p><p>I believe that final point is an important one. Often times we don’t acknowledge risk until something actually fails, and much more can be done to minimize the damages if more proactive steps are taken to account for inevitable failures. Proactive vs reactive.</p><h3 id="Kyle-Rush-Obama-for-America"><a href="#Kyle-Rush-Obama-for-America" class="headerlink" title="Kyle Rush - Obama for America"></a>Kyle Rush - Obama for America</h3><p><img src="http://farm4.staticflickr.com/3688/9087245477_1bf0a2f890.jpg" alt="Kyle Rush">(Kyle Rush | <a href="http://www.flickr.com/photos/oreillyconf/9087245477/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p>The opening day keynotes continued with other presentations by industry experts, including <a href="https://twitter.com/kylerush" target="_blank" rel="noopener">Kyle Rush</a>‘s excellent talk <strong>“Meet the Obama Campaign’s $250 Million Fundraising Platform”</strong>. Rush’s keynote was based off a <a href="http://kylerush.net/blog/meet-the-obama-campaigns-250-million-fundraising-platform/" target="_blank" rel="noopener">blog post</a> he wrote last year. It recapped the donation platform his team built during 2011 and 2012 when he served as Director of Front-end Development at Obama for America.</p><p>When Rush joined the campaign he inherited a slow, error-prone Web application. He rebuilt it using a variety of techniques and tools focused on front-end performance, such as serving static sites (built with <a href="http://jekyllrb.com/" target="_blank" rel="noopener">Jekyll</a>), <a href="https://www.optimizely.com/" target="_blank" rel="noopener">optimize.ly</a>, <a href="http://www.webpagetest.org/" target="_blank" rel="noopener">WebPageTest</a>, and utilizing JavaScript to off-load as much as possible to the browser. The result was a 60% faster TTP metric (time to paint), a 49% increase in donation conversion rate, and a platform that was processing up to $3 million dollars an hour.</p><p>You can find a video of Rush’s talk <a href="http://www.youtube.com/watch?v=FaygFGhex_4" target="_blank" rel="noopener">here</a>. It’s a worthwhile viewing that can give you some insight into what a high-scale, high-performance front-end web application can look like. Also, the <a href="https://news.ycombinator.com/item?id=4842510" target="_blank" rel="noopener">Hacker News discussion</a> response to his blog post offers some insightful follow-up conversation.</p><h3 id="Arvind-Jain-Google"><a href="#Arvind-Jain-Google" class="headerlink" title="Arvind Jain - Google"></a>Arvind Jain - Google</h3><p>Day 1 keynotes concluded with Google’s <a href="http://www.linkedin.com/pub/arvind-jain/1/516/593" target="_blank" rel="noopener">Arvind Jain</a>, whose talk (<a href="http://www.youtube.com/watch?v=TGuMha46Nh0" target="_blank" rel="noopener">video</a>) was an analysis to answer the question of <strong>“Is the Web Getting Faster?”</strong>. Using data gathered from Akamai, industry studies, browser benchmarks, and the <a href="http://httparchive.org" target="_blank" rel="noopener">HTTP Archive</a>, Jain concluded that no, the Web is not getting faster. While the core infrastructure (networks, browsers, protocols, etc.) are getting faster, the Web is primarily getting richer to take advantage of the extra performance capabilities, which results in a nearly equal slowdown.</p><p><img src="http://i.imgur.com/5nDJSBj.png" alt="takeaways"></p><h3 id="Andrew-Betts-Financial-Times-Labs"><a href="#Andrew-Betts-Financial-Times-Labs" class="headerlink" title="Andrew Betts - Financial Times Labs"></a>Andrew Betts - Financial Times Labs</h3><p>After a few lightning demos consisting of new products from Akamai, AT&amp;T, and Appurify, the first day’s sessions kicked off. The first one I attended was a talk by <a href="https://twitter.com/triblondon" target="_blank" rel="noopener">Andrew Betts</a>, a software engineer at <a href="http://labs.ft.com/" target="_blank" rel="noopener">Financial Times Labs</a> who spoke on the topic of making Web applications as performant as native apps. In his talk <strong>“Escaping the Uncanny Valley”</strong>, Betts focused on the challenges his team faced when building the <a href="http://labs.ft.com/2011/06/ft-launches-first-major-html5-mobile-news-app/" target="_blank" rel="noopener">Financial Times HTML5 Web app</a> and how to properly avoid the “<a href="http://en.wikipedia.org/wiki/Uncanny_valley" target="_blank" rel="noopener">uncanny valley</a>“ (the point where a Web app tries to be too similar to a native app, but falls short and appears as a clunky, cheap imitation).</p><p><img src="http://farm4.staticflickr.com/3794/9087251919_9559c9aba8.jpg" alt="Andrew Betts">(Andrew Betts | <a href="http://www.flickr.com/photos/oreillyconf/9087251919/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p>Some of Betts’ key points:</p><ul><li>Ensure smooth scrolling with sub-16ms frame rates</li><li>Ensure any UI pauses are sub-100ms</li><li>Intelligently use CSS selectors</li><li>Don’t use flexbox!</li><li>Disable hover effects</li><li>Intelligent use of local storage technologies</li><li>Cache, cache, cache</li><li>Text re-encoding (see: <a href="http://labs.ft.com/2012/06/text-re-encoding-for-optimising-storage-capacity-in-the-browser/" target="_blank" rel="noopener">FT Labs blog post</a>)</li><li>XHR batching</li><li><a href="http://labs.ft.com/articles/ft-fastclick/" target="_blank" rel="noopener">Fast Click</a></li><li>Always provide UI response feedback</li></ul><p>I recommend a review of <a href="https://speakerdeck.com/triblondon/escaping-the-uncanny-valley-velocity-2013" target="_blank" rel="noopener">the slides</a> for anyone working on mobile Web applications. In them, you’ll find quite a few priceless nuggets of information in there to help save time investigating performance issues, in addition to tips on preventing any bottlenecks.</p><p><img src="http://i.imgur.com/SHupm8e.png" alt="data storage technologies"><br>(An overview of storage options)</p><h3 id="Stephen-Woods-Yahoo"><a href="#Stephen-Woods-Yahoo" class="headerlink" title="Stephen Woods - Yahoo"></a>Stephen Woods - Yahoo</h3><p><img src="http://farm4.staticflickr.com/3673/9080889933_3f2b183505.jpg" alt="Stephen Woods">(Stephen Woods | <a href="http://www.flickr.com/photos/bluesmoon/9080889933/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p>Following Betts’ talk was another mobile-centric presentation from Yahoo’s <a href="https://twitter.com/ysaw" target="_blank" rel="noopener">Stephen Woods</a>. In Woods’ talk (<a href="https://speakerdeck.com/ysaw/optimizing-javascript-runtime-performance-for-touch-velocity-2013" target="_blank" rel="noopener">slides</a>), he echoed some of the same lessons learned while building new Flickr products that Betts did with the Financial Times app, including ensuring that you achieve the magical &lt;16ms frame rate (which equates to 60FPS), and tips for intelligent caching (e.g., <em>“cache values, not DOM nodes”</em>).</p><p>Main takeaways included:</p><ul><li>Cache data where possible</li><li>Update the UI on user actions, use transforms where possible</li><li>Multitask when you can, with threads and yielding</li></ul><h3 id="Colt-McAnlis-Google"><a href="#Colt-McAnlis-Google" class="headerlink" title="Colt McAnlis - Google"></a>Colt McAnlis - Google</h3><p><img src="http://i.imgur.com/v9ZW9OI.jpg" alt="Colt McAnlis">(Colt McAnlis | <a href="http://seorushnow.com/report-from-velocity-day-2/" target="_blank" rel="noopener">photo credit</a>)</p><p>A little later in the day was an insightful talk from Google’s <a href="https://twitter.com/duhroach" target="_blank" rel="noopener">Colt McAnlis</a> in which he described the inner-workings of Chrome’s rendering engine, harnessing the power of 3D acceleration, and the tools available in Chrome that can help you create more efficient applications.</p><p>The takeaway from this talk was to understand how the rendering process occurs and to design pages with the GPU in mind. As Betts also alluded to in his talk, if you misuse advanced techniques, you can end up in worse shape than where you started. Understand, analyze, then enhance.</p><p>Here’s a <a href="http://cdn.oreillystatic.com/en/assets/1/event/94/The%20CSS%20and%20GPU%20Cheatsheet%20Presentation.pdf" target="_blank" rel="noopener">pdf of his slides</a>.</p><h2 id="Day-2"><a href="#Day-2" class="headerlink" title="Day 2"></a>Day 2</h2><h3 id="Dylan-Richard-Obama-for-America"><a href="#Dylan-Richard-Obama-for-America" class="headerlink" title="Dylan Richard - Obama for America"></a>Dylan Richard - Obama for America</h3><p><img src="http://i.imgur.com/RL1SJh4.png" alt="Dylan Richards">(Dylan Richards | <a href="http://www.youtube.com/watch?v=LCZT_Q3z520" target="_blank" rel="noopener">photo credit</a>)</p><p>Day 2 of Velocity kicked off with an insightful keynote from <a href="https://twitter.com/dylanr" target="_blank" rel="noopener">Dylan Richard</a>, who recently spent 18 months as Director of Engineering at Obama for America. In his devops-centric talk, Richard shared some of his experiences and insights during the time when he was tasked with rebuilding the organization’s technology infrastructure, as well as sharing tips for building resilient systems and teams.</p><p>Richard reminded us that uptime for critical systems is the primary objective, because <em>“No feature is cool enough to not have a working app.”</em> He is also a strong believer that <em>“You can’t learn unless you are simulating real things”</em>, which of course lead into some discussion of <a href="http://en.wikipedia.org/wiki/Destructive_testing" target="_blank" rel="noopener">destructive testing</a>.</p><p>While this talk certainly was more on the operations side of the Velocity spectrum, there are still valuable insights for software engineers of any kind and is worth a viewing. You can find a video of his talk <a href="http://www.youtube.com/watch?v=LCZT_Q3z520" target="_blank" rel="noopener">here</a>.</p><h3 id="Ilya-Grigorik-Google"><a href="#Ilya-Grigorik-Google" class="headerlink" title="Ilya Grigorik - Google"></a>Ilya Grigorik - Google</h3><p><img src="http://farm4.staticflickr.com/3674/9087250187_3ea3ec18ac.jpg" alt="Ilya Grigorik">(Ilya Grigorik | <a href="http://www.flickr.com/photos/oreillyconf/9087250187/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p>During the Lightning Demos portion of Day 2, Google’s <a href="https://twitter.com/igrigorik" target="_blank" rel="noopener">Ilya Grigorik</a> introduced some new tools to help you find answers to Web performance-related questions. Grigorik began his talk (<a href="http://www.youtube.com/watch?v=bhUMHKJf3r4" target="_blank" rel="noopener">video</a>) with Indira Gandhi’s famous quote <em>“The power to question is the basis of all human progress”</em> to emphasize the role curiosity plays in our success as engineers. Grigorik then proceeded to list off various questions many Web developers have such as <em>“Are websites getting faster?”</em>, <em>“What CSS frameworks are the most popular?”</em>, <em>“Is Flash adoption on the decline?”</em>, and more.</p><p>It turns out, these previously difficult questions to answer are now relatively easy thanks to the availability of the <a href="httparchive.org/">HTTP Archive</a> data in Google’s <a href="http://bigquery.cloud.google.com/" target="_blank" rel="noopener">Big Query</a>. If you are familiar with SQL, you can now throw together some simple queries and analyze gigabytes of HTTP data scooped up from a crawl of a million websites. Grigorik goes into more details in his <a href="http://www.igvita.com/2013/06/20/http-archive-bigquery-web-performance-answers/" target="_blank" rel="noopener">blog post</a>.</p><p>So naturally, I became curious on the version breakdown of YUI usage and realized the HTTP Archive can help answer that question for me. After some data crunching I was able to generate this chart:</p><p><img src="http://i.imgur.com/RH214ck.png" alt=""></p><h3 id="Ariya-Hidayat-Sencha"><a href="#Ariya-Hidayat-Sencha" class="headerlink" title="Ariya Hidayat - Sencha"></a>Ariya Hidayat - Sencha</h3><p><img src="http://farm3.staticflickr.com/2828/9089643751_8193588ae3.jpg" alt="Ariya Hidayat">(Ariya Hidayat | <a href="http://www.flickr.com/photos/bluesmoon/9089643751/sizes/m/" target="_blank" rel="noopener">photo credit</a>)</p><p><img src="http://i.imgur.com/UB9hz71l.png" alt="The unix philosophy"><br>(“The Unix Philosophy”)</p><p>One of the more educational talks of Velocity 2013 was <a href="https://twitter.com/ariyahidayat" target="_blank" rel="noopener">Ariya Hidayat</a>‘s <strong>“Emerging JavaScript Tools to Track JavaScript Quality and Performance”</strong>. In this talk (<a href="https://speakerdeck.com/ariya/emerging-language-tools-to-track-javascript-quality-and-performance" target="_blank" rel="noopener">slides</a>), Hidayat began with describing composable tools, <em>“Write something once that does its job very well”</em>, and then presents his favorite JavaScript tools while referencing some topics and tips covered from many of his <a href="http://ariya.ofilabs.com/highlights" target="_blank" rel="noopener">blog posts</a>.</p><p>Some of the JavaScript-related tools mentioned:</p><ul><li><a href="http://phantomjs.org/" target="_blank" rel="noopener">Phantom.js</a> - A headless WebKit scriptable with a JavaScript API</li><li><a href="http://esprima.org/" target="_blank" rel="noopener">Esprima</a> - A high performance, standard-compliant ECMAScript parser</li><li><a href="http://int3.github.io/metajs" target="_blank" rel="noopener">MetaJS</a> - A CPS Javascript metacircular interpreter that visualizes script execution</li><li><a href="http://jscomplexity.org/" target="_blank" rel="noopener">JSComplexity</a> - A <a href="http://jscomplexity.org/complexity" target="_blank" rel="noopener">complexity analysis</a> for JavaScript projects</li><li><a href="http://ariya.ofilabs.com/2013/01/javascript-code-complexity-visualization.html" target="_blank" rel="noopener">Plato</a> - A code complexity visualization tool</li><li><a href="https://github.com/olov/defs/" target="_blank" rel="noopener">Defs.js</a> - An ES6 <code>const</code> and <code>let</code> transpiler to ES3.</li><li><a href="http://gotwarlost.github.io/istanbul/" target="_blank" rel="noopener">Istanbul</a> - A code coverage tool for JavaScript</li></ul><p>Hidayat closed with the following bits of advice:</p><ul><li><em>“Build <strong>composable</strong> tools”</em></li><li><em>“<strong>Automate</strong> any tedious parts of code review”</em></li><li><em>“Incorporate <strong>code quality metrics</strong> into dashboards”</em></li></ul><h3 id="Nicholas-Zakas-Box"><a href="#Nicholas-Zakas-Box" class="headerlink" title="Nicholas Zakas - Box"></a>Nicholas Zakas - Box</h3><p><img src="http://farm8.staticflickr.com/7342/9097359847_800788f5b8.jpg" alt="Nicholas Zakas">(Nicholas Zakas | <a href="http://www.flickr.com/photos/bluesmoon/9097359847/" target="_blank" rel="noopener">photo credit</a>)</p><p>Velocity’s Web Performance track concluded with a talk (<a href="http://www.slideshare.net/nzakas/enough-withthejavascriptalready" target="_blank" rel="noopener">slides</a>) from <a href="https://twitter.com/slicknet" target="_blank" rel="noopener">Nicholas Zakas</a> on the over-reliance of JavaScript. In <strong>“Enough with the JavaScript already”</strong>, his point was that as JavaScript developers, we have the tendency to try to do too many things in JavaScript. As an example of this, Zakas cited the plethora of client-MVW frameworks (Model-View-<em>Whatever</em>) and client-side rendering as JavaScript-gone-too-far. This is something <a href="https://blog.twitter.com/2012/improving-performance-twittercom" target="_blank" rel="noopener">Twitter</a> and <a href="http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-to-product/" target="_blank" rel="noopener">airbnb</a> have realized, which should serve as a reminder to take a step back and rethink things before you try to outsmart a web browser.</p><p>As an example of proper and intelligent use of JavaScript, Zakas pointed to Alex Sexton’s wonderful <a href="http://alexsexton.com/blog/2013/03/deploying-javascript-applications/" target="_blank" rel="noopener">Deploying JavaScript Applications</a> blog post which mentions the idea of listening for mouse movements to trigger loading JS. Consider the fact that you have two types of scripts you typically run on a page, 1) Render/Functionality-critical scripts, and 2) Supplementary functionality scripts. If a script isn’t required for primary functionality of your page, you should defer loading it.</p><p>Speaking of when and where to execute your JavaScript, here’s his categorization of the four suggested locations to place your Javascript:</p><p><img src="http://i.imgur.com/1DjxL6Rl.jpg" alt="The 4 JavaScript Load Times"></p><p>Zakas’ talk concluded with some observations about building and using libraries, arguing that it’s an <a href="http://en.wikipedia.org/wiki/Economies_of_scale" target="_blank" rel="noopener">economy of scale</a> rule, meaning the cost per component decreases the more components you use. So for example, if you are using YUI for only <a href="https://yuilibrary.com/yui/docs/node/" target="_blank" rel="noopener">node</a>, that’s really expensive, and maybe not the best investment. But, if you begin using other YUI components as well, the more you use, the cheaper your investment becomes.</p><p>The takeaway here is that bytes are costly in bandwidth, performance, and maintenance, so scrutinize your decisions when selecting libraries to use. Don’t just blindly invent or throw a new library at the problem.</p><p>You can find some insightful discussion on these slides over on <a href="https://news.ycombinator.com/item?id=6044356" target="_blank" rel="noopener">Hacker News</a>.</p><h2 id="Overall-Takeaways"><a href="#Overall-Takeaways" class="headerlink" title="Overall Takeaways"></a>Overall Takeaways</h2><p>Here are some common themes observed at Velocity 2013:</p><ul><li>Tracking browser metrics in <a href="https://en.wikipedia.org/wiki/Continuous_integration" target="_blank" rel="noopener">CI</a> is becoming popular, both due to availability of <a href="https://developer.mozilla.org/en-US/docs/Navigation_timing" target="_blank" rel="noopener">Navigation Timing APIs</a> and greater awareness of <a href="http://addyosmani.com/blog/devtools-visually-re-engineering-css-for-faster-paint-times/" target="_blank" rel="noopener">paint timings</a>. As Paul Hammond said in <a href="http://www.youtube.com/watch?v=_hE_MtasB2Q" target="_blank" rel="noopener">his Ignite Velocity talk</a>, <em>“If it moves, track it.”</em></li><li>Your software will make mistakes, but it’s difficult to predict what and where. So, focus on making resilient systems that help you detect problems faster to mitigate the damage.</li><li>The point of improving performance is to improve the experience of the end user. They actually don’t care that things are metrically faster, they just like the feeling they get from their perception that things are faster.</li><li>Alex Sexton’s excellent “<a href="http://alexsexton.com/blog/2013/03/deploying-javascript-applications/" target="_blank" rel="noopener">Deploying JavaScript Applications</a>“ blog post, and his follow-up “<a href="http://www.smashingmagazine.com/2013/06/11/front-end-ops/" target="_blank" rel="noopener">Front-End Ops</a>“ seemed to be commonly cited among Velocity talks.</li><li>And finally, when you think you are done with performance, you probably aren’t.</li></ul><p>As a two-time attendee of Velocity, I’m comfortable saying that it continues to be one of the most educational and inspiring events out there today. Tim O’Reilly stated in <a href="http://www.youtube.com/watch?v=9Kn-RrAg9FI" target="_blank" rel="noopener">his 2011 keynote</a>, <em>“You might think you are just helping to run some random site, but you are engaged in an exploration that is central to the future of humanity”</em>, and after learning about all the interesting problems being tackled by Velocitians, I completely agree. So, cheers to the Velocity organizers, presenters, and community, for building a better, faster, stronger Web!</p><p>P.S. You can find all my session notes <a href="https://gist.github.com/derek/5835728" target="_blank" rel="noopener">here</a>. Also, if you are an O’Reilly Safari subscriber, keep an eye out for videos of the 2013 talks. In the meantime, you can view previous years <a href="http://techbus.safaribooksonline.com/video/-/9781449311773" target="_blank" rel="noopener">2011</a> and <a href="http://techbus.safaribooksonline.com/video/-/9781449343927" target="_blank" rel="noopener">2012</a>, as well as finding select videos from 2013 <a href="http://www.youtube.com/playlist?list=PL055Epbe6d5bdB4KPqssegVpYUDJXSzOp" target="_blank" rel="noopener">on YouTube</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7411/9083212144_c916b6f5e1.jpg&quot; alt=&quot;Velocity 2013&quot;&gt;(&lt;a href=&quot;http://www.flickr.com/photos/oreillyconf/9083212144/sizes/m/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;photo credit&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;If there’s one thing we’ve learned in 20+ years of building Web sites, it’s that performance matters. Browsers need to fetch, parse, and render pages quicker. JavaScript needs to execute faster, HTTP servers need to generate and serve content more efficiently, and caching layers need to be more pervasive. All in effort to make the browsing experience more enjoyable for the user so they browse, click, engage, and buy more. The effect performance has on the bottom-line has been &lt;a href=&quot;http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;very&lt;/a&gt; &lt;a href=&quot;http://www.codinghorror.com/blog/2011/06/performance-is-a-feature.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;well&lt;/a&gt; &lt;a href=&quot;http://www.fastcompany.com/1825005/how-one-second-could-cost-amazon-16-billion-sales&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;documented&lt;/a&gt; over the years, and the interest in “fast” is doing anything but slowing down.&lt;/p&gt;
    
    </summary>
    
    
      <category term="javascript" scheme="http://derek.io/blog/tags/javascript/"/>
    
      <category term="perfmatters" scheme="http://derek.io/blog/tags/perfmatters/"/>
    
      <category term="performance" scheme="http://derek.io/blog/tags/performance/"/>
    
  </entry>
  
  <entry>
    <title>The End of the Mashup Era</title>
    <link href="http://derek.io/blog/2012/the-end-of-the-mashup-era/"/>
    <id>http://derek.io/blog/2012/the-end-of-the-mashup-era/</id>
    <published>2012-08-19T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p>Every time Twitter announces some new API initiative that further damages their once great developer community, I always think, <em>“Alright, this is the last time I’ll write about them. I’m done.”</em> But every time, they always find a way to pull me back into the discussion.</p><p><img src="https://media.giphy.com/media/B3nATT4FPkb3G/200.gif" alt=""></p><a id="more"></a><p>However, I’ll actually try and refrain from commenting too much about their <a href="https://dev.twitter.com/blog/changes-coming-to-twitter-api" target="_blank" rel="noopener">recent changes</a>. It’s already been discussed to death, everyone hates it, including me, and frankly, I’m not surprised. It’s just yet <a href="http://derek.io/blog/2010/my-birthday-gift-to-twitter-i-quit/">another</a> <a href="http://derek.io/blog/2011/some-thoughts-on-twitter-vs-ecosystem/">move</a> to close off and control their once free, open, and awesome API. But whatever, they can do what they like.</p><p>The reason it did prompt me to begin thinking about the topic though, is the larger significance of the announcement.  Twitter’s move is just one more instance of yet another company turning its back on the developer community.  But more importantly though, it’s a move that made me realize something… the mashup era is over.</p><p>Let’s rewind back to 2004.  Google was still a private company, Yahoo was best known as a search engine, Facebook was still running on a computer in a Harvard dorm room, and most important to this story, Microsoft thought the Web had reached its pinnacle.  They won the “browser wars”, Internet Explorer had a 92% market share and Netscape was dead, so (as rumor has it) they disbanded the IE team.  Subsequently, innovation on the Web stalled.  It was a dark time as very little work was being done (successfully) to evolve the Web’s core technologies (browsers, HTML, CSS, JavaScript).  The Web, as an application platform, had failed.</p><p>Well, that’s what everyone thought.  At least until Google released two very important products that proved to everyone that there was still a lot that can be done with the Web.  Those being GMail (2004), which popularized Ajax, and Maps (2005), which unintentionally led to the invention of the mashup and contributed to the rise of “Web 2.0”.</p><p><a href="http://housingmaps.com" target="_blank" rel="noopener">HousingMaps.com</a> (2005) typically gets credit as the first Web mashup, which blends Craigslist with Google Maps, and this was before Maps even had an official API. <a href="http://chicagocrime.org" target="_blank" rel="noopener">ChicagoCrime.org</a> followed shortly after, and the rest was history. Mashups were popping up by the thousands, and JavaScript was becoming “cool” for the first time, because it could make your once bland and stale Web page come alive!</p><p>Over the next 3 or 4 years, Web companies left and right were distributing their data far and wide through a variety of data formats. <em>“Want XML? Here ya go! RSS for everything!! JSON? Sure. We’ll even set up JSONP for you too. Authentication? Nope, not necessary, we trust you to do the right thing with this data. Happy coding and let us know if you build anything cool!”</em> It was a very innovative era, and the extent of what you could build were only limited by your knowledge and the amount of time you had to hack something together.</p><p>But as you’ve heard 1,000 times before, all good times eventually come to an end.  Nowadays, it’s tough to find an RSS or JSON feed on most sites that aren’t blogs.  Sure many of them have that same data available via formal APIs, but that requires an account for authentication, documentation to be read, knowledge of technologies required, and (very likely) limitations placed on the amount of data you can consume.  It’s a lot of work.  Also, an API is no longer thought of as a necessity to building a successful product.</p><p>Why did this happen? It’s tough to say really, but here’s a few theories as I think aloud…</p><ul><li><p>With the rise of JSON and the death of RSS, there was no standard/popular feed format for every Web service to implement, which meant it was a bit more difficult to open up a public API since you had to actually think about your data structure.  On the client-side, while I would absolutely rather work with JSON over XML/RSS, the tools and data are less interchangeable because they are all using custom structures, which leads to more work to build a mashup.</p></li><li><p>The bar was raised.  No longer are we amused and entertained by Google Maps mashups or a Web-based Twitter client.  Our expectations are higher, requiring more unique ideas and more resources towards development.  With a higher barrier to entry and higher expectations,</p></li><li><p>Facebook and Apple proved you could make $billions off partially-closed environments, which made previously open companies start looking at closed environments for their data. For example, Google, a previously strong advocate of full and open APIs, still has yet to release a full API for Google+ and lets us know we <a href="http://techcrunch.com/2012/06/28/dont-expect-a-full-readwrite-google-api-anytime-soon-google-doesnt-want-to-disrupt-something-magical/" target="_blank" rel="noopener">shouldn’t expect one anytime soon</a>. Yahoo, who previously would try to out-Open Google, was never able to properly execute on the “Open” concept (see: <a href="http://blog.programmableweb.com/2008/10/14/a-preview-of-yap-the-yahoo-application-platform/" target="_blank" rel="noopener">YAP</a>, and many of the APIs from the 2006-2010 era are either gone or no longer useful.</p></li><li><p>When companies are young, they are usually very open to the idea of “Open”, because that’s a great way to gain developers and new ideas while you work on creating your business.  Eventually though, all those investors that gave you millions of dollars will want to be paid back (preferably 100x over), so you need to eventually settle on a business model.</p></li></ul><p>RIP mashups.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Every time Twitter announces some new API initiative that further damages their once great developer community, I always think, &lt;em&gt;“Alright, this is the last time I’ll write about them. I’m done.”&lt;/em&gt; But every time, they always find a way to pull me back into the discussion.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://media.giphy.com/media/B3nATT4FPkb3G/200.gif&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
    
    </summary>
    
    
      <category term="twitter" scheme="http://derek.io/blog/tags/twitter/"/>
    
      <category term="mashups" scheme="http://derek.io/blog/tags/mashups/"/>
    
  </entry>
  
  <entry>
    <title>Creating an API Service with YQL</title>
    <link href="http://derek.io/blog/2011/creating-an-api-service-with-yql/"/>
    <id>http://derek.io/blog/2011/creating-an-api-service-with-yql/</id>
    <published>2011-09-22T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://l.yimg.com/a/i/ydn/features/yql-ins-up-del.gif" alt=""></p><p>I spent a few days last week in New York City at Yahoo’s <a href="http://developer.yahoo.com/blogs/ydn/posts/2011/09/yahoo-open-hack-all-stars-in-new-york-city/" target="_blank" rel="noopener">Open Hack All-stars event</a>. At this hack day, I was mentoring a team of 3 students from the University of Texas who set out to create a hack that allows you to control a media experience on your TV by using your iPad.</p><a id="more"></a><p>For this hack, they needed to talk to search APIs from 4 different services (Youtube, Justin.tv, Flickr, Netflix), parse the results, and display a thumbnail for each item with a link to play/view it.  Traditionally, this would be a rather bulky iPad application where you’d have to include all the code and logic to communicate with the various JSON, XML, &amp; ATOM service APIs, parse the results, combine them, and finally render the content.  Likely, the HTTP calls would be synchronous, which would certainly present some issues as you get to 5+ APIs and you have to wait for one response to return before making the next.</p><p>Alternatively, you could create an API service that will do all of this for you.  When that option was presented, I immediately realized YQL would be perfect for this task.  Why?<br></p><ul><br><li>It can communicate with any HTTP-based APIs, asyncronously, so your response time is always as fast as the slowest API you have to talk to</li><br><li>Use custom JavaScript to parse the results and form the return set</li><br><li>Reduces the number of requests your client makes to a single HTTP request</li><br></ul><p>So, I strapped on the headphones and began coding. A few hours later, <a href="http://derek.github.com/sandbox/hackallstars/mediasearch.xml" target="_blank" rel="noopener">here’s the result</a>. It’s YQL <a href="http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html" target="_blank" rel="noopener">datatable</a> that heavily uses the <execute> feature, which allows you to run arbitrary JavaScript. Within <execute>, you get a simple library that allows you to do things like parse JSON, make HTTP calls, and create XML structures with <a href="http://en.wikipedia.org/wiki/ECMAScript_for_XML" target="_blank" rel="noopener">E4X</a>. The datatable code is pretty straight-forward really. <em>Here’s the service to talk to, the URLs to send the search query to, and the callback to parse each result set. Now go!</em></execute></execute></p><p>The beauty of this YQL datatable is that you have now created a fully-functional high-performance API server without the need for a server of your own to run it on.</p><p>Here’s a JSFiddle of the script in action.  Click the play button to see the combined search results.</p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/9S3UK/embedded/"></iframe><p>You can also toy around with the query in the YQL console <a href="http://y.ahoo.it/lDld8" target="_blank" rel="noopener">here</a>.</p><p>If you are interested in learning more fun stuff you can do with YQL, here’s another post, <a href="http://derek.io/blog/2010/how-to-secure-oauth-in-javascript/">How-to: Secure OAuth in JavaScript</a></p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;http://l.yimg.com/a/i/ydn/features/yql-ins-up-del.gif&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;I spent a few days last week in New York City at Yahoo’s &lt;a href=&quot;http://developer.yahoo.com/blogs/ydn/posts/2011/09/yahoo-open-hack-all-stars-in-new-york-city/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Open Hack All-stars event&lt;/a&gt;. At this hack day, I was mentoring a team of 3 students from the University of Texas who set out to create a hack that allows you to control a media experience on your TV by using your iPad.&lt;/p&gt;
    
    </summary>
    
      <category term="Web Development" scheme="http://derek.io/blog/categories/Web-Development/"/>
    
    
      <category term="javascript" scheme="http://derek.io/blog/tags/javascript/"/>
    
      <category term="yql" scheme="http://derek.io/blog/tags/yql/"/>
    
  </entry>
  
  <entry>
    <title>Learning JavaScript</title>
    <link href="http://derek.io/blog/2011/learning-javascript/"/>
    <id>http://derek.io/blog/2011/learning-javascript/</id>
    <published>2011-07-20T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p><img src="https://cdn-images-1.medium.com/max/785/1*H-25KB7EbSHjv70HXrdl6w.png" alt="javascript"></p><p>So you want to learn JavaScript huh? I can’t blame you, it’s a pretty rad programming language.  Well lucky for you, it’s a really easy language to pick up and learn.  You can get started with the language without spending a penny on a compiler, an IDE, or any instructional material.  Heck, you already have a computer capable of running JavaScript.  I know that because every modern web browser has one, and that’s how you are viewing this blog post.</p><a id="more"></a><p>I’m approaching this post as an introduction to JavaScript for someone who is already a programmer (novice or advanced, doesn’t matter).  An introduction to programming would be an entirely different post.</p><p>Without further adieu…</p><h2>Tip #1: Start by Reading the Wikipedia Entry</h2><br>Yeah, we’re really swinging for the fences now, this is a tough one.  You’ll find that entry <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank" rel="noopener">here</a>. Read it, thoroughly.  It’s really helpful to get some background information on the language, the history, and various implementations of it.  It’s helpful to understand that JavaScript is a standardized language, with many “<a href="http://en.wikipedia.org/wiki/JavaScript_engine" target="_blank" rel="noopener">engines</a>“ available to execute your code.  There’s no single company behind the language.  Also, forget that JavaScript has anything to do with Java.  It doesn’t.  It was just a horrible name for a language that wasn’t supposed to be very useful. Well, it turns out it was, and we all accept that it’s a horrible name and have moved on. C’est la vie.<br><br><h2>Tip #2: Learn it Outside of a Browser!!!</h2><p>I’m going to assume you have some experience with another programming language.  Odds are likely it is PHP, Ruby, or Python.  Those are all scripting languages, which means it isn’t compiled prior to runtime, instead it is read by an interpreter and executed on the fly.  Well, JavaScript works the same way, there’s no compilation step you have to do prior to running a program.  So, <a href="http://nodejs.org/#download" target="_blank" rel="noopener">download Node.js</a> and start writing some basic scripts.  At this moment, Node.js only runs on OSX and Linux, so if you are running Windows, then ok… You can either visit <a href="http://jsbin.com/" target="_blank" rel="noopener">jsbin.com</a> or use the JavaScript console that comes built in to Chrome.  Windows support for Node.js is coming soon though (late-summer 2011).</p><p>The reason I say learn it outside of a web browser is because you should approach JavaScript just like you would any other programming language.  Only focus on its standard library to start. If you start toying with it in a web browser, you all of a sudden have access to the DOM and the BOM APIs, and then you’ll be distracted by learning HTML, CSS, which will likely be frustrating and lead you to a library like jQuery or YUI.  Just don’t do it.  Once you get comfortable with the syntax, scoping, and prototypal nature of the language, then proceed to use it inside of a web application.</p><h2>Tip #3: Read Some Books</h2><p>I highly recommend <a href="http://eloquentjavascript.net/" target="_blank" rel="noopener">Eloquent JavaScript</a> to start, because it’s a great book, and it’s free! After that, check out a few other of my favorites; <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?s=books&ie=UTF8&qid=1311226701&sr=1-1" target="_blank" rel="noopener">The Good Parts</a>, <a href="http://www.amazon.com/Performance-JavaScript-Faster-Application-Interfaces/dp/059680279X/ref=sr_1_1?s=books&ie=UTF8&qid=1311226709&sr=1-1" target="_blank" rel="noopener">High Performance JavaScript</a>, and <a href="http://www.amazon.com/Pro-JavaScript-Techniques-John-Resig/dp/1590597273/ref=sr_1_1?s=books&ie=UTF8&qid=1311226775&sr=1-1" target="_blank" rel="noopener">Pro JavaScript Techniques</a>.  You can buy them all used off of Amazon for under $15 each.</p><h2>Tip #4: Watch some videos</h2><br>The <a href="http://developer.yahoo.com/yui/theater/" target="_blank" rel="noopener">YUI Theater</a> is an excellent resource for anything front-end related.  Some of it is focused on YUI, but there are quite a few videos that are just about JavaScript in general.  The <a href="http://yuiblog.com/crockford/" target="_blank" rel="noopener">Crockford on JavaScript</a> lecture series is amazing.  Must watch!<br><br>Another video I came across recently was Alex Russell’s talk at Google.io 2011, “<a href="http://www.youtube.com/watch?v=seX7jYI96GE" target="_blank" rel="noopener">Learning to Love JavaScript</a>“.  It is probably the best introduction presentation to the language I’ve seen.<br><br><h2>Tip #5: Get Involved in the Community</h2><br>JavaScript meetup groups are popping up in every major city around the world, and there are many major JS-related conferences/events every year.  Go to <a href="http://www.meetup.com/" target="_blank" rel="noopener">Meetup.com</a> and search for “JavaScript” in your area.  Attend a meetup, meet some fellow nerds, and ask them about their learning experiences with JavaScript.  Don’t see one in your area? Create one! <a href="http://www.meetup.com/socaljs" target="_blank" rel="noopener">I did</a>, <a href="http://groups.google.com/group/kcjug/" target="_blank" rel="noopener">twice</a>.<br><br>If you really get into it, attend <a href="http://jsconf.us/" target="_blank" rel="noopener">JSConf.us</a> or <a href="http://jsconf.eu" target="_blank" rel="noopener">JSConf.eu</a>.  They are the best JS-related conferences out there.<br><br>If you are anti-social and don’t want to get out and meet people, don’t worry, there’s a large community on-line as well.  You can find us in #javascript on Freenode IRC.  I usually hang out there (user: dgathright), as well as #yui, #jquery, #node.js, #html5, and many others.  If you see me on there, ping me and let me know you saw this post and I’ll give you an internet high-five.  Also, join the <a href="http://jsmentors.com/" target="_blank" rel="noopener">JSMentors mailing list</a>.  Its whole purpose is to help newbies like you learn the language we love.<br><br><h2>Tip #6: Ignore W3Schools!</h2><p>There is a plethora of ancient JavaScript tip sites that haven’t been updated in 10+ years.  They often contain horrible, and sometimes incorrect, examples of JavaScript code.  Instead, visit the Mozilla Developer Network’s <a href="https://developer.mozilla.org/en/JavaScript" target="_blank" rel="noopener">JavaScript</a> documentation.  W3Schools is so bad, it even spurred <a href="http://w3fools.com/" target="_blank" rel="noopener">W3Fools.com</a>.</p><h2>Tip #7: Be Curious</h2><p>There are more discussions about JavaScript and code posted per day than time you have to actually read it.  That means there is an unlimited supply of information out there about the language, seek it out.</p><p>–</p><p>Well, those are the tips that immediately come to mind.  There’s quite a few more ideas, blog posts, tools, resources, services, etc… that I’d love to recommend, but you have more than enough to get started.  Now go get coding!</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://cdn-images-1.medium.com/max/785/1*H-25KB7EbSHjv70HXrdl6w.png&quot; alt=&quot;javascript&quot;&gt;&lt;/p&gt;
&lt;p&gt;So you want to learn JavaScript huh? I can’t blame you, it’s a pretty rad programming language.  Well lucky for you, it’s a really easy language to pick up and learn.  You can get started with the language without spending a penny on a compiler, an IDE, or any instructional material.  Heck, you already have a computer capable of running JavaScript.  I know that because every modern web browser has one, and that’s how you are viewing this blog post.&lt;/p&gt;
    
    </summary>
    
      <category term="Web Development" scheme="http://derek.io/blog/categories/Web-Development/"/>
    
    
      <category term="javascript" scheme="http://derek.io/blog/tags/javascript/"/>
    
  </entry>
  
  <entry>
    <title>&#39;IE6 Must Die&#39; Must Die</title>
    <link href="http://derek.io/blog/2011/ie6-must-die-must-die/"/>
    <id>http://derek.io/blog/2011/ie6-must-die-must-die/</id>
    <published>2011-07-18T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p>For years, the phrase “IE6 Must Die” has been used as the rally cry for web developers who want to put IE6 in the rear-view mirror.  As a seasoned web developer, I’ve certainly had much share of frustrations with that browser.  We all have. It’s just old and lacking in so many neat, useful, heck… vital features for modern web applications.  We can all agree that it’s a royal pain in the ass and it is holding the web back. Right? Wrong.</p><a id="more"></a><p>I’ve tweeted “#ie6mustdie” more than a few times. I’ve cheered as Douglas Crockford shows “IE6 Must Die” slide during his presentations.  I even own a t-shirt that has the phrase.  As happy as I’d be if the browser disappeared off the face of the earth.  But unfortunately that’s not going to happen and no amount of wishing on my part can accelerate its demise.</p><p>So as IE6 celebrates it’s 10th year anniversary (happy birthday you P.O.S.), I’m going to throw this out there… “IE6 Must Die” must die.  We’re at a turning point now where no amount of polyfills can provide the level of features that a “modern browser” can provide.  In the past, browsers all did mostly the same thing, implementation just varied a bit.  Nowadays, that’s not the case.  Sure you can use a Flash fallback for something like Websockets.  But IndexedDB? Hah! CSS3? Psshh… Geolocation? Yeah… no.</p><p>But the simple truth is that there is still a very large amount of users on the world that are using IE6. While it may be a non-factor for some niche sites (e.g. Github), for other sites it may represent more than half of their traffic. In China, 40% of the web traffic (“<a href="http://www.conceivablytech.com/8304/business/why-microsoft-cant-get-rid-of-ie6-yet" target="_blank" rel="noopener">Why Microsoft Can’t Get Rid Of IE6 Yet</a>“) is using the browser. Globally, we’re still above 10% IE6 market-share (<a href="http://www.ie6countdown.com/" target="_blank" rel="noopener">ie6countdown.com</a>) and it’s going to take years before that drops below 5%.</p><p>My advice? Embrace it. Stop fighting IE6 and understand that all web pages do not have to look or act exactly the same.  Remember, you are a professional web developer building web pages.  While IE6 has its faults, it is still a standards compliant browser that is designed to view (X)HTML web pages.  There is no reason your blog cannot support IE6</p><p>Last week, the YUI team announced an update to its Graded Browser Support guidelines (“<a href="http://www.yuiblog.com/blog/2011/07/12/gbs-update/" target="_blank" rel="noopener">Graded Browser Support Update</a>“). There has been some confusion in the community as to why IE6 is still on it and what that inclusion implies.</p><p>My take? I think it’s a great, thoughtful, step in the right direction.  If IE6 were excluded from the EBS, that means dropping all support for the browser and just ignoring it even exists.  As much as we’d love for that to be a reality, we’re still far from it happening.  Ignoring IE6 even exists means you don’t even consider it when building your web applications.  Even some of the more advanced web apps from Yahoo, Google, Facebook, etc… still consider IE6.  “Considering” doesn’t mean fully supporting, it just means you provide some tailored experience for those users.  That experience could even be a splash page that says “Sorry, you need to upgrade to another browser in order to view this page.”  According to the latest GBS, that is absolutely an acceptable experience.</p><p>With the rise of HTML5, the world that the GBS exists in today is much different than it was even a year ago.  In the past, all browsers had more-or-less the same capabilities, the variance came in implementation and quirks, which libraries helped you work around.  There were a few exceptions (e.g. png transparency, performance) but for the most part, they all did the same thing and had similar capabilities.  Those days are long gone though.  Polyfills can only get you so far until you run into things that simply cannot be done in non-HTML5 browsers (FF&lt;4, IE6-9).  Because there’s such a wide-variety of browser capabilities today and it’s especially hard to predict capability support (see: now-you-see-me-now-you-don’t websockets), it’s impossible for the GBS to insist that you provide specific experiences for a set of browsers.  The best we can do at this point is just tell you which browsers matter, and the metric for that is market share.</p><p>There are some parts of the world (northern Europe) where IE6 traffic is under 1%. Fortunately for them, (in my opinion) they can safely ignore IE6. However, in other parts of the world, such as China, IE6 still accounts for up to 40% of the traffic (“<a href="http://www.conceivablytech.com/8304/business/why-microsoft-cant-get-rid-of-ie6-yet" target="_blank" rel="noopener">Why Microsoft Can’t Get Rid Of IE6 Yet</a>“). Globally, we’re still above 10% IE6 market-share (<a href="http://www.ie6countdown.com/" target="_blank" rel="noopener">ie6countdown.com</a>). Because it still represents a significant market-share, it would be careless to completely drop support for the browser, especially for a JS library.</p><p>Along with YUI, jQuery and Prototype both continue to support IE6, along with most other JS libs as well.  Why? We have to.  If a JS library doesn’t support IE6, you can’t even include it on your pages without fear of seriously impacting the experience for your users.  We shouldn’t be the ones who tell you what browsers you can and can’t support, that should be your decision.  It’s your product, they are your users, you should decide what is best for them.  If you choose not to support a full experience for IE6 users, more power to you.  In many cases, I advocate that approach.  But, you should at least be confident that if you still wish to provide support for IE6 users, even minimal support, you have confidence that your JS library will work.</p><p>While I’m absolutely in favor of pushing the web forward and reducing the usage of legacy browsers, we as web developers have to accept reality.  IE6 is the baseline web browser we’re going to have to target for years to come.  When you build your next web application and build in basic support for IE6, do not think of it as “Supporting IE6”, think of it as supporting “the web”.  We develop atop a platform that considered backwards compatibility to be paramount, and the things we build should work decades from now.</p><p>Life has definitely taught me to learn to love the things you must do.  In this case, I’m forcing myself to learn to love IE6 all over again.  I no longer view it as an annoyance, and instead look at it as a fundamental stepping stone on our journey to build a better web.  Years from now, I’m certain we’ll all look back at IE6 with a bit more reverence.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;For years, the phrase “IE6 Must Die” has been used as the rally cry for web developers who want to put IE6 in the rear-view mirror.  As a seasoned web developer, I’ve certainly had much share of frustrations with that browser.  We all have. It’s just old and lacking in so many neat, useful, heck… vital features for modern web applications.  We can all agree that it’s a royal pain in the ass and it is holding the web back. Right? Wrong.&lt;/p&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>The Best Career Advice You&#39;ll Ever Get</title>
    <link href="http://derek.io/blog/2011/the-best-career-advice-you-ll-ever-get/"/>
    <id>http://derek.io/blog/2011/the-best-career-advice-you-ll-ever-get/</id>
    <published>2011-07-06T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:48.997Z</updated>
    
    <content type="html"><![CDATA[<p><img src="https://imgur.com/Qwkp2Um.png" alt="career advice"><br>The Huffington Post just posted an interview with Marissa Mayer (<a href="http://www.huffingtonpost.com/2011/07/06/google-marissa-mayer-women-in-tech_n_891167.html" target="_blank" rel="noopener"><em>“Google Exec Marissa Mayer Explains Why There Aren’t More Girl Geeks”</em></a>) in which she explained why she chose Google over 13 other companies she had job offers from out of college.</p><a id="more"></a><blockquote><em>“Work with the smartest people you can find, do something you’re not ready to do, find an environment in which you’re very comfortable so you can find your voice, and work for someone who believes in you – because when they believe in you, they’ll invest in you.”</em></blockquote><p>I couldn’t agree more.  For some people, that’s Google or Facebook.  For others, that is a startup.  For me, that encompasses every reason why I’m at Yahoo.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://imgur.com/Qwkp2Um.png&quot; alt=&quot;career advice&quot;&gt;&lt;br&gt;The Huffington Post just posted an interview with Marissa Mayer (&lt;a href=&quot;http://www.huffingtonpost.com/2011/07/06/google-marissa-mayer-women-in-tech_n_891167.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;“Google Exec Marissa Mayer Explains Why There Aren’t More Girl Geeks”&lt;/em&gt;&lt;/a&gt;) in which she explained why she chose Google over 13 other companies she had job offers from out of college.&lt;/p&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
    
  </entry>
  
  <entry>
    <title>Splitt</title>
    <link href="http://derek.io/blog/2011/splitt/"/>
    <id>http://derek.io/blog/2011/splitt/</id>
    <published>2011-06-11T06:23:21.000Z</published>
    <updated>2019-09-26T18:01:49.001Z</updated>
    
    <content type="html"><![CDATA[<p>Growing up in Kansas City, I spent quite a few summer afternoons at Royals games.  My grandparents had season tickets, front row, just next to the home dugout.  Amazing seats.  It pretty much felt like you were on the field.  As much as I love some of my other teams, there’s a certain connection you have with your baseball team.  I suspect that is largely due to the fact that they play just about every night, 162 games per season.  If you are a fan, you are in it for the long-haul.  It takes commitment.</p><a id="more"></a><p>Royals fans are a great bunch.  I’ll always view Kansas City as a baseball town, no matter how good the Chiefs are any given season.  That’s especially remarkable considering the fact that we’ve only had a single winning season since we won the World Series.  FYI, that championship happened 25 years ago, if you didn’t know.  Us Royals fans know.  It’s always in the back of our minds as we hover around the .500 mark anytime after April. “This is the year, we’re gonna do it!” is what we think.  Most fans say that about winning the division.  Not us.  We just want 82 wins in one year, a winning season. Just once, and then we’ll build from there.  Baby steps.  Progress.</p><p>Over the stretch of a 162 game season, most baseball fans will watch or listen to dozens and dozens of games.  There’s a connection you feel with the guys in the booth, a one-way bond that is developed over hundreds of hours of listening to their narrative.  I can literally hear the Royals announcers in my head as I write this and make their voices say anything I want.  I know them that well.  Their catch phrases.  Their quirks.  Their jokes.  I feel like I’ve known them my whole life, yet never met them once.  I’m not even sure I’d recognize them if seen in person, but I could recognize their voice from across a crowded room.</p><p>Tuesday night, one of our announcers lost a battle with cancer.  When the news came out last week that Paul “Splitt” Splitorff was ill, the rumors swirled that he had less than a week to live.  It was a shock.  We all suspected he wasn’t in great health, but no one thought it was something this bad.  Less than a month ago he was calling a game.  Two weeks ago he was doing the Royals postgame show.  People don’t just… go like that.  Do they?</p><p>Unfortunately, yes.</p><p>As I watched the Royals vs Baltimore game the day of his passing, the Royals TV broadcast observed an inning of silence for a man who gave 2/3s of his life to the organization.  He was one of the first players drafted by the new expansion Royals in 1968, and pitched wearing royal blue all 16 years until his retirement.  After his retirement, he began an even longer 24-year career as a broadcaster with the team.</p><p>He wasn’t the greatest pitcher the team ever had, but he still holds the record for most won games.  He wasn’t the greatest announcer the game has seen, but he was ours.  He was mine.  He was a constant.  Every night you know you can turn on the ball game and listen to the same guys call a game.</p><p>Broadcasters are special.  So much has changed in your life, but they’re still doing the exact same thing they were decades before.  The day you graduated high school, they were calling a Royals game.  The day you got married, they were calling a game.  The day you had your first child, they called a game.  The day your kids graduated high school, those same guys are calling yet another game from the exact same booth for the exact same team.</p><p>Inevitably though, change must occur, and the next generation is given their chance.  Sad that this time it happened sooner than it should have.</p><p>We’ll miss you Splitt.</p><div align="center"><img src="http://www.nerdbaseball.com/wp-content/uploads/2009/08/splittorff-paul1.jpg"></div>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Growing up in Kansas City, I spent quite a few summer afternoons at Royals games.  My grandparents had season tickets, front row, just next to the home dugout.  Amazing seats.  It pretty much felt like you were on the field.  As much as I love some of my other teams, there’s a certain connection you have with your baseball team.  I suspect that is largely due to the fact that they play just about every night, 162 games per season.  If you are a fan, you are in it for the long-haul.  It takes commitment.&lt;/p&gt;
    
    </summary>
    
      <category term="Unsorted" scheme="http://derek.io/blog/categories/Unsorted/"/>
    
    
      <category term="royals" scheme="http://derek.io/blog/tags/royals/"/>
    
      <category term="cancer" scheme="http://derek.io/blog/tags/cancer/"/>
    
      <category term="baseball" scheme="http://derek.io/blog/tags/baseball/"/>
    
      <category term="kansas city" scheme="http://derek.io/blog/tags/kansas-city/"/>
    
  </entry>
  
  <entry>
    <title>Planting Seeds</title>
    <link href="http://derek.io/blog/2011/planting-seeds/"/>
    <id>http://derek.io/blog/2011/planting-seeds/</id>
    <published>2011-06-08T05:20:18.000Z</published>
    <updated>2019-09-26T18:01:48.998Z</updated>
    
    <content type="html"><![CDATA[<p><img src="https://imgur.com/r81hbJe.png" alt="plants"><br>6 years and 6 months ago I was a recent college grad, unemployed, and recently fired from my computer sales job.  I was horrible at sales.  Not because I’m not social and can’t communicate, but because I always viewed myself as being on the side of the customer, not the employer.  “<em>No, you don’t need that, it’s twice as expensive as this model, and you won’t use most of the features.  Here, this one is a better fit for you. Actually, you probably don’t even need this at all.</em>“</p><a id="more"></a><p>Needless to say, sales managers don’t really like that attitude.</p><p>So as a 24 year old (f)unemployed person, how do you spend your time? Trying to sell a professional sports team, of course.</p><p>Alright, that statement deserves a little explanation.  If you know me, you know I’m a huge soccer fan. I’d been attending Kansas City Wizards games since Major League Soccer’s inception (1996) and was very involved in the KC team’s supporters group.  Well, a few days after I was given a pink slip, on Dec 9th, 2004 the Wizards ownership group announced they had pretty much given up hope on the team and were putting it up for sale.  That was pretty devastating for us fans.  We knew there was little chance someone was going to come in and buy an MLS team in Kansas City.  If they did, they were buying it to move to another city.  There wasn’t much hope in keeping our team, but we weren’t going to lose it without a fight.</p><p>Being without a job, I had more than enough time to take the initiative and get the ball rolling.  I registered our name (Heart of America Soccer Foundation), wrote forum posts, sent out emails, made phone calls, hosted a wiki for us to organize, etc…  It was a busy time for a lot of us.  Within a few weeks, we were having meetings, internally, with politicians, and with potential ownership groups.  Our goal was to make the city and fanbase as attractive as possible to anyone interested in making a significant investment in the team.  We of course weren’t the ones selling the team, but we could make a pretty convincing argument that Kansas City was the right home for whoever was buying it.  It was a collective voice that needed to be heard.</p><p>While we organized &amp; communicated mostly online, early-on we were without a website, so that needed to change.  Wordpress of today would have been perfect for the task, but this was 2004, so it was pretty unknown at the time and certainly wasn’t as robust as it is now. I had built a few web sites before, dabbled in PHP, HTML, and CSS, but had never built anything too special and certainly nothing professional appearing. However, that didn’t discourage me, and I was excited for the challenge of learning how to build the site from scratch.  Luckily, we had a talented designer in the group, so all I had to do was the coding.  Off I went.</p><p>Because of how much fun I was having building the HASF website, I started to have the confidence that maybe I could turn my long-time programming hobby into a career. Within a few weeks, I had my first interview for a web developer position at a local startup.  During that interview, I was asked all the typical questions, some technical, and some non-technical.  I was doing ok.  Well, maybe. My lack of professional experience was pretty evident, cause I had none.  Towards the end I was asked, “<em>Do you have a website you’ve built that you could show us?</em>“</p><p>Luckily…</p><p>“<em>Sure, I just built one a few weeks ago</em>“, and we pulled up <a href="http://hoasoccer.org" target="_blank" rel="noopener">hoasoccer.org</a> on the projector.</p><p>I was pretty proud of it, and they could tell as I enthusiastically talked about all the things I wanted to eventually do with it.</p><p>Later that night, I got a phone call, and a job offer.  Accepted!</p><p>As I ventured into a new career, my involvement with HASF had to take a backseat.  Oh, I was still involved, but I just didn’t have enough time to spend the majority of each day as the COO of a grassroots organization. At that point, more qualified individuals took leadership roles and did an amazing job.  It was a long process, but on August 31st, 2006, the team was finally sold to a local ownership group for $20 million.  Mission accomplished!</p><p>Well, mission accomplished as far as HASF was concerned.  There was still a massive uphill battle for the new owners to get a stadium built for the team, ensuring its long-term home is Kansas City.  Luckily for them, some of those heavily involved with HASF joined the new ownership group filling a variety of roles. It’s a very talented, passionate group of individuals.  While I worked on building my career, they continued on the journey to build a world-class soccer stadium right in the heartland, in Kansas City.  I was rooting for them every step of the way.</p><p>At the same time, in 2007 I was working as a developer at an advertising agency, and not having very much fun there. Jeff, a friend from HASF, emailed me one day about a meeting with a family friend of his who was working on a startup.  We heard the pitch, and the challenge was exciting.  I was in the process of buying my first home, so leaving a steady job and going month-to-month contract at a web startup was a pretty dumb idea. My mom disliked it, can’t blame her.  But, I took it, and had an extremely satisfying 2.5 years there.  It even directly led to the <a href="http://derek.io/blog/2009/im-a-yahoo/">next chapter</a> in my career.</p><p>Fast forward to today, a journey that started on Dec 9th, 2004 is going to conclude on June 9th, 2011 with that first game at <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Livestrong_Sporting_Park" target="_blank" rel="noopener">LIVESTRONG Sporting Park</a>, home of Sporting Kansas City (formerly Kansas City Wizards).  That’s 2,374 days of hard work one group of people have done to accomplish something uniquely special. I now live in Los Angeles, but am making the trip back for the first game in the new stadium this week. For myself, it’s going to be pretty amazing walking into that stadium for the first time.  There’s a personal connection.  But I can’t even imagine what it will be like for those people who have been involved with every step of the process.</p><p>It boggles my mind to think what I’d be doing if I didn’t wake up one day and decide I wanted to help save a sports team.  If I don’t co-found a non-profit organization that had nothing to do with technology, I likely don’t get that first programming job at a startup.  If I don’t work at that startup where I learned what it takes to build the engineering side of a company, I don’t get the experience to actually lead the next startup.  Well, that next one is what directly led to where I am today and the <a href="http://derek.io/blog/2011/joining-yui/">new position</a> I’ll be starting in a few weeks.</p><p>The takeaway from this story is that you need to be driven by your passions.  This stadium’s story very likely could have happened without my involvement early on.  But the fun part is, it did happen with my involvment.  When you are motivated by things that you love, you’ll make awesome things happen. Continually plant seeds for for the future, because eventually some of those seeds will turn into trees.</p><p>You never know, someday one of those trees might look like this…</p><div align="center"><br><img width="620" src="http://s89997654.onlinehome.us/screencaps/livestrongpark-20110607-193725.jpg"><br><img width="620" src="http://farm6.static.flickr.com/5029/5766503395_0aaed7a194_b.jpg"><br><img width="620" src="http://i.imgur.com/jxdSpZV.jpg"><br><br>Photo credits:<br>Facade: Ramsey Mohsen - <a href="http://www.flickr.com/photos/33161367@N04/5766503681/sizes/l/in/photostream/" target="_blank" rel="noopener">Flickr</a><br>Grass: <a href="http://www.flickr.com/photos/33161367@N04/5766503395/sizes/l/in/photostream/" target="_blank" rel="noopener">Flickr</a><br><br></div>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://imgur.com/r81hbJe.png&quot; alt=&quot;plants&quot;&gt;&lt;br&gt;6 years and 6 months ago I was a recent college grad, unemployed, and recently fired from my computer sales job.  I was horrible at sales.  Not because I’m not social and can’t communicate, but because I always viewed myself as being on the side of the customer, not the employer.  “&lt;em&gt;No, you don’t need that, it’s twice as expensive as this model, and you won’t use most of the features.  Here, this one is a better fit for you. Actually, you probably don’t even need this at all.&lt;/em&gt;“&lt;/p&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
      <category term="Sports" scheme="http://derek.io/blog/categories/Career/Sports/"/>
    
    
      <category term="sportingkc" scheme="http://derek.io/blog/tags/sportingkc/"/>
    
      <category term="hasf" scheme="http://derek.io/blog/tags/hasf/"/>
    
      <category term="livestrong" scheme="http://derek.io/blog/tags/livestrong/"/>
    
  </entry>
  
  <entry>
    <title>Joining YUI</title>
    <link href="http://derek.io/blog/2011/joining-yui/"/>
    <id>http://derek.io/blog/2011/joining-yui/</id>
    <published>2011-06-06T12:10:06.000Z</published>
    <updated>2019-09-26T18:01:48.998Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://www.professionalsofttech.com/wp-content/uploads/2014/04/yui.png" alt=""><br>It seems like just yesterday I <a href="http://derek.io/blog/2009/im-a-yahoo/">accepted a position</a> with Yahoo and began a new adventure. These last 18 months have been an incredibly exciting time in my life, and am very thankful to have been given the opportunity. I can confidently say that Yahoo is -the- best place to work as a front-end engineer.</p><a id="more"></a><p>Well, the next chapter is about to begin.</p><p><img src="http://s89997654.onlinehome.us/screencaps/Twitter___%40Derek_Gathright__Exciting_day._Accepted_a_p_...-20110605-203607.jpg" alt="Tweet: Exciting day. Accepted a position with the YUI team at Yahoo. Yes, that means I'll be moving to NoCal. Watch out San Fran! I'm comin for ya."></p><p><em>(Note: I’ve since learned it is actually “NorCal”, not “NoCal”. Me = California noob.)</em></p><p></p><h2>What is YUI?</h2><br>YUI (mostly pronounced “Y U I”, sometimes “Yooey”) is an abbreviation for the <strong>Y</strong>ahoo <strong>U</strong>ser <strong>I</strong>nterface library. It’s a project that began in 2005, and was open-sourced in 2006. It is primarily a JavaScript library, but also contains some CSS components as well (see: <a href="http://developer.yahoo.com/yui/grids/" target="_blank" rel="noopener">Grids</a>, <a href="http://developer.yahoo.com/yui/reset/" target="_blank" rel="noopener">Reset</a>). It is used extensively across just about every webpage Yahoo has, and it is popular externally as well.<p></p><p><a id="more"></a><a id="more-1030"></a></p><p>The reason we need JavaScript libraries is because web browsers have inconsistent implementations of the CSS &amp; ECMAScript (JavaScript) standards. Some browsers render something one way, while others do it in another way. We need to level the field and have a standard way to make stuff happen in the browser, so it’s the job of the library to abstract out all the differences and give developers a sane way to make your browser do something.</p><p>You can read more about the concept on Wikipedia: <a href="https://secure.wikimedia.org/wikipedia/en/wiki/JavaScript_library" target="_blank" rel="noopener">JavaScript Library</a>.</p><p></p><h2>Why is YUI awesome?</h2><br>Early on in my time at Yahoo, it became pretty clear to me that at some point in my career, I wanted to work for the YUI team. Here’s why…<p></p><p><ul><br>    <li>It’s an open-source project with a very liberal BSD license. Yay!</li><br>    <li>It’s widely used both inside of Yahoo, and externally as well.</li><br>    <li>It’s a very exciting time for JavaScript as it invades the server (thanks to projects like <a href="http://nodejs.org" target="_blank" rel="noopener">Node.js</a>) and YUI runs amazingly well in a server environment. Better than any other full-featured JS library.</li><br>    <li>YUI’s module system is one of the best out there. It allows you to create lean, fast, and portable applications.</li><br>    <li>YUI is way more than just a DOM manipulation library, it is a platform for JavaScript applications. For that reason, I think YUI is in a great position to really make an impact as JavaScript is used in new &amp; innovative ways.</li><br>    <li>It’s one of the most important projects Yahoo is working on and gets immense support from within the company. It even has its own <a href="http://yuilibrary.com/yuiconf2010/" target="_blank" rel="noopener">conference</a>.</li><br>    <li>The YUI team and the YUI community are equals. The YUI Gallery allows anyone to contribute to the collection of modules YUI can use, and we’ll even host the code for you.</li><br>    <li>YUI has some of the brightest, and most passionate people in the industry working on the project. It’s an honor to be considered among them.</li><br></ul><br>If you read my post on <a href="http://derek.io/blog/2011/the-engineer/">the mentality of the engineer</a>, you’ll know that I really appreciate a good challenge. Well, this is going to be one of the funnest, most exciting challenges of my career thus far. As I listened to the FLOSS Weekly podcast <a href="http://twit.tv/floss23" target="_blank" rel="noopener">episode on YUI</a> back in 2008, if you told me I’d one day be working on that project, I would have laughed in your face.</p><p>I have a ways to go before I feel I’m at the level a YUI’er should be, but I can’t wait to get started.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;http://www.professionalsofttech.com/wp-content/uploads/2014/04/yui.png&quot; alt=&quot;&quot;&gt;&lt;br&gt;It seems like just yesterday I &lt;a href=&quot;http://derek.io/blog/2009/im-a-yahoo/&quot;&gt;accepted a position&lt;/a&gt; with Yahoo and began a new adventure. These last 18 months have been an incredibly exciting time in my life, and am very thankful to have been given the opportunity. I can confidently say that Yahoo is -the- best place to work as a front-end engineer.&lt;/p&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
    
      <category term="Yahoo" scheme="http://derek.io/blog/tags/Yahoo/"/>
    
      <category term="JavaScript" scheme="http://derek.io/blog/tags/JavaScript/"/>
    
      <category term="yui" scheme="http://derek.io/blog/tags/yui/"/>
    
  </entry>
  
  <entry>
    <title>The Engineer</title>
    <link href="http://derek.io/blog/2011/the-engineer/"/>
    <id>http://derek.io/blog/2011/the-engineer/</id>
    <published>2011-05-31T08:00:46.000Z</published>
    <updated>2019-09-26T18:01:49.001Z</updated>
    
    <content type="html"><![CDATA[<p>According to <a href="http://en.wikipedia.org/wiki/Engineering" target="_blank" rel="noopener">Wikipedia</a>, Engineering is…</p><blockquote><em>“…the discipline, art and profession of acquiring and applying scientific, mathematical, economic, social, and practical knowledge to design and build structures, machines, devices, systems, materials and processes that safely realize solutions to the needs of society.”</em></blockquote><a id="more"></a><p>This morning I was watching <a href="http://news.cnet.com/8301-13577_3-20023018-36.html" target="_blank" rel="noopener">Carol Bartz’s interview</a> at the Web 2.0 Summit, and John Battelle asked her the question about acquiring engineering talent in the software/web world. When he asked that question, I stopped what I was doing and focused on the conversation because it’s important to me that our CEO understands what motivates us. If she doesn’t “get” it, then the company has a serious problem. Here was her answer:</p><p>“<em>[Engineers] want a really interesting job to do, they want to have the tools to do it, they want to work on large data sets and large problems, and [Yahoo] has that.</em>“</p><p>Exactly what I wanted to here. And it’s not just lip-service, there is really awesome stuff we’re working on at the moment, things that haven’t been done elsewhere, so it is clear she does get it.</p><p>Then, a theme began to emerge for the day. A friend that works in developer relations at HP/Palm tweeted…</p><p><a id="more"></a><a id="more-966"></a></p><p><img title="@adora: One of my greatest pleasures in life is giving developers interesting problems to solve" src="http://s89997654.onlinehome.us/screencaps/skitched-20101116-223758.jpg" alt=""></p><p>And that’s what makes <a href="http://twitter.com/adora" target="_blank" rel="noopener">Lisa</a> great at what she does, she understands developers very well. She knows what makes us tick.</p><p>I work with an engineer (<a href="http://twitter.com/danbeam" target="_blank" rel="noopener">@danbeam</a>) is so compulsive with solving problems that sometimes just to mess with him I’ll say “<em>I bet you can’t figure this out</em>.” I know that after 30 seconds of resisting, he has no choice but to drop everything and focus on solving it. Seriously, it works every time, it’s pretty funny. We once spent hours battling back &amp; forth trying to generate the shortest shell script that will output every Friday the 13th. Why? Because it was Friday the 13th and we were curious. (Solution: <em>echo -e {$((2e5)).1}13\n|date -f-|grep ^F</em>)</p><p>I am obviously not immune to it myself. Recently, a friend sent me a link to the <a href="http://seatgeek.com/blog/hiring/henceforth-all-job-applicants-must-hack-into-our-backend" target="_blank" rel="noopener">SeatGeek applicant hacking challenge</a>, I had no choice but to drop what I was doing and “hack” into the system even though I’m happily employed. 15 minutes later, mission accomplished, back to work. It was fun for a few minutes, and I learned a couple things. (Tip: Try using nothing but cURL. Using a browser is cheating)</p><p>Solving these little problems is what keeps the engineer occupied. It is our form of entertainment. But if you are working with engineers, you don’t want them to simply be entertained, you want them to be inspired. You want them so full of determination that they’ll stop at nothing to figure out a solution. How do you do that? Give them something that isn’t possible. That’s like a mother telling her 13 year old son he can’t do something. Oh yeah? Watch. (sorry mom!)</p><p>For instance, last year I wanted to figure out the best method to do OAuth using nothing but client-side JavaScript. It can’t actually be impossible to do, can it? After a few weeks of hacking around, I came up with a solution and wrote a post about it, <a href="http://derek.io/blog/2010/how-to-secure-oauth-in-javascript/">How-to: Secure OAuth in JavaScript</a>. Yeah, it is using a proxy (YQL), but my code is all JS and I can host it anywhere. Close enough.</p><p>There was little practical reason for doing it, other than I just wondered how it could be done. There is a lot to learn by challenging yourself to do something you don’t know how to do. The biggest lesson I learned from that project was to quit trying to coerce a library into doing something for you it wasn’t intended to do. It’s usually quicker to sack up, read the spec, and write a solution yourself. Me &amp; the <a href="http://oauth.net/core/1.0/" target="_blank" rel="noopener">OAuth 1.0 spec</a> are like best buddies now.</p><p>Anyways, later on that same day, yet another relevant tweet rolled across my timeline…</p><p><img title="@BeOurGuestMike: #nasatweetup shows me each and every day how important it is to share with my students the passion of doing the once " src="http://s89997654.onlinehome.us/screencaps/Twitter___%40Mike_Rahlmann__%23nasatweetup_shows_me_each_...-20101116-224559.jpg" alt=""></p><p>That, is an excellent teacher. I’m a huge science nerd, and the NASA tweet reminded me of my favorite scene from Apollo 13. Yes, I’m so nerdy that the scene where the engineers save the day is my favorite. In it, the crippled Lunar Module is flying back to Earth when engineers determine that the astronauts may soon die of carbon dioxide poisoning unless they devise a solution.</p><p>Here’s the clip…</p><iframe src="http://www.youtube.com/embed/Z3csfLkMJT4" frameborder="0" width="560" height="349"></iframe><p>Those are the moments the engineer lives for. Solving interesting problems keep us occupied. Solving impossible problems is why we’re engineers.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;According to &lt;a href=&quot;http://en.wikipedia.org/wiki/Engineering&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Wikipedia&lt;/a&gt;, Engineering is…&lt;/p&gt;
&lt;blockquote&gt;&lt;em&gt;“…the discipline, art and profession of acquiring and applying scientific, mathematical, economic, social, and practical knowledge to design and build structures, machines, devices, systems, materials and processes that safely realize solutions to the needs of society.”&lt;/em&gt;&lt;/blockquote&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
    
      <category term="engineering" scheme="http://derek.io/blog/tags/engineering/"/>
    
  </entry>
  
  <entry>
    <title>Google Shutting Down the Translate API</title>
    <link href="http://derek.io/blog/2011/google-shutting-down-the-translate-api/"/>
    <id>http://derek.io/blog/2011/google-shutting-down-the-translate-api/</id>
    <published>2011-05-28T02:55:19.000Z</published>
    <updated>2019-09-26T18:01:49.000Z</updated>
    
    <content type="html"><![CDATA[<p>When I have conversations with people about what excites me in technology today, I usually start with the fact that the Web is breaking down barriers in a way we’ve never experienced before.  It is simply amazing that anyone is free to publish anything they want whenever they want, and is it instantly available for global consumption.</p><a id="more"></a><p>Today, <a href="http://www.bulawayo24.com/index-id-news-sc-international-byo-966-article-More+than+2+billion+people+use+the+internet.html" target="_blank" rel="noopener">2 billion people are on the internet</a>.  That means nearly a third of the world’s population has access to Wikipedia, Google, Yahoo, Twitter, Facebook, etc…  The Web has finally given us the chance to globally communicate.  The only thing restricting us at this point isn’t a technical barrier, but instead is a language barrier. Linguists estimate there are between 5,000-6,000 currently spoken languages on the planet.  Yet, very few of us speak more than one or two of those.  More than ever we need free &amp; accessible ways to easily translate between languages, allowing us to communicate with a global audience.</p><p>Since 2008, we’ve have that.  The <a href="https://code.google.com/apis/language/translate/overview.html" target="_blank" rel="noopener">Google Translate API</a>.  It’s an API (application programming interface) that allows you to programmatically send text to Google, and they will translate it for you, for free.  It’s an amazingly useful service that I have in <a href="http://tweenky.com" target="_blank" rel="noopener">one of my Twitter clients</a> to instantly translate any tweets I can’t read.</p><p>Sadly, yesterday they posted this message on the API’s page.</p><blockquote><p>Important: The Google Translate API has been officially deprecated as of May 26, 2011. Due to the substantial economic burden caused by extensive abuse, the number of requests you may make per day will be limited and the API will be shut off completely on December 1, 2011. For website translations, we encourage you to use the Google Translate Element.</p></blockquote><p></p><p>In other words… “This is why we don’t have nice things”</p><p>Very disappointing, especially for a company who set out to “Organize the World’s Information” a decade ago.  One would assume the goal of organizing is to make it accessible.  Guess not.</p><p>When Google implemented the <a href="http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html" target="_blank" rel="noopener">Speech Input API</a> in Chrome, my mind instantly blew up with ideas.  I loved knowing that we were so close to having an application for your mobile device that allows you to say something, and it will instantly start translating it into text of any language.</p><p>Here’s an example of how easy it could be.</p><pre>&lt;html&gt;    &lt;input type=&quot;text&quot; id=&quot;foo&quot; speech&gt;    &lt;textarea id=&quot;translation&quot;&gt;&lt;/textarea&gt;    &lt;script src=&quot;https://www.google.com/jsapi&quot;&gt;&lt;/script&gt;    &lt;script type=&quot;text/javascript&quot;&gt;        function translate() {            google.load(&quot;language&quot;, &quot;1&quot;);            google.setOnLoadCallback(function() {                var native_text     = document.getElementById(&#039;foo&#039;).value;                var native_language = &quot;en&quot;; //english                var target_language = &quot;es&quot;; //spanish                google.language.translate(native_text, target_language, native_language, function(result) {                    document.getElementById(&quot;translation&quot;).innerHTML = result.translation;                });            });        }        document.getElementById(&quot;foo&quot;).addListener(&quot;change&quot;, translate);    &lt;/script&gt;&lt;/html&gt;</pre><p>You could solve a problem humans have had for thousands of years, in about 5 lines of JavaScript code.</p><p>Well, starting Dec 1st, 2011, you’ll have to use another service.</p><p>There’s no doubt in my mind we’ll get this type of capability in the near future, I’m just disappointed Google decided it didn’t want to be involved in solving these kinds of real, human problems.</p><p>Hopefully Google reconsiders this decision. To help, go post a comment on the <a href="http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html" target="_blank" rel="noopener">Google Code blog</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;When I have conversations with people about what excites me in technology today, I usually start with the fact that the Web is breaking down barriers in a way we’ve never experienced before.  It is simply amazing that anyone is free to publish anything they want whenever they want, and is it instantly available for global consumption.&lt;/p&gt;
    
    </summary>
    
      <category term="Technology" scheme="http://derek.io/blog/categories/Technology/"/>
    
    
      <category term="Google" scheme="http://derek.io/blog/tags/Google/"/>
    
      <category term="JavaScript" scheme="http://derek.io/blog/tags/JavaScript/"/>
    
      <category term="language" scheme="http://derek.io/blog/tags/language/"/>
    
  </entry>
  
  <entry>
    <title>Twitter vs Ecosystem</title>
    <link href="http://derek.io/blog/2011/twitter-vs-ecosystem/"/>
    <id>http://derek.io/blog/2011/twitter-vs-ecosystem/</id>
    <published>2011-03-15T16:35:19.000Z</published>
    <updated>2019-09-26T18:01:49.000Z</updated>
    
    <content type="html"><![CDATA[<p>So Twitter is once again in some hot water with their developer community.  After a well-intentioned, but poorly executed suggestion to their developer community that they stop working on developing clients and instead work on “vertical” ideas, the feedback they’ve received has been less than ideal.  You can read the original post at “<a href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/c82cd59c7a87216a/b63072f6aff82db0" target="_blank" rel="noopener">consistency and ecosystem opportunities</a>“, and some of the media coverage <a href="http://mashable.com/2011/03/12/twitter-api-clients/" target="_blank" rel="noopener">here</a>, <a href="http://techcrunch.com/2011/03/11/twitter-ecosystem-guidelines/" target="_blank" rel="noopener">here</a>, and <a href="http://thenextweb.com/twitter/2011/03/14/twitter-explains-why-developers-shouldnt-build-new-clients/" target="_blank" rel="noopener">here</a>.</p><a id="more"></a><p>Some developers are understanding, others are irate, and many are still pretty confused about what exactly this all means.  I guess I’d put myself in the 3rd (“confused”) group.  But I guess the one thing I do know, is that it is clear these “suggestions” and TOS updates are directed at UberMedia in order to prevent them from forking their portion of the Twitter user base.  But, now the rest of the community has now unfairly been dragged into the mix.</p><p>As someone who has been doing development on Twitter-related projects since 2007, I figured I’d throw my 2 cents into the mix and give Twitter an idea of where they went wrong, and how they can fix it.  I figured it was worth a repost here on my blog.</p><p><a href="http://groups.google.com/group/twitter-development-talk/msg/34ae2fac254d1bac" target="_blank" rel="noopener">Link to post.</a></p><blockquote>My 2 cents…<br><br>The reason for the perceived mixed messages for some of us is because many developers don’t, and never have been interested in doing Twitter development as a business.  I’ve created a dozen Twitter clients &amp; apps over the last 5 years, some of which received enough users and press coverage that I could have attempted to turn it into a business, but I didn’t. Why? Because it doesn’t interest me. I do it for the challenge and the learning experience.<br><br>So, the things we hear Twitter saying are “Don’t build clients anymore” as well as “Client apps make bad business”.  Well, first, as long as the APIs are active and it’s not against the TOS, I’m still going to build, develop, and use my own clients.  Second, I don’t care that it makes “bad business”, that’s isn’t a concern to me.  Third, developers can determine for themselves what seems like a smart business decision or not.  Fourth, frankly, Twitter Inc has never been regarded as an expert in monetization strategies.<br><br>Plus, this is info we already knew.  For the most part, building a company whose main product is a Twitter client hasn’t been a good business decision for a few years (if ever, outside of a lucky few).  But on the other hand, there are still markets where it could be good business.  For example, where is the official Twitter client for webOS?  Messages like “Don’t build clients anymore” and no official Twitter app on webOS does nothing but hurt the ecosystem for thousands of users.  If I were a developer for one of the popular webOS clients, I’d be pretty pissed right now.  Heck, as a webOS user I’m not thrilled.  I’m sure this is applicable to other ecosystems too.<br><br>The point is, Twitter should be more vocal about what it is going to do as opposed to coy suggestions to developers (which some perceive as threats) about what they shouldn’t do.  Twitter is going to heavily focus on front-end user experiences across all platforms? Great! Leave it at that.  Let developers decide for themselves what are good/bad ideas.  Just arm us with the knowledge of your plans, and we’ll worry about our own.<br><br>Finally, Twitter, you should be excited to compete with your developers. Much of the innovation over the years has been a product of the developer &amp; user community.  Things like mentions &amp; hashtags came from your users.  Features like saved searches, lists, trends, and ajax driven clients were inventions of developers years before they made it into Twitter.com.  Essentially, “New” Twitter is just a compilation of the best features from all the 3rd party clients.  Do not be hostile.  Do not attack them with your TOS.  Do not suspend tokens without working with the developer first.  Doing these things hurts the community, which in turn hurts you.  Your users are your product.  Not your platform.  Not your website.  Not your ads.  Your users.<br><br>- @derek</blockquote>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;So Twitter is once again in some hot water with their developer community.  After a well-intentioned, but poorly executed suggestion to their developer community that they stop working on developing clients and instead work on “vertical” ideas, the feedback they’ve received has been less than ideal.  You can read the original post at “&lt;a href=&quot;http://groups.google.com/group/twitter-development-talk/browse_thread/thread/c82cd59c7a87216a/b63072f6aff82db0&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;consistency and ecosystem opportunities&lt;/a&gt;“, and some of the media coverage &lt;a href=&quot;http://mashable.com/2011/03/12/twitter-api-clients/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://techcrunch.com/2011/03/11/twitter-ecosystem-guidelines/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;here&lt;/a&gt;, and &lt;a href=&quot;http://thenextweb.com/twitter/2011/03/14/twitter-explains-why-developers-shouldnt-build-new-clients/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
    
    </summary>
    
      <category term="Technology" scheme="http://derek.io/blog/categories/Technology/"/>
    
    
      <category term="twitter" scheme="http://derek.io/blog/tags/twitter/"/>
    
  </entry>
  
  <entry>
    <title>Installing npm on webOS 2.0</title>
    <link href="http://derek.io/blog/2010/installing-npm-on-webos-2-0/"/>
    <id>http://derek.io/blog/2010/installing-npm-on-webos-2-0/</id>
    <published>2010-11-28T18:30:15.000Z</published>
    <updated>2019-09-26T18:01:49.001Z</updated>
    
    <content type="html"><![CDATA[<p><img class="alignright" title="NPM + webOS" src="http://s89997654.onlinehome.us/screencaps/Photoshop-20101125-233609.jpg" alt="NPM + webOS" width="268" height="187"> Now that webOS 2.0 ships with Node.js, one of the first things I tried to do when I got the webOS 2.0 SDK a while back was get <a href="http://npmjs.org/" target="_blank" rel="noopener">npm</a> installed.  While successful, it took a little bit of work, so figured it was worth a post to help aid anyone else trying to get it installed.  For those that aren’t familiar with npm, it is a package manager for Node.js (<strong>N</strong>ode <strong>P</strong>ackage <strong>M</strong>anager).</p><a id="more"></a><p>In short, it’s a easiest way to get Node.js modules installed on your system.  It is Node’s equivalent to Ruby’s Gems, Ubuntu’s APT, PHP’s PEAR, and Perl’s CPAN.  So instead of manually downloading libraries/modules, explicitly including them in your source code, and having to manually resolve dependency issues, you can just let npm handle that for you.  Now, installing a new module is as easy as typing <strong><code>npm install &lt;module&gt;</code></strong>.  The version of Node.js that webOS 2.0 ships with (at the moment) is v0.1.102, which is rather old.  The build scripts for the latest npm installer does not work with older versions of Node.js, so with trial and error, the most recent version I’ve been able to install on webOS 2.0 is npm v0.1.23.  Luckily it’s pretty easy to install that specific version, so here’s how you do it on your webOS device.</p><p><script src="https://gist.github.com/708091.js"></script>If you are looking for a list of packages, check out <a href="http://npm.mape.me/" target="_blank" rel="noopener">http://npm.mape.me/</a>. Or, you can just type <strong><code>npm ls</code></strong>.  Are there any plans for npm to be included in webOS? HP/Palm engineers confirmed at the webOS Developer Day event a few weeks ago that there are no plans for npm to ship with webOS.  That’s fine with me.  Modules should be included in the application package anyways.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img class=&quot;alignright&quot; title=&quot;NPM + webOS&quot; src=&quot;http://s89997654.onlinehome.us/screencaps/Photoshop-20101125-233609.jpg&quot; alt=&quot;NPM + webOS&quot; width=&quot;268&quot; height=&quot;187&quot;&gt; Now that webOS 2.0 ships with Node.js, one of the first things I tried to do when I got the webOS 2.0 SDK a while back was get &lt;a href=&quot;http://npmjs.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;npm&lt;/a&gt; installed.  While successful, it took a little bit of work, so figured it was worth a post to help aid anyone else trying to get it installed.  For those that aren’t familiar with npm, it is a package manager for Node.js (&lt;strong&gt;N&lt;/strong&gt;ode &lt;strong&gt;P&lt;/strong&gt;ackage &lt;strong&gt;M&lt;/strong&gt;anager).&lt;/p&gt;
    
    </summary>
    
      <category term="Web Development" scheme="http://derek.io/blog/categories/Web-Development/"/>
    
    
      <category term="webos" scheme="http://derek.io/blog/tags/webos/"/>
    
      <category term="npm" scheme="http://derek.io/blog/tags/npm/"/>
    
      <category term="nodejs" scheme="http://derek.io/blog/tags/nodejs/"/>
    
  </entry>
  
  <entry>
    <title>Maximize Serendipity</title>
    <link href="http://derek.io/blog/2010/maximize-serendipity/"/>
    <id>http://derek.io/blog/2010/maximize-serendipity/</id>
    <published>2010-10-26T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:49.000Z</updated>
    
    <content type="html"><![CDATA[<p><img src="https://i.imgur.com/pnGHsrq.png" alt="Serendipity"></p><p>Since I came across Paul Buccheit’s “<a href="http://paulbuchheit.blogspot.com/2010/10/serendipity-finds-you.html" target="_blank" rel="noopener">Serendipity Finds You</a>“ blog post yesterday, it has been difficult to stop thinking about it. It’s a great read, so definitely go check it out. Go ahead, I’ll wait. While you are at it, read through the <a href="http://news.ycombinator.com/item?id=1826666" target="_blank" rel="noopener">Hacker News comments</a> on the article, they are just as enlightening as the article itself.<br><a id="more"></a><br>For those of you that don’t know, Paul is an engineer at Facebook, and has had extraordinary success in his relatively young career. As one of the early employees at Google, he was in at the ground floor of one of the most successful companies of the last decade, and he was one of the reasons for their ginormous success. It almost seems unreal when you hear that one single person came up with GMail, AdSense (Google’s primary source of revenue), and their famous “Don’t be evil” motto. That is quite a trifecta. Paul eventually left Google to co-found Friendfeed, which was acquired by Facebook.</p><p>You’d probably say Paul has been lucky in his career, and he may agree with you to an extent. However, there are various interpretations of what defines “luck”. Crediting his success to mere random chance discredits Paul’s knack for putting himself in fortunate positions. Some peoples’ version of “luck” is when opportunity meets preparation, and they pounce.</p><p>I’m not even going to try to compare my career to Paul’s here, they’re on completely different levels. But what I will say is that in my mind I have achieved a level of success in my career that I am happy with, so far. When I look back at what brought me to my current position, it has been a series of events that separately, seem pretty random. In reality though, they are all woven together by a continued pursuit towards things in life that I am passionate about. One, leading to the next, leading to the next, leading…</p><ol><li>I started playing soccer at the age of 5 and didn’t slow down until 10 years later, so soccer is something that I loved growing up. <em>(Thanks for your encouragement Mom &amp; Dad)</em></li><li>That interest in soccer turned me into a rabid Kansas City Wizards fan and a member of their supporters group. <em>(Thanks for your passion Sam)</em></li><li>As a side-project we created a non-profit advocacy organization, Heart of America Soccer Foundation. We needed a website, so I volunteered my time to create one. The result of that was the <a href="http://hoasoccer.org/" target="_blank" rel="noopener">hoasoccer.org</a> website, and that was first website that really demonstrated my skills as a web developer. <em>(Thanks for your help Chad)</em></li><li>When I interviewed for my first programming job out of school, I had <em>just</em> completed the <a href="http://hoasoccer.org/" target="_blank" rel="noopener">hoasoccer.org</a> website, and was able to use that as evidence that I knew how to webdev. That evidence was key to me being hired. <em>(Thanks for your confidence Hillary)</em></li><li>Fast forward a few years, a friend of mine from the Wizards games became a web designer and we occasionally did freelance work together. One client we did work for eventually hired me as the lead developer for his new company because of my experience in the startup world. <em>(Thanks for your entrepreneurial spirit Jeff)</em></li><li>It was at that startup where I convinced my boss that sending me to Zendcon ‘08 would be well worth the expense. He agreed, so off I went. <em>(Thanks for your generosity Fred)</em></li><li>That just so happened to be the weekend of Yahoo! Open Hackday ‘08. It was at that hackday on the Y! campus where I met the recruiter who eventually got me into the interview process and hired. More details @ <a href="/blog/2010/return-to-sunnyvale/">Return to Sunnyvale</a>. <em>(Thanks for the opportunity Shawn)</em></li></ol><p>So, this all began with a 5 year old chasing a ball around a soccer field?  Well, that is certainly one interpretation.</p><p>Often times in life, you might not know what awaits you at the end of a journey. But as long as the roads are leading to fun &amp; challenging adventures, you are doing something right. Keep doing it, and do more of it when you can. We are naturally driven towards what we seek, even unconsciously. If you seek nothing, you’ll find nothing. Serendipity is everywhere, so maximize your chances of finding it.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;https://i.imgur.com/pnGHsrq.png&quot; alt=&quot;Serendipity&quot;&gt;&lt;/p&gt;
&lt;p&gt;Since I came across Paul Buccheit’s “&lt;a href=&quot;http://paulbuchheit.blogspot.com/2010/10/serendipity-finds-you.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Serendipity Finds You&lt;/a&gt;“ blog post yesterday, it has been difficult to stop thinking about it. It’s a great read, so definitely go check it out. Go ahead, I’ll wait. While you are at it, read through the &lt;a href=&quot;http://news.ycombinator.com/item?id=1826666&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hacker News comments&lt;/a&gt; on the article, they are just as enlightening as the article itself.&lt;br&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Secure OAuth in JavaScript</title>
    <link href="http://derek.io/blog/2010/secure-oauth-in-javascript/"/>
    <id>http://derek.io/blog/2010/secure-oauth-in-javascript/</id>
    <published>2010-10-21T15:33:51.000Z</published>
    <updated>2019-09-26T18:01:48.999Z</updated>
    
    <content type="html"><![CDATA[<p>Wouldn’t it be awesome if we could use OAuth in JavaScript-only apps? JS is a powerful, expressive programming language, and the browser engines are getting <a title="arewefastyet.com" href="http://arewefastyet.com/" target="_blank" rel="noopener">faster and faster all the time</a>. Why not use JavaScript to conduct your API calls and parse your data? In many cases, it is unnecessary to maintain a server-side proxy if all it is doing is making API calls for you and hiding your OAuth keys.</p><a id="more"></a><p>Think about this… If you don’t need any server-side processing, your applications suddenly become infinitely scaleable, right? We could host on the cheapest of cheap commodity hosting. Heck, if all we’re doing is serving static HTML/CSS/JS files, just throw it on a CDN like S3 or CloudFiles and pay per GB.</p><p>Before you get too excited, realize that there is a fundamental problem with OAuth in JS. Because JavaScript in the browser is “view-source”, you are always forced to expose your consumer key pair, which compromises the security of your application. <em>sigh</em></p><p>For example, when Twitter recently deprecated their Basic Auth services, that left OAuth as the only authentication method. It was supposed to be <a title="OAuth-only Twitter: What it Means for JavaScript Apps" href="http://blog.programmableweb.com/2010/08/31/oauth-only-twitter-what-it-means-for-javascript-apps/" target="_blank" rel="noopener">the death of JS-only Twitter apps</a>. This was unfortunate for quite a few developers who leveraged the browsers ability to do Basic auth, to help with scaling their Twitter apps. I know, I was one of them.</p><p>So then I began to think what if you weren’t forced to expose your keys? What if your JS app could talk to any web API out there, in a secure, user-authenticated way?</p><p>Is that actually possible? Yup.</p><p><strong><a id="more"></a><a id="more-780"></a>Backstory</strong></p><p>Unknowingly at the time, my quest for a JS only OAuth app began two years ago.</p><p>When TechCrunch covered <a href="http://techcrunch.com/2008/07/24/tweenky-brings-gmails-good-looks-to-twitter/" target="_blank" rel="noopener">the launch of my Twitter client</a>, the app pretty quickly died from the traffic they were sending my way. The problem is 90% of it was written in PHP and used a relational database to store waaaaaay to much data. Neither of them were designed to scale to 20k users in just a few minutes. After days of tweaking and optimizing, I finally gave up on the design. I realized I didn’t need PHP to parse the data, or a database to host the data, so I began a rewrite with the goal of removing as much server-side code as possible. I threw away the database, moved off expensive EC2 and onto commodity hosting where it worked great for the next year or so with some occasional tweaking. As hard as I tried, I never thought I’d be able to completely get rid of the backend because I needed a proxy to securely handle the OAuth requests to Twitter. “That’s ok, close enough” I thought.</p><p>One day I was reading the Yahoo Query Language <a href="http://developer.yahoo.com/yql/guide/" target="_blank" rel="noopener">documentation</a>, and I came across a section about using YQL’s storage API to hide authentication info to be used in your queries. Ah ha! Could I actually use that for OAuth? I set to find out. I began learning the ins &amp; outs of OAuth, which includes reading <a href="http://tools.ietf.org/html/rfc5849" target="_blank" rel="noopener">RFC 5849: The OAuth 1.0 Protocol</a> many, many times, and staring at the <a href="http://p2p.wrox.com/content/sites/default/files/users/17/image/figures%20ch6/531327%20f0602.png" target="_blank" rel="noopener">OAuth Authentication Flow diagram</a> for loooooong time. By the end of the weekend, I had successfully modified my recently rewritten Twitter client’s code-base (now YUI3 based) to remove all server-side programming.</p><p>Finally! A secure, pure JavaScript solution to OAuth.</p><p><strong>Some Prep Work</strong></p><p>So let’s crack the code of what is necessary to do OAuth securely in JavaScript.</p><p><ul><br>    <li>You cannot store your consumer keys inside your JS code. Not even obfuscated. But it has to be stored somewhere web-accessible so your JS code can talk to it.</li><br>    <li>Because of the same-origin policy, that ‘somewhere’ has to be the same domain as your JS app. Unless of course you only rely on HTTP GET, in which case you can do JSONP.</li><br>    <li>Your storage location cannot transmit your consumer key pair back to you. So that means it needs to do the OAuth request on your behalf.</li><br></ul><br>So hmm…. what is web accessible, can talk to APIs, and also has data storage? YQL.</p><p><strong>Yahoo Query Language</strong></p><p><img style="float: left; margin: 0px 10px 10px 0px;" src="http://farm3.static.flickr.com/2601/3858500752_9c3a39e4af.jpg" alt="" width="100"></p><p><a title="Yahoo Query Language" href="http://developer.yahoo.com/yql/" target="_blank" rel="noopener">YQL</a> is an expressive SQL-like language that lets you query, filter, and join data across web servers. Along with YUI, it is by far my favorite product Yahoo has for developers. Both are simply amazing tools. I won’t go into detail on the specifics of what YQL is in this post, and instead point you to slides from one of my recent talks on the subject <a href="http://drgath.github.com/talks/20101011_SoCaljs/index.html" target="_blank" rel="noopener">here</a> (best viewed in Chrome). All you need to know for this post is that you can use it to access any web-accessible API. In the case of this post, we’ll talk to the Twitter API.</p><p>So now that we know it is possible, let’s see it in action.</p><p><strong>How It Works</strong></p><p>First let’s take a look at how you would call your Twitter friends timeline via YQL w/ OAuth. Using my @derektest user, I created a new OAuth app at <a href="http://dev.twitter.com" target="_blank" rel="noopener">dev.twitter.com</a> and used the keys it generated for my user/app combo to generate this YQL query.</p><p><pre lang="sql">SELECT <em> FROM twitter.status.timeline.friends<br>WHERE oauth_consumer_key = ‘9DiJt6Faw0Dyr61tVOATA’<br>AND oauth_consumer_secret = ‘XBF9j0B2SZAOWg44QTu6fCwYy5JtivoNNpvJMs6cA’<br>AND oauth_token = ‘18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y’<br>AND oauth_token_secret = ‘D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI’;</em></pre><br>So take that query, URL encode it, and throw it into a URL querystring. Like so…<br><a href="https://query.yahooapis.com/v1/public/yql?q=select%20" target="_blank" rel="noopener">https://query.yahooapis.com/v1/public/yql?q=select%20</a>%20from%20twitter.status.timeline.friends%20where%20oauth_consumer_key%20%3D%20’9DiJt6Faw0Dyr61tVOATA’%20AND%20oauth_consumer_secret%20%3D%20’XBF9j0B2SZAOWg44QTu6fCwYy5JtivoNNpvJMs6cA’%20AND%20oauth_token%20%3D%20’18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y’%20and%20oauth_token_secret%20%3D%20’D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI’%3B&amp;diagnostics=true&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys</p><p>That unique URL will give you a list of the people @derektest follows (which is only @derek). You can play around with the query in the <a href="https://developer.yahoo.com/yql/console/?q=select%20*%20from%20twitter.status.timeline.friends%20where%20id%3D1972%3B&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys#h=select%20*%20from%20twitter.status.timeline.friends%20where%20oauth_consumer_secret%20%3D%20%27foo%27%20AND%20oauth_consumer_key%20%3D%20%27bar%27%20AND%20oauth_token%20%3D%20%27baz%27%20and%20oauth_token_secret%20%3D%20%27biz%27%3B" target="_blank" rel="noopener">YQL Console</a>, or view the results in an <a href="https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20twitter.status.timeline.friends%20where%20oauth_consumer_key%20%3D%20'9DiJt6Faw0Dyr61tVOATA'%20AND%20oauth_consumer_secret%20%3D%20'XBF9j0B2SZAOWg44QTu6fCwYy5JtivoNNpvJMs6cA'%20AND%20oauth_token%20%3D%20'18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y'%20and%20oauth_token_secret%20%3D%20'D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI'%3B&amp;diagnostics=true&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" target="_blank" rel="noopener">XML feed</a>.</p><p>But there’s a problem using that query, because? You guessed it, you’ve exposed your consumer key-pair. So let’s work on hiding those.</p><p>First step, turn the embedded parameters into environment variables by using the <em>SET</em> command.</p><p><pre lang="sql">set oauth_consumer_key=’9DiJt6Faw0Dyr61tVOATA’ on twitter;<br>set oauth_consumer_secret=’XBF9j0B2SZAOWg44QTu6fCwYy5JtivoNNpvJMs6cA’ on twitter;<br>set oauth_token=’18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y’ on twitter;<br>set oauth_token_secret=’D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI’ on twitter;<br>select * from twitter.status.timeline.friends;</pre><br>Now that we’ve turned all the parameters into environment variables, the next step is to throw the consumer key pair into YQL’s storage so only YQL can access it.</p><p>To do this, create a YQL environment file, similar to this one, <a href="http://derekgathright.com/code/yahoo/yql/oauthdemo.txt" target="_blank" rel="noopener">http://derekgathright.com/code/yahoo/yql/oauthdemo.txt</a></p><p>As you’ll see, it’s just a regular text file where I pasted my consumer key pair, along with importing the YQL community tables using the <em>ENV</em> command. Since we’re replacing the previously included env file (store://datatables.org/alltableswithkeys) with our own, we need to chain-load it back in because it includes the Twitter tables. If you miss that step, you’ll get a “<em>No definition found for Table twitter.status.timeline.friends</em>“ error.</p><p>Before we store the env file in YQL, let’s test it with this new query:</p><p><pre lang="sql">set oauth_token=’18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y’ on twitter;<br>set oauth_token_secret=’D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI’ on twitter;<br>select * from twitter.status.timeline.friends;</pre><br>Also, you’ll have to change the env file loaded in the querystring to “<em>?env=<a href="http://derekgathright.com/code/yahoo/yql/oauthdemo.txt" target="_blank" rel="noopener">http://derekgathright.com/code/yahoo/yql/oauthdemo.txt</a></em>“</p><p>(<em>View: <a href="https://developer.yahoo.com/yql/console/?env=http://derekgathright.com/code/yahoo/yql/oauthdemo.txt#h=set%20oauth_token%3D%2718342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y%27%20on%20twitter%3B%0Aset%20oauth_token_secret%3D%27D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI%27%20on%20twitter%3B%0A%0Aselect%20*%20from%20twitter.status.timeline.friends%3B&amp;q=set%20oauth_token%3D%2718342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y%27%20on%20twitter%3B%0Aset%20oauth_token_secret%3D%27D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI%27%20on%20twitter%3B%0A%0Aselect%20*%20from%20twitter.status.timeline.friends%3B" target="_blank" rel="noopener">YQL Console</a> - <a href="https://query.yahooapis.com/v1/public/yql?q=set%20oauth_token%3D'18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y'%20on%20twitter%3B%0Aset%20oauth_token_secret%3D'D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI'%20on%20twitter%3B%0A%0Aselect%20*%20from%20twitter.status.timeline.friends%3B&amp;diagnostics=true&amp;env=http%3A%2F%2Fderekgathright.com%2Fcode%2Fyahoo%2Fyql%2Foauthdemo.txt" target="_blank" rel="noopener">Results</a></em>)</p><p>Now that we have our environment file created and tested, let’s tell YQL to import it. To do that, we’ll construct a YQL query similar to:</p><p><pre lang="sql">insert into yql.storage.admin (name,url)<br>values (“oauthdemo”,”<a href="http://derekgathright.com/code/yahoo/yql/oauthdemo.txt&quot;" target="_blank" rel="noopener">http://derekgathright.com/code/yahoo/yql/oauthdemo.txt&quot;</a>)</pre><br>Which returns:</p><p><pre lang="xml"><br>       store://derekgathright.com/oauthdemo</pre></p><select>store://VfoIoYWhLWLxYzRTcrbvNb</select><pre><code>[hidden]&lt;/pre&gt;</code></pre><p>You now have 3 keys pointing to your data, and each does something different (think: unix permissions, R/W/X). For more information on what each of the 3 does, <a href="http://developer.yahoo.com/yql/guide/yql-storage-select-update-delete.html" target="_blank" rel="noopener">Using YQL to Read, Update, and Delete Records</a>.</p><p>For this example we want the <em>execute</em> key, which is really just an alias to our stored env file. So if we change our query’s URL to <em>?env=store://derekgathright.com/oauthdemo</em> and use the same YQL query as last time, you’ll see we have now hidden our consumer key pair from the public.</p><p>(View: <a href="https://developer.yahoo.com/yql/console/?env=store://derekgathright.com/oauthdemo#h=set%20oauth_token%3D%2718342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y%27%20on%20twitter%3B%0Aset%20oauth_token_secret%3D%27D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI%27%20on%20twitter%3B%0A%0Aselect%20*%20from%20twitter.status.timeline.friends%3B" target="_blank" rel="noopener">YQL Console</a> - <a href="https://query.yahooapis.com/v1/public/yql?q=set%20oauth_token%3D'18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y'%20on%20twitter%3B%0Aset%20oauth_token_secret%3D'D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI'%20on%20twitter%3B%0A%0Aselect%20*%20from%20twitter.status.timeline.friends%3B&amp;diagnostics=true&amp;env=store%3A%2F%2Fderekgathright.com%2Foauthdemo" target="_blank" rel="noopener">Results</a>)</p><p>Well there you have it, an example of how to hide your consumer key pair, which now allows you to use YQL as your server-side proxy as opposed to writing &amp; maintaining your own!</p><p><strong>A Pure JS Twitter Client is Born</strong></p><p>When I started at Yahoo, I wanted an excuse to learn YUI3 and expand my knowledge of YQL. So porting my jQuery/PHP based Twitter client seemed like a logical choice. The result of this work is an open-source project I call <a href="http://github.com/derek/Tweetanium" target="_blank" rel="noopener">Tweetanium</a>. I’m not going to argue it is the most polished or feature-rich Twitter client. In fact, it is quite buggy, and will likely always be that way. It’s just something I toy around with occasionally to try out new things. But feel free to use it if you like. You can play around in it at <a href="http://tweetanium.net" target="_blank" rel="noopener">tweetanium.net</a>.</p><p>As proof that there is no server-side JS, you can even use <a href="http://derek.github.com/Tweetanium/docroot/" target="_blank" rel="noopener">a version of it</a> hosted on Github Pages, which is a static file host (no PHP, Ruby, Python, etc…). Hosting off Github Pages was a neat test for it, which basically proves you can host JS-only apps on commodity hosting. If you actually need to process data externally, you can use YQL tables for any APIs on the web, even your own custom-built ones (See: <a href="http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html" target="_blank" rel="noopener">YQL Open Data Tables</a>). Any scaling bottlenecks have now been offloaded to Github and Yahoo. The best part about this solution? It’s free!</p><p>Post some comments if you have questions.</p><p><strong>UPDATE:</strong> A few people have asked, “<em>But can’t I execute YQL queries with your consumer keys now?</em>“ The answer is, yes. But that isn’t as bad as you think because you only have half of the keys necessary. You are missing the unique keys assigned to a user on behalf of my application, and without those, you cannot make authenticated calls. If you get those, well… there’s a whole other security issue of you having physical access to their computer or man-in-the-middle attacks.</p><p>“<em>Ok, but can’t I authenticate new keys posing as your app?</em>“ To my knowledge, Twitter does not currently support the oauth_callback parameter, which allows the requester to Twitter to redirect the user to the URL of their choice. So if EvilHacker tries to authenticate InnocentUser using my consumer keys, InnocentUser will just be directed back to my app’s preset URL stored in Twitter’s database. In the future, who knows how the OAuth spec, or Twitter’s implementation of it, will change. This is mostly a proof-of-concept hack at this point.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Wouldn’t it be awesome if we could use OAuth in JavaScript-only apps? JS is a powerful, expressive programming language, and the browser engines are getting &lt;a title=&quot;arewefastyet.com&quot; href=&quot;http://arewefastyet.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;faster and faster all the time&lt;/a&gt;. Why not use JavaScript to conduct your API calls and parse your data? In many cases, it is unnecessary to maintain a server-side proxy if all it is doing is making API calls for you and hiding your OAuth keys.&lt;/p&gt;
    
    </summary>
    
      <category term="Unsorted" scheme="http://derek.io/blog/categories/Unsorted/"/>
    
    
  </entry>
  
  <entry>
    <title>Why YUI&#39;s Philosophy is Better</title>
    <link href="http://derek.io/blog/2010/why-yui-s-philosophy-is-better/"/>
    <id>http://derek.io/blog/2010/why-yui-s-philosophy-is-better/</id>
    <published>2010-10-21T07:00:00.000Z</published>
    <updated>2019-09-26T18:01:49.000Z</updated>
    
    <content type="html"><![CDATA[<p>I was digging through some old email today and came across a post I made to <a href="mailto:jquery-en@googlegroups.com" target="_blank" rel="noopener">jquery-en@googlegroups.com</a> back in 2007.</p><blockquote><p><em>On a side note, as I mentioned, I’m new to jQuery. In fact, my jQuery expertise goes back a full 24 hours. The website I’m coding now did use prototype and scriptaculous, but once I looked at the 1.2 version of jQuery, I knew I’d found a better solution (for me, anyways). So I spent the rest of the day recoding the site for jQuery. It was this post that convinced me I needed to change, “<a href="http://blog.jquery.com/2006/08/20/why-jquerys-philosophy-is-better/" target="_blank" rel="noopener">Why jQuery’s Philosophy is Better</a>“</em></p></blockquote><p>In the post, Yehuda Katz compares a relatively young jQuery to Prototype.js.  Rewinding back to 2007, I was a Prototype user and it was apparently that post that sold me on jQuery being a better library.  For the next 2 years I was a (mostly) happy jQuery user.</p><a id="more"></a><p>When I <a href="http://derek.io/blog/2009/im-a-yahoo/">started at Yahoo</a>, that was the beginning of my journey into the world of YUI. I was excited to learn something new, and pretty quickly learned to love the library because there is so much that it does right. Sure there’s a little big of a learning curve compared to jQuery, but if you <a href="http://www.jsrosettastone.com/" target="_blank" rel="noopener">know</a> <a href="http://yuilibrary.com/yui/docs/guides/" target="_blank" rel="noopener">where</a> <a href="http://yuilibrary.com/forum/" target="_blank" rel="noopener">to</a> <a href="http://yuitheater.com/" target="_blank" rel="noopener">look</a> <a href="http://twitter.com/yuilibrary" target="_blank" rel="noopener">for</a> <a href="http://webchat.freenode.net/?channels=yui" target="_blank" rel="noopener">help</a>, you can easily get answers to whatever questions you have. YUI has a full-time staff, and part of the team’s job is to help you with whatever issues/questions you have about the library.</p><p>Before I get started, I at least wanted to clarify something. I’m not going to make an argument that as a whole, one library is “better” than the other, they’re both good. The title of this post is mostly just an homage to Yehuda’s post that inspired me almost 5 years ago. On the first day of my “Introduction to Programming: QBASIC” course in high school, I vividly remember my teacher telling me “<em>In programming, there are a hundred ways to solve every problem. Pick the one that is best for you.</em>“ That is especially true when it comes to JavaScript libraries.</p><p>YUI and jQuery do share some similar functionality, but they approach the problem from a completely different perspective. jQuery is about simplicity and usability. YUI is about performance and scalability. Neither ignores those other qualities, they just take a backseat to the primary goal of the library.</p><p>So here we go, my list of things I like about YUI compared to jQuery. Unlike Yehuda’s post, I’m not going to focus much on specific API differences, because those can be sugared up as much as you like. Besides, just take a look at <a href="http://www.jsrosettastone.com/" target="_blank" rel="noopener">JSRosettaStone.com</a> and you’ll see that many of the APIs are very similar, if not identical.</p><p>What I will instead focus on are fundamental differences between the libraries and why I think YUI is the best JS library out there for building web pages and modern web applications.</p><h2 id="Modules"><a href="#Modules" class="headerlink" title="Modules"></a>Modules</h2><p>The biggest difference between the libraries is the organization of the code. While most other programming languages natively support packages &amp; modules, JavaScript won’t see <a href="http://wiki.ecmascript.org/doku.php?id=harmony:modules" target="_blank" rel="noopener">those</a> widely adopted in a browser for many more years. So it was left up to the developer community to create our own <a href="http://www.yuiblog.com/blog/2007/06/12/module-pattern/" target="_blank" rel="noopener">module pattern</a>.</p><p>Modules are little bits of code that serve a limited purpose and can be combined and swapped out as you see fit within your application. In one of his YUIConf talks on “<a href="http://yuilibrary.com/theater/nicholas-zakas/zakas-architecture/" target="_blank" rel="noopener">Scalable JavaScript Application Architecture</a>“, Nicholas Zakas compared this to <a href="http://images.wikia.com/astronomy/images/c/c1/ISSComponents2.jpg" target="_blank" rel="noopener">space station modules</a>, which I think is rather accurate. In order to get a space station in outer space, you don’t construct it on the ground and launch the entire thing all at once. You build it as many separate, smaller modules, launch them up, and construct it in space. You only use what you need, when you need it.</p><p>You should take the same approach when constructing your web application. Break it up into as many small bits as possible and only include exactly what you need. In doing so, you will save on download and execution time, and it will be much less cluttered. It’s just good design, and as long as you know what you are doing, there’s no limit to how small you should break up your code into modules. You can even go as far as 1 function per file. The topic of “ultra-modularization” once <a href="http://groups.google.com/group/requirejs/browse_thread/thread/a9587d4abb108869" target="_blank" rel="noopener">came up</a> on the RequireJS mailing list.</p><p>Within jQuery, you are basically including 1 super-module, jQuery itself.  There’s no (good) way to just pull jQuery’s Ajax component if that is all you need.  Too much of it is inter-dependent.  This design of course led to jQuery’s simplicity, at the risk of flexibility.  A good trade given its goal of ease-of-use.</p><p>Within YUI, all the functionality you include comes from various modules. In YUI’s core set, there are 300+ modules. Things like “Calendar”, “DD” (drag and drop), “Graphics”, etc… In the <a href="http://yuilibrary.com/gallery/" target="_blank" rel="noopener">YUI Gallery</a> (community contributed modules) contains even more than that! 431 at the time of this writing, and continually growing.</p><p>To use any of these modules, just include them in your <code>YUI().use()</code> statement.</p><p>If you don’t include any modules, by simply executing <code>YUI().use( function(Y){ } )</code>, you only start with a few core ones. Specifically: <a href="http://yuilibrary.com/yui/docs/api/modules/dom.html" target="_blank" rel="noopener">DOM</a>, <a href="http://yuilibrary.com/yui/docs/api/modules/event.html" target="_blank" rel="noopener">Event</a>, <a href="http://yuilibrary.com/yui/docs/api/modules/node.html" target="_blank" rel="noopener">Node</a>, and <a href="http://yuilibrary.com/yui/docs/api/modules/oop.html" target="_blank" rel="noopener">OOP</a> (Object Oriented Programming).</p><p>To use anything else you need, it’s simply</p><pre><code>YUI().use(&quot;someModule&quot;, &quot;anotherModule&quot;, function(Y) {    // Do something});</code></pre><p>And to make things really easy, all your dependencies will be calculated and included for you.</p><p>In jQuery, you don’t really have a native concept of modules, so the library is all or nothing.  Sure the jQuery is relatively small (32k gzipped), but that doesn’t make up for the fact that you are always going to be downloading and executing more than you need. Few people use -all- of jQuery on every page.</p><p>Now, one of the problems you can run into if you break up your application into dozens of separate files is that you’ll execute dozens of HTTP requests to include all those via <code>&lt;script&gt;</code> tags. Well, here comes the concept of combo-loading.</p><h2 id="CDN-Combo-loading"><a href="#CDN-Combo-loading" class="headerlink" title="CDN Combo-loading"></a>CDN Combo-loading</h2><p>All YUI modules, whether they are YUI Core or YUI Gallery (community contributed) modules are by default loaded from the Yahoo CDN, all as a single request.  This is an amazing feature.  Sure you get URLs that look like:</p><pre><code>http://yui.yahooapis.com/combo?3.4.1/build/oop/oop-min.js&amp;amp;3.4.1/build/event-custom-base/event-custom-base-min.js&amp;amp;3.4.1/build/dom-core/dom-core-min.js&amp;amp;3.4.1/build/dom-base/dom-base-min.js&amp;amp;3.4.1/build/selector-native/selector-native-min.js&amp;amp;3.4.1/build/selector/selector-min.js&amp;amp;3.4.1/build/node-core/node-core-min.js&amp;amp;3.4.1/build/node-base/node-base-min.js&amp;amp;3.4.1/build/event-base/event-base-min.js&amp;amp;3.4.1/build/event-custom-complex/event-custom-complex-min.js&amp;amp;3.4.1/build/event-synthetic/event-synthetic-min.js&amp;amp;3.4.1/build/event-mouseenter/event-mouseenter-min.js&amp;amp;3.4.1/build/event-hover/event-hover-min.js&amp;amp;3.4.1/build/event-delegate/event-delegate-min.js&amp;amp;3.4.1/build/node-event-delegate/node-event-delegate-min.js&amp;amp;3.4.1/build/intl/intl-min.js&amp;amp;3.4.1/build/array-extras/array-extras-min.js&amp;amp;3.4.1/build/attribute-base/attribute-base-min.js&amp;amp;3.4.1/build/attribute-complex/attribute-complex-min.js&amp;amp;3.4.1/build/base-base/base-base-min.js&amp;amp;3.4.1/build/base-build/base-build-min.js&amp;amp;3.4.1/build/escape/escape-min.js</code></pre><p>But who cares? You aren’t the one constructing it, YUI’s loader does it for you.  The loader even takes into account URL size limits and properly chunks it up into multiple requests if need be.</p><p>In jQuery, you are typically either hosting the jQuery.min.js file yourself, or pulling it from a CDN somewhere. You then also typically host the plugins yourself. Also, if you want to minify and concatenate your JS &amp; CSS for optimal performance, you have to do that yourself by using something like <a href="http://developer.yahoo.com/yui/compressor/" target="_blank" rel="noopener">YUI Compressor</a> as part of a build process.</p><p>Why not just let Yahoo do all of that for you? Use the exact same process, the same CDN, and the same files that Yahoo properties use themselves. You can build entire applications hosting nothing more than a single HTML file yourself because everything you need is hosted on Yahoo’s CDN.  And as a bonus, due to it being served off Yahoo’s CDN, you are guaranteed uptime equivalent to Yahoo.</p><h2 id="Loader"><a href="#Loader" class="headerlink" title="Loader"></a>Loader</h2><p>My favorite part of YUI is the Loader component. This is the utility that you use to dynamically include whatever JS and CSS you need in the most optimal method possible. Gone are the days of loading in every js script and css stylesheet that you need using HTML tags. Take a look at the new Delicious <code>&lt;head&gt;</code> tag since they moved from YUI to jQuery. It’s a pretty typical jQuery page.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">&lt;head&gt;</span><br><span class="line">  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/css/del-new.css?v=307&quot; /&gt;</span><br><span class="line">  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/css/flick/jquery-ui-1.8.13.custom.css?v=307&quot; /&gt;</span><br><span class="line">  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/css/jcrop/jquery.Jcrop.css&quot; /&gt;</span><br><span class="line">  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/css/960grid.css&quot; /&gt;</span><br><span class="line">  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/css/selectbox/selectbox.css&quot; /&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery-1.6.1.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery-ui-1.8.13.custom.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery.json-2.2.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery-hoverintent.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery.Jcrop.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery.metadata.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery.swapimage.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jquery.selectBox.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/tiny_mce/jquery.tinymce.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/jcarousellite_1.0.1.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;script type=&quot;text/javascript&quot; src=&quot;/static/js/del.js?v=307&quot;&gt;&lt;/script&gt;</span><br><span class="line">&lt;/head&gt;</span><br></pre></td></tr></table></figure><p>11 scripts + and 5 stylesheets = 15 HTTP requests.  And because they placed it all in the <code>&lt;head&gt;</code>, all 15 files need to be downloaded prior to the page being rendered.  Yeesh.</p><p>So let’s look at a small YUI app</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">  &lt;head&gt;</span><br><span class="line">    &lt;!-- Include the YUI seed --&gt;</span><br><span class="line">    &lt;script src=&quot;http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;/head&gt;</span><br><span class="line">  &lt;body&gt;</span><br><span class="line">    &lt;script&gt;</span><br><span class="line">      YUI().use(&quot;json&quot;, &quot;graphics&quot;, &quot;calendar&quot;, &quot;yql&quot;, function(Y)&#123;</span><br><span class="line">        // Do something magical</span><br><span class="line">      &#125;);</span><br><span class="line">    &lt;/script&gt;</span><br><span class="line">  &lt;/body&gt;</span><br><span class="line">  &lt;html&gt;</span><br></pre></td></tr></table></figure><p>The combination of those 4 modules and all the dependencies those require, actually loads in 49 modules.  Again, this is all done for you!  YUI’s loader is very mature and is used on some of the largest Yahoo and non-Yahoo websites on the internet.</p><p>One of the great things about the YUI Loader is that you can even use it to include non-YUI modules.  Here’s a jsFiddle to demonstrate using it to include jQuery, a jQuery plugin, a CSS stylesheet, and combining it with some YUI modules. (hint: click the Play button)</p><iframe style="width: 100%; height: 400px" src="http://jsfiddle.net/derek/sfcsE/embedded/"></iframe><h2 id="Environment-Agnostic"><a href="#Environment-Agnostic" class="headerlink" title="Environment Agnostic"></a>Environment Agnostic</h2><p>There is no “YUI for Mobile” or “YUI for Node.js”.  Why? Because YUI is a JavaScript library and does not assume it is running in any specific environment.  This has allowed the project to be nimble and flexible.  This also allows you to reuse code you’ve already written for one environment in other places.</p><p>If server + client-side JavaScript is something that seems useful, then YUI can be a great solution. Here’s an <a href="http://express.davglass.com/" target="_blank" rel="noopener">example site</a> that Dav created to demonstrate the power of using YUI and ExpressJS to use standard YUI widgets to pre-render the HTML markup on the server instead of the browser. The advantage here is that you can get JavaScript-like behavior, without needing JavaScript enabled, and using all the same code.</p><p>YUI is continually getting even easier to use inside Node.js. Dav Glass is the owner of the Loader component (previously mentioned), and he’s done some amazing stuff to get YUI to “just work” inside Node.js. Here’s <a href="http://www.youtube.com/watch?v=vQC3gsz6YXY" target="_blank" rel="noopener">a recent video</a> of some work he’s done to make YUI even easier to use on the server. Yahoo uses YUI, in Node.js, on some of our largest sites, and it’s largely due to YUI being an awesome all-around JavaScript library. YUI is not just a DOM manipulation library, like jQuery.</p><p>YUI has spent, and will continue to spend considerable resources to ensure it runs just as good server-side as well as in the browser.  There are some announcements coming within the next few months that will make it very apparent that Yahoo’s web-serving platform of the future is JavaScript, and YUI is a big part of that.</p><p>How does YUI work so well across all environments?  We target the lowest levels possible, and build up from there.</p><h2 id="Lower-level"><a href="#Lower-level" class="headerlink" title="Lower-level"></a>Lower-level</h2><p>I’ve never been a fan of rigid frameworks. I toyed with Rails, and Django, and CakePHP, and CodeIgnitor, and was never really happy, so I eventually ended up rolling <a href="https://github.com/derek/Daffy" target="_blank" rel="noopener">my own PHP framework</a>. Very simple, and possibly only appeals to me, but it’s exactly what I need to get started. Nothing more. Customizing someone else’s framework is typically more trouble than it is worth. Heck, that’s one of the reasons why I have never spent much time documenting or making Derek’s Anti-Framework Framework more friendly, because I don’t really want others to use it. That defeats the purpose of why I made it.</p><p>jQuery certainly isn’t as rigid as most frameworks. It’s much more of a library after-all.  Still, my feelings are the same, freedom is more important to me than being told how to do something.  For that, I appreciate that YUI is a little lower-level than jQuery.  jQuery and many plugins for it ignores edge cases, and they can get away with it because their target is the 90% use-case.  Well, YUI’s target is the 99%.  YUI needs to accommodate all the various use-cases and customizations requirements needed for use on Yahoo websites.  This is a strength of the project as it means it will be as robust and thought-out as possible.</p><p>YUI works along-side Yahoo projects to develop components for the library. For example, the new Y! Mail uses the exact same base rich text editor that is available as the <a href="http://yuilibrary.com/yui/docs/api/modules/editor.html" target="_blank" rel="noopener">Editor module</a>. At first glance, you aren’t going to see a fancy editor with 80 buttons that does everything under the sun (and usually poorly). You are going to see a solid foundation for which to build an editor on top of. For customization, building up is usually easier and more maintainable than hacking something apart and cramming in your functionality.</p><p>In jQuery-land, if you need an editor, you are likely going to search around for “jQuery rich text editor” and come across an article like “<a href="http://superdit.com/2011/05/21/12-jquery-based-rich-text-editor/" target="_blank" rel="noopener">12 JQuery Based Rich Text Editor</a>“ (sic) and play around with each of them, figure out which one works best for you, integrate, then launch it. Then 3 months in, your boss comes to you and asks for a new feature to be added to the editor. So you crack open the plugin code and start hacking around. Maybe you hack it in there, but more often, you give up digging through the convoluted mess of code that you didn’t write, and go back to searching for a new editor that does what you need. Repeat this process every 3-6 months. I know, because I’ve been in that exact situation. Eventually you might go with something like <a href="http://www.tinymce.com/" target="_blank" rel="noopener">TinyMCE</a> because it supports the kitchen sink, but isn’t even jQuery-based (oh sure, <a href="http://www.tinymce.com/tryit/jquery_plugin.php" target="_blank" rel="noopener">there’s a plugin for that</a>). So you are now duplicating all this code you are making your users download. Multiply that times an RTE, a date-picker, an uploader, a carousel, a lightbox, and you eventually end up with something like the Delicious <head> code I pasted above.</head></p><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>As I mentioned above, I’m not claiming that YUI is definitively better than jQuery, or any other library/framework. They each solve the problem of web development  differently.  What I will say is that if you give YUI enough time to get over an admittedly steeper learning curve, you’ll be on a fantastic track to build highly performant, scalable, web applications. C’mon, we are programmers, developers, front-end engineers.  We should strive to be more than cut, paste, then glue-together artists.  Let’s build stuff!</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;I was digging through some old email today and came across a post I made to &lt;a href=&quot;mailto:jquery-en@googlegroups.com&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;jquery-en@googlegroups.com&lt;/a&gt; back in 2007.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;On a side note, as I mentioned, I’m new to jQuery. In fact, my jQuery expertise goes back a full 24 hours. The website I’m coding now did use prototype and scriptaculous, but once I looked at the 1.2 version of jQuery, I knew I’d found a better solution (for me, anyways). So I spent the rest of the day recoding the site for jQuery. It was this post that convinced me I needed to change, “&lt;a href=&quot;http://blog.jquery.com/2006/08/20/why-jquerys-philosophy-is-better/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why jQuery’s Philosophy is Better&lt;/a&gt;“&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the post, Yehuda Katz compares a relatively young jQuery to Prototype.js.  Rewinding back to 2007, I was a Prototype user and it was apparently that post that sold me on jQuery being a better library.  For the next 2 years I was a (mostly) happy jQuery user.&lt;/p&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>High Performance JavaScript (Book Review)</title>
    <link href="http://derek.io/blog/2010/high-performance-javascript-book-review/"/>
    <id>http://derek.io/blog/2010/high-performance-javascript-book-review/</id>
    <published>2010-09-08T14:44:48.000Z</published>
    <updated>2019-09-26T18:01:49.000Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://covers.oreilly.com/images/9780596802806/lrg.jpg" alt="book cover"></p><p>When I saw on NCZ’s blog that he was <a href="http://www.nczonline.net/blog/2010/02/09/announcing-high-performance-javascript/" target="_blank" rel="noopener">writing a new book</a> on JavaScript performance techniques, I instantly went to pre-order it. Having partially read through <em><a href="http://www.amazon.com/gp/product/059680279X?ie=UTF8&amp;tag=deresblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059680279X" target="_blank" rel="noopener">High Performance JavaScript</a></em> by now, I figured I’d start writing a review of this excellent book.</p><a id="more"></a><p>Since JavaScript is such an expressive language, there are dozens of different ways to do the same thing.  Some of them good, some mediocre, and a lot of them bad.  It’s amazing how much awful JS info is on the web, all leftover from the dark ages of JS (‘96 - ‘05). Up until this point, we haven’t had an authoritative source on the topic of how to write JavaScript that performs well, both in and out of the browser.  Sure we’re had great books about web performance (<a href="http://www.amazon.com/gp/product/0596529309?ie=UTF8&tag=deresblog-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596529309" target="_blank" rel="noopener">High Performance Web Sites</a> is my favorite), but we haven’t had anything specific to JavaScript.  Now we do.</p><p>Nicholas is widely known as one of the best minds in the JavaScript world today.  He joined Yahoo! in 2006 as a front end engineer and has been working on one of the most trafficked pages on the interwebs, the Yahoo! home page.  His blog (<a href="http://nczonline.net" target="_blank" rel="noopener">nczonline.net</a>) is a treasure trove of information on all things JavaScript &amp; web performance.  Some recent gems include <a href="http://www.nczonline.net/blog/2010/01/05/interviewing-the-front-end-engineer/" target="_blank" rel="noopener">Interviewing the front-end engineer</a> &amp; <a href="http://www.nczonline.net/blog/2009/12/15/writing-maintainable-code/" target="_blank" rel="noopener">Writing maintainable code</a>.  It goes without saying that he knows his stuff when it comes to JavaScript &amp; performance.  As his books and blog posts have shown, he’s also a very skilled technical writer, keeping topics fresh, concise, &amp; relevant.</p><p>I’m writing this as I read along, so the verbosity of this post is due to me taking reference notes on interesting things as I go.<br><a id="more"></a><a id="more-769"></a></p><hr><p></p><h2>Chapter 1: Loading &amp; Execution</h2><br>Nick doesn’t waste any time getting into what the reader wants, fresh tips! Right away we begin to learn the specifics of how browsers react depending on where &amp; how you include your JS.  There are many ways that work, but few ways that work <strong>well</strong>.<p></p><p>Specifically:</p><ul><br><li>Why is it important to put your &lt;script&gt; includes just above the closing &lt;/body&gt; tag?</li><br><li>What is the browser doing while loading those external files?</li><br><li>Why should you put all your in-page JS code <strong>above</strong> your CSS includes? <em>(A: If you put it after a &lt;/link&gt; tag referencing an external stylesheet, the browser will block execution while waiting for that stylesheet to download)</em></li><br><li>How you can use the <em>defer</em> attribute in &lt;script&gt; tags to delay non-essential execution of code.</li><br><li>A thorough look at dynamic script loading to import &amp; execute your JS without blocking the browser.</li><br><li>An overview of some of the common JS loaders used today (YUI3, LazyLoader, &amp; LABjs).</li><br></ul><p>While much of the content in this chapter contains common knowledge among experienced developers, it is important knowledge to cover as it serves as the foundation for the rest of the book.  Don’t worry, we’ll get more advanced.</p><hr><p></p><h2>Chapter 2: Data Access</h2><br>Here’s where the sexy parts come into play; diagrams, graphs, and benchmarks!  This second chapter is where you’ll learn about how exactly the JS engine accesses data depending on how you store it.  The steepest learning curve within JavaScript for beginning developers is understanding variable scope.  This is the first time I’ve ever come across an explanation of JavaScript’s <a href="http://www.jibbering.com/faq/faq_notes/closures.html#clScCh" target="_blank" rel="noopener">[[Scope]]</a> property, now all the scoping &amp; speed issues make perfect sense!<p></p><p>Major topics covered in this chapter:</p><ul><br><li>Why do global variables perform so slowly?</li><br><li>Why creating data as local variables as opposed to object properties is 10%-50% faster (depending on the browser).</li><br><li>Why is it a good idea to create local instances of global variables?</li><br><li>Why <em>with</em>, <em>try/catch</em>, and <em>eval</em> are bad ideas from a performance perspective. (<em>A: they augment the scope by inserting themselves first on the tree</em>)</li><br><li>What truly happens under the hood when a variable is found to be <em>undefined</em>?</li><br><li>Closure scope and why they can cause memory leaks.</li><br><li>How prototype’s work and performance issues related to traversing up the prototype chain.</li><br><li>Why is it bad to use deeply nested object members (i.e. foo.bar.baz.bop())?</li><br></ul><p>There were so many “Ah hah! I get it now!” moments in this chapter for me that it alone was worth the price of the book.  It took me about 5x as long as it should have to get through this chapter because I was too busy playing with Firebug as I began to learn some of these concepts.</p><hr><p></p><h2>Chapter 3: DOM Scripting</h2><br>This book contains a few guest author chapters, and this is one of them.  In this chapter we learn about DOM scripting by another Yahoo, Stoyan Stefanov.<p></p><p>Many web developers don’t understanding what exactly “DOM scripting” is, even though they likely do it on a daily basis.  Many could tell you what the acronym stands for and that it represents the structure of an (X)HTML/XML document, but most don’t know that it also represents the API part of how you interact with the document.  When you are using <em>document.getElementById(“foobar”)</em> or <em>myelement.style.color = “blue”</em>, you are utilizing a DOM API function accessible via JavaScript, but it has nothing to do with the ECMAScript (aka: JavaScript) standard.</p><p>This chapter is chalk-full of great best practices &amp; overviews of DOM principles.  The first thing we learn is that accessing the DOM is so slow because we’re crossing the bridge between JavaScript and native browser code.  Jumping between the two is expensive, and should be kept to a minimum.  There are a lot of tricks &amp; tips that are very under-utilized by most developers when DOM scripting.</p><p>For example:</p><ul><br><li>Using the non-standard <em>innerhtml</em> is way faster than creating nodes via the native <em>document.createElement()</em> method.</li><br><li>When looping through a NodeCollection you should cache the length of the node in a local variable because it’s own <em>length</em> property is very slow.</li><br><li>Iterating through <em>nextSibling()</em> can be 100x faster than using <em>childNodes()</em></li><br></ul><p>This chapter also goes into a detailed explanation of what repaint &amp; reflow are, when they occur, and how understanding them will improve your application performance.  The realization I had after reading the R&amp;R explanation is we do stupid stuff all the time simply because we don’t understand how the browser renders and updates our pages.  You know how you’ve always heard using <em>margin-left</em> &amp; <em>margin-right</em> as separate styles is a bad idea? Well, here you find out why.  Oh, and did you know there was a <em>cssText</em> property you can use to batch your CSS modifications? I didn’t.</p><p>As JS libraries get more &amp; more popular, knowledge of good DOM scripting is becoming increasingly rare.  Take event delegation for example. Many developers just presume jQuery’s <em>live()</em> or YUI3’s <em>delegate()</em> methods are just magic.  They’re far from it, and are actually easy to understand concepts. When interviewing candidates for front end jobs at Yahoo!, this is one of the primary concepts we expect candidates to understand.  They may have never used it, but the good ones will figure it out as they are whiteboarding and we walk them through the challenges.</p><p>JS libraries are awesome, but it’s because they abstract out the cross-browser differences &amp; fix a flawed language, not because they allow you to forget what it actually going on under the hood.</p><hr><p></p><h2>Chapter 4: Algorithms &amp; Flow Control</h2><br>Chapter 4 kicks off with a quick overview of the 4 different types of loops in JavaScript (<em>while</em>, <em>do-while</em>, <em>for</em>, <em>for-in</em>).  The first 3 have equivalent performance, but <em>for-in</em> is the one to watch out for and should only be used when iterating an unknown number of elements (i.e. object properties). We then learn about important concepts like length caching and various other optimization techniques focused on reducing the number of operations per iteration.<p></p><p>Next up are conditionals, such as <em>if-else</em> and <em>switch</em>.  We learn when it is appropriate to use each one, and when they can be ditched for a much faster method, like using arrays as lookup tables.</p><p>Finally we come to the topic of recursion.  We skip the basics of “What is recursion” and jump straight into browser limitations with call stacks and advanced recursion topics such as memoization to cut out the fat in your stack.</p><p>Since the majority of our time spent coding is inside of loops, conditionals, and (if we really want to optimize) recursion, this chapter has great, basic information on efficient shortcuts that will set you apart from the other developers on your team.  Techniques learned in this chapter extend beyond the scope of JavaScript and can be used in just about every other programming language.</p><hr><p></p><h2>Chapter 5: Strings and Regular Expressions</h2><br><em>Another guest author chapter, this time by regex guru Steve Levithan</em><p></p><p>Along with loops, another very common task in JavaScript is string manipulation, most commonly one by concatenation or regular expressions, so it makes sense to have a whole chapter to itself.</p><p>When most people start out with JS, their concatenation method is likely <em>var str = “foo”; str = str + “bar”; //str = “foobar”</em>, then they discover the += operator and it becomes <em>var str = “foo”; str += “bar”; //str = “foobar”</em>.  It turns out that one of those is more efficient when it comes to memory usage, and it happens to not be the latter.  This chapter provides some memory allocation table diagrams to explain the difference and how different browsers perform that operation. It should also be noted that another alternate method of concatenation, <em>[‘foo’,’bar’].join(‘’);</em> is the preferred method in IE 6 &amp; 7, so that should be considered depending on your userbase.</p><p>The second half of this chapter covers regular expressions, which usually make me cringe. I have no problem writing them, but they’re an absolute nightmare to maintain sometimes.  Douglas Crockford has a saying, “If a regular expression is longer than 2 inches, find another method.”  I couldn’t agree more.</p><hr><p>In this review, I only covered the first half of the book.  Here are the remaining chapters:</p><ul><br><li>Chapter 6: Responsive Interfaces</li><br><li>Chapter 7: Ajax</li><br><li>Chapter 8: Programming Practices</li><br><li>Chapter 9: Building and Deploying high performance JavaScript applications</li><br><li>Chapter 10: Tools</li><br></ul><p>If you like what you’ve seen so far, <a href="http://www.amazon.com/Performance-JavaScript-Faster-Application-Interfaces/dp/059680279X" target="_blank" rel="noopener">go buy it</a>!</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;img src=&quot;http://covers.oreilly.com/images/9780596802806/lrg.jpg&quot; alt=&quot;book cover&quot;&gt;&lt;/p&gt;
&lt;p&gt;When I saw on NCZ’s blog that he was &lt;a href=&quot;http://www.nczonline.net/blog/2010/02/09/announcing-high-performance-javascript/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;writing a new book&lt;/a&gt; on JavaScript performance techniques, I instantly went to pre-order it. Having partially read through &lt;em&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/059680279X?ie=UTF8&amp;amp;tag=deresblog-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=059680279X&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;High Performance JavaScript&lt;/a&gt;&lt;/em&gt; by now, I figured I’d start writing a review of this excellent book.&lt;/p&gt;
    
    </summary>
    
      <category term="Web Development" scheme="http://derek.io/blog/categories/Web-Development/"/>
    
    
  </entry>
  
  <entry>
    <title>Return to Sunnyvale</title>
    <link href="http://derek.io/blog/2010/return-to-sunnyvale/"/>
    <id>http://derek.io/blog/2010/return-to-sunnyvale/</id>
    <published>2010-04-24T10:26:48.000Z</published>
    <updated>2019-09-26T18:01:48.998Z</updated>
    
    <content type="html"><![CDATA[<p><div align="center"><img src="http://s89997654.onlinehome.us/screencaps/Flickr_Photo_Download__yahoo-sunnyvale-04-20100618-083757.jpg" alt="" width="613" height="194"></div><br>So right now I’m sitting in a booth on the Yahoo! campus, the same booth where I set a goal 20 months ago that one day I’d work for Yahoo! and…</p><p><em>Wavy distorted omg we’re going into a flashback. Begin narration</em></p><p>My first experience on the Yahoo campus was for Y! HackDay 2008. I remember coming to the campus, being totally lost, and overwhelmed, almost like your first day of High School or College. I wasn’t an employee or anything. I was just a dumb programmer who wanted a taste of what Silicon Valley was really like. Seriously, I come from the startup world in Kansas City, I was in absolute awe of the place. This is where the Internet happens. Holy shit.</p><a id="more"></a><p>I came to HackDay armed with an idea for a hack to build, but was totally unable to focus, so I just sat around, tweeting, talking, and having fun. The music, the hacks, the food, the beer. I was totally awestruck when I talked to someone who worked at Yahoo!, especially the ones working on products I had used. I knew at that moment this was a place I’d always strive to work at. I knew I just <em>had</em> to work here, and be the person on the other end of that conversation.<br><a id="more"></a><a id="more-702"></a><br>Through the course of that weekend, I met <a href="http://twitter.com/ShawnRecruits4u" target="_blank" rel="noopener">a recruiter</a> who for one reason or another took interest in my skills and said he’d follow up with me. I didn’t expect he would and he was just being nice. A couple weeks later I got a call from him stating he was interested in setting up an interview. I was shocked. “Ok, yeah, umm.. sure, anytime” I was so nervous before that first call. I reviewed just about every book I owned on programming, and I own a lot. I got the call and was speaking with an engineering manager who started asking me all sorts of questions about web development. In retrospect, I totally bombed it, and knew it. Rejected.</p><p>Down, but not out, I was focused, I knew it was attainable, but I just needed more time. So, over the next year I did just about everything I could to get my skills up to the level they needed to be for another crack at an interview, always keeping that original interview experience in mind. I had a blueprint. A plan.</p><p>A year later I got an email… “I’m back at Yahoo! Want another interview?” It was the original recruiter. “Yeah, absolutely.” The only goal I had this time was getting further than the first. I wouldn’t be totally bummed out if I didn’t get the job, but I at least wanted an on-site interview, just as validation I was making progress. Off I went, studying my ass off for about a week straight, so focused on the lone objective of nailing that phone-screen. The phone rang, and we started chatting. These questions were totally different from the first time. But that’s ok, I knew them. Apparently I did well, and I got an on-site.</p><p>The on-site (at the Santa Monica office) went well, and I got an offer. It was a big step leaving Kansas City, but one that I’d always regret if I stayed. So off I went, off to sunny SoCal. I started at the Santa Monica office working with the Entertainment team in November. Due to some mix-ups, I never did make it up here to Sunnyvale for training &amp; orientation. Beyond that, there was never much need for me to be up here in person as we have tele-conferencing equipment galore, and these virtual meetings are in our DNA because we have offices around the country, and around the world.</p><p>So 5 months go by and I finally get up here for my first time. I’m actually glad I didn’t get up here before. I get to experience my first day at Yahoo, twice. I knew it was going to be weird, a good weird, and I knew that first time I came here was going to start flashing back. So here I am, sitting in the same booth, sipping my (free) mocha cappucino, admiring the courtyard, the weather, and the conversations going on around me. This is awesome. I have somewhere to be right now. But, nope…</p><p>If you haven’t set goals for yourself, do it. Set big ones. Set life-changing ones. When you achieve those, set higher ones, and just keep rolling. If you don’t have goals, find them. I stumbled across this one because I saw a tweet about HackDay, thought it sounded fun, and stepped on a plane to fly out here almost 2 years ago. Random. Lucky… Bold.</p><p>It’s feelings like this that you wish you could just bottle up and relive whenever you want.</p><p>So, I guess that’s the reason I’m writing this. A 30 minute slice of awesomeness, carved into this blog.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;&lt;div align=&quot;center&quot;&gt;&lt;img src=&quot;http://s89997654.onlinehome.us/screencaps/Flickr_Photo_Download__yahoo-sunnyvale-04-20100618-083757.jpg&quot; alt=&quot;&quot; width=&quot;613&quot; height=&quot;194&quot;&gt;&lt;/div&gt;&lt;br&gt;So right now I’m sitting in a booth on the Yahoo! campus, the same booth where I set a goal 20 months ago that one day I’d work for Yahoo! and…&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Wavy distorted omg we’re going into a flashback. Begin narration&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;My first experience on the Yahoo campus was for Y! HackDay 2008. I remember coming to the campus, being totally lost, and overwhelmed, almost like your first day of High School or College. I wasn’t an employee or anything. I was just a dumb programmer who wanted a taste of what Silicon Valley was really like. Seriously, I come from the startup world in Kansas City, I was in absolute awe of the place. This is where the Internet happens. Holy shit.&lt;/p&gt;
    
    </summary>
    
      <category term="Career" scheme="http://derek.io/blog/categories/Career/"/>
    
      <category term="Yahoo" scheme="http://derek.io/blog/categories/Career/Yahoo/"/>
    
    
      <category term="Yahoo" scheme="http://derek.io/blog/tags/Yahoo/"/>
    
      <category term="Career" scheme="http://derek.io/blog/tags/Career/"/>
    
      <category term="Sunnyvale" scheme="http://derek.io/blog/tags/Sunnyvale/"/>
    
  </entry>
  
</feed>
