<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
    <title>Radyology</title>
    
    
    <link rel="alternate" type="text/html" href="http://www.benrady.com/" />
    <id>tag:typepad.com,2003:weblog-1517578</id>
    <updated>2011-06-30T21:14:18-05:00</updated>
    
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Radyology" /><feedburner:info uri="radyology" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://hubbub.api.typepad.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><entry>
        <title>Continous Testing: with Ruby, Rails, and JavaScript -- Now in Print!</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2011/06/continous-testing-with-ruby-rails-and-javascript-now-in-print.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2011/06/continous-testing-with-ruby-rails-and-javascript-now-in-print.html" thr:count="1" thr:updated="2011-07-02T21:03:51-05:00" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da8834015433620749970c</id>
        <published>2011-06-30T21:14:18-05:00</published>
        <updated>2011-06-30T21:14:18-05:00</updated>
        <summary>It's done! It's out. And I couldn't be happier. As part of writing writing Continous Testing: with Ruby, Rails, and JavaScript, I had the opportunity to talk to a lot of people about what Rod and I were doing, and...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://pragprog.com/titles/rcctr/continuous-testing">It's done</a>! It's out. And I couldn't be happier.</p>

<p>As part of writing writing <em>Continous Testing: with Ruby, Rails, and JavaScript</em>, I had the opportunity to talk to a lot of people about what Rod and I were doing, and what they thought of it. Most of the people, once introduced to the idea, thought it was so obviously good that there just wasn't any reason not to follow this practice. By running your tests on every change, you create a tight feedback loop that makes it so much easier to find bugs and get a better understanding of what your code is doing. I'm really proud of what we've done with this book because I think the techniques we discuss in it will really open this practice up to a wide range of developers and projects. </p>
</div>
</content>



    </entry>
    <entry>
        <title>Avoiding Asynchronous Programming in Node.JS</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2011/05/avoiding-asynchronous-programming-in-nodejs.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2011/05/avoiding-asynchronous-programming-in-nodejs.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da883401538e929133970b</id>
        <published>2011-05-18T23:35:46-05:00</published>
        <updated>2011-05-18T23:43:30-05:00</updated>
        <summary>Node.js is supposed to be all about an asynchronous style of programming. Rather than executing functions and getting results, we use a lot of first order functions and callbacks to do things asynchronously. Here's an example of this style from...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Node.js is supposed to be all about an asynchronous style of programming. Rather than executing functions and getting results, we use a lot of first order functions and callbacks to do things asynchronously. <a href="https://github.com/simonw/djangode/blob/f99a38f9e6ca3b81aa649d6f0f7d553572d91bd8/example.js">Here's an example of this style</a> from the djangode project. <strong>makeApp</strong> is a function that takes an array of arrays that are regex/function pairs. Some of those function invoke other functions (such as <strong>setTimeout</strong>) that take other functions.<br /> <br /> I find this kind of code rather tricky to test, and to reason about. Functions nested four levels deep makes my spidey-sense tingle. A good technique for cleaning it up can be extracting those anonymous functions into named functions, but if there are variables that are shared across scopes, that can get a little messy too.<br /> <br /> However, I really like Node.js and the approach they've taken, simply because the asynchronous style is a rather elegant (if not new) solution to the kind of performance problems you encounter when working with single threaded code. Blocking operations, IO is particular, can really kill your app, and using threads to avoid blocking can lead to code that is nigh-impossible to test or reason about...so the Node.js asynchronous style merely being a bit tricky is a huge upgrade.<br /> <br /> However, I haven't found myself really digging using that style all the time. I generally prefer a functional style when working in JavaScipt. In my opinion, function composition is a huge advantage in JavaScript, but callbacks generally don't have return values, so they're harder to compose. In fact, it really only seems appropriate to use callbacks when I would otherwise be tempted to use a thread to avoid onerous blocking IO. Otherwise, I like to stick a more functional style and stay away from the asynchronous code.</p></div>
</content>



    </entry>
    <entry>
        <title>Dictionary of Algorithms and Data Structures</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2011/05/dictionary-of-algorithms-and-data-structures.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2011/05/dictionary-of-algorithms-and-data-structures.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da883401538e426d20970b</id>
        <published>2011-05-02T20:40:05-05:00</published>
        <updated>2011-05-02T20:40:05-05:00</updated>
        <summary>I gotta say, this is pretty neat. You know, just in case you forget what Huffman encoding is.</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>I gotta say, this is pretty neat.<br />
<br />
You know, just in case you forget what Huffman encoding is.</p></div>
</content>



    </entry>
    <entry>
        <title>What is Twitter?</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2011/04/what-is-twitter.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2011/04/what-is-twitter.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da8834014e87cc145b970d</id>
        <published>2011-04-14T12:22:30-05:00</published>
        <updated>2011-04-14T12:22:30-05:00</updated>
        <summary>Twitter is a personal denial of service attack. If you want to steal someone's productivity for a day, just troll them on Twitter. Oh, and I'm not posting this on Twitter, because I have better things to do than defend...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Twitter is a personal denial of service attack. If you want to steal someone's productivity for a day, just troll them on Twitter.<br />
<br />
Oh, and I'm not posting this on Twitter, because I have better things to do than defend my argument.</p></div>
</content>



    </entry>
    <entry>
        <title>Is Unwarranted Overtime Theft?</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2011/04/is-unwarranted-overtime-theft.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2011/04/is-unwarranted-overtime-theft.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da8834014e60628652970c</id>
        <published>2011-04-04T20:13:27-05:00</published>
        <updated>2011-04-04T20:13:27-05:00</updated>
        <summary>After reading Tim Ottinger's excellent article on the meaning of "sustainable pace", I couldn't help but pose a question on Twitter. 140 characters just isn't enough to clarify this question, and so we move to the blog to fill in...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>After reading <a href="http://www.softwarequalityconnection.com/2011/04/an-agile-pace/">Tim Ottinger's excellent article on the meaning of "sustainable pace"</a>, I couldn't help but <a href="https://twitter.com/#!/benrady/status/55055827232489473">pose a question</a> on Twitter. 140 characters just isn't enough to clarify this question, and so we move to the blog to fill in the details.</p>

<p>Let's assume that we have a customer (likely a proxy) who wants a development team to work overtime to complete a task. Let's further assume that this is really a <em>task</em>, that is, a day or two of work, to be done on a weekend or during a couple of really late nights. He thinks that this task requires an additional level of effort, and that working late is worth the sacrifice (to both morale and the later productivity of the team). To clarify, the customer isn't providing the budget for this project and he isn't any more of a stakeholder than the developers.</p>

<p>Let's also assume that we have a development team that has a decent understanding of the business concerns of the project. Their opinion is that this task is no more urgent or particularly valuable than anything else they've been asked to do. To use the terms from Tim's article, they don't think it's necessary to come to the <em>rescue</em> in this case. </p>

<p>My question is this: <strong>If the customer proxy <strike>forces</strike> strongly suggests that the development team work overtime to complete the task, even though the developers think overtime is unwarranted for this task, is that unethical?</strong></p>

<p>On the one hand, the customer is likely benefiting from the delivery of additional features, and the morale of the team may be damaged. If this is 'the last straw' for a key developer that can easily find work elsewhere, the customer may have cost the company dearly to benefit himself. Even if the customer truly believes that the sacrifice is worth the benefit, is he caught in a conflict of interest?</p>

<p>On the other hand, what if the customer is right? A good development team understand the needs of the business, but you would think that the customer would have a <em>better</em> understanding. Disagreements happen. Our goal is always better communication and understanding, but there's little point in having an 8 hour meeting to avoid 12 hours of overtime. </p>

<p>What say you, Internets?</p>
</div>
</content>



    </entry>
    <entry>
        <title>Continuous Testing with Ruby: Now in Beta!</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2010/09/continuous-testing-with-ruby-now-in-beta.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2010/09/continuous-testing-with-ruby-now-in-beta.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da88340133f493b3fc970b</id>
        <published>2010-09-27T09:00:00-05:00</published>
        <updated>2010-09-27T09:00:00-05:00</updated>
        <summary>"Continuous Testing with Ruby" is now available as a beta book on pragprog.com! This is the first beta, so there's still more to do, but Rod and I are very happy to have it out there so we can get...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>"Continuous Testing with Ruby" is now <a href="http://pragprog.com/titles/rcctr/continuous-testing-with-ruby" target="_self">available as a beta book</a> on pragprog.com! This is the first beta, so there's still more to do, but Rod and I are very happy to have it out there so we can get some <a href="http://forums.pragprog.com/forums/170" target="_self">feedback</a>.</p>
<p>Continuous Testing starts with a simple idea: Run your tests all the time. I think this book does a great job of communicating all the incremental improvements to that idea that Rod and I have come up with over the last few years. From using CT as an alternative to debugging, to finding ways to automatically check other project artifacts (like documentation and seed data), once you get hooked on having instant feedback for everything, you start to find all kinds of ways to apply it.</p>
<p>Probably the biggest effect, however, is how CT helps you write better tests. One of the points we made in the book goes like this:</p>
<p><em>An old axiom of Test Driven Development states that the tests test the correctness of the code; while the code, in turn, test the correctness of the tests. The tests also test the design of the code—code that’s hard to test is usually poorly designed. But what tests the design of the tests? In our experience, Continuous Testing is an effective way to test the design and overall quality of our tests...running our tests all the time creates a feedback loop that tells us when tests are misbehaving, as we create them. This means we can correct existing problems faster, and prevent bad tests from creeping into our system in the first place.</em></p>
<p>I'm very proud of what we've done with this book. I think it will be really  valuable to anyone who's been writing automated tests and wants to get  more out of them. I've been a doing TDD (and then BDD) since about 2003.  My interest in continuous testing began in 2006 when I thought about  all the time I was wasting figuring out which tests I needed to run  after a change. After that, I wrote <a href="http://improvingworks.com/products/infinitest/" target="_self">Infinitest</a>,  and now <a href="http://pragprog.com/titles/rcctr/continuous-testing-with-ruby" target="_self">Continuous Testing with Ruby</a>. I'm greatly looking forward to see where we go from here.</p></div>
</content>



    </entry>
    <entry>
        <title>Testing Client Side Javascript with Jasmine and Node.js</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2010/08/testing-client-side-javascript-with-jasmine-and-nodejs.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2010/08/testing-client-side-javascript-with-jasmine-and-nodejs.html" thr:count="1" thr:updated="2010-10-03T19:13:56-05:00" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da88340133f323344b970b</id>
        <published>2010-08-17T21:59:55-05:00</published>
        <updated>2010-08-17T21:59:11-05:00</updated>
        <summary>After having spent a long time trying to run javascript tests with Rhino, I've finally found something better. Rhino was never really fast enough for me. Spinning up the JVM just takes too long when you're running your tests continuously....</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>After having spent a long time trying to run javascript tests with <a href="http://www.mozilla.org/rhino/">Rhino</a>, I've finally found something better. Rhino was never really fast enough for me. Spinning up the JVM just takes too long when you're running your tests continuously. A few seconds really makes a difference when you do something hundreds (thousands?) of times per day.</p>

<p>On top of that, testing frameworks like <a href="http://github.com/nkallen/screw-unit">ScrewUnit</a> (aside from being abandonware) have scoping issues that make tests very brittle...unless you run each one in it's own process...again back to the JVM startup problem. </p>

<p>Recently, I started playing around with the <a href="http://github.com/pivotal/jasmine">Jasmine</a> testing framework for Javascript. It was really nice, but I wasn't convinced it was really going to solve the problems I was experiencing since they were mostly due to global namespaces and Rhino.</p>

<p>Enlighentment came, however, when I tried running Jasmine tests from within <a href="http://nodejs.org/">Node.js</a>, using a patched version of <a href="http://github.com/mhevery/jasmine-node">mhevery's jasmine-node module</a>. If you don't know, Node.js is a Javascript runtime environment based on the V8 engine. It's actually designed for server-side development, but I wondered if I could use it to run tests for my in-browser javascript. The answer is <em>mostly</em>, but the results were very compelling and I'm now doing this on all my web application projects.</p>

<p>Firstly, here's an <a href="http://github.com/benrady/jasmine-nodejs-example">example project</a> that shows how I set things up.</p>

<p>To understand what's going on here, lets begin at the html. In index.html, we're not doing anything fancy. Just a few tags to load jquery and the javascripts in our app:</p>

<script src="http://pastie.org/1099045.js" />

<p>The interesting bits start to show up in spec/specHelper.js</p>

<script src="http://pastie.org/1099049.js" />

<p>specHelper.js is actually a proper node.js module, meaning that it explicitly declares it's exports. What it's doing, actually, is exporting the namespace for our entire application (as the variable 'app'). This means that in our specs:</p>

<script src="http://pastie.org/1099053.js" />

<p>We can create a completely clean copy of the entire application and store it in a variable that the tests can access. Jasmine's beforeEach function can recreate it before every single test. This means that we don't have to create a new Rhino instance for each test to get a clean environment. As a result, these tests run fast (hundreds of tests per second).</p>

<p>They run so fast, in fact, that I've been using Watchr to run them. Here's my Watchr script</p>

<script src="http://pastie.org/1099117.js" />

<p>This automatically runs all the Jasmine specs on each change. The tests run so quickly I haven't had the need to optimize it yet. I've been really happy with this setup (despite a few problems with jquery and env.js) and I'm hoping to improve it as the tools mature.</p></div>
</content>



    </entry>
    <entry>
        <title>A Bit of Heresy: Functional Languages are Overrated</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2010/06/a-bit-of-heresy-functional-languages-are-overrated.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2010/06/a-bit-of-heresy-functional-languages-are-overrated.html" thr:count="35" thr:updated="2010-08-09T02:30:14-05:00" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da883401348513d9c0970c</id>
        <published>2010-06-29T08:14:19-05:00</published>
        <updated>2010-06-29T08:14:19-05:00</updated>
        <summary>Lets talk about problems. As professional software developers, we get paid to solve problems. Sometimes we do this by writing code. Sometimes we do this by finding creative ways to avoid writing code. In either case, it's important that the...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml">Lets talk about problems. As professional software developers, we get paid to solve problems. Sometimes we do this by writing code. Sometimes we do this by finding creative ways to avoid writing code. In either case, it's important that the problem drives the solution, and not the other way around.<p style="text-align: left;">Enter: The Concurrency Problem. <a href="http://en.wikipedia.org/wiki/Moore%27s_law">Moore's Law</a> is starting to run out. We've all gotten very used to using hardware to solve scalability problems, and up until now, that's been a relatively easy thing to do. But chip manufacturers are starting to hit physical limits of transistor size and density. Now, the only way to scale up is to scale out by adding more cores, and that means concurrency. "But concurrent programming is hard!", they say. "And we have an army of semi-conscious Java developers in our company that wouldn't know a semaphore from a telegraph line! Oh noes! What will we do?"</p><p style="text-align: left;">The current fashionable solution to this problem are functional programming languages. They are the next big thing. Languages such as Scala, Clojure, Erlang, and Haskell are supposedly going to save us from the dread intermittent bugs and horrible deadlocks intrinsic in concurrent systems built with object oriented or procedural languages. The implication in this argument is that functional programming languages are more thread safe because (depending on the language) they either shy away from side effects or <a href="http://www.haskell.org/tutorial/io.html">find ways to eliminate it completely</a>.</p><p style="text-align: left;"><strong>Well, I'm sorry, but I'm just not buying it.</strong></p><p style="text-align: left;">Don't get me wrong. Concurrent programming in a typical object oriented language is <strong>hard.</strong> Really hard. I've slogged through enough of it to learn to just avoid it unless you really, really need it. Especially when you're dealing with shared state. <a href="http://www.michaelfeathers.com/">Michael Feathers</a> once told me that he thought if threads had never been invented, and someone had proposed them at a conference today, they'd be laughed out of the building. He may have been kidding, but honestly, I would believe it.</p><p style="text-align: left;">My problem with the functional programming cure to this problem is that <strong>I haven't seen a cure yet that's better than the problem</strong>. Maybe it's me. Maybe my tiny Ben brain just can't comprehend the magic and majesty of OCaml, but every time I've tried to learn a new functional language, it's ended it disaster. First with Erlang, and then Haskell, I've now had two aborted attempts to understand the supposed cure to the concurrency problem. The languages are just too complex, too terse, and absolutely full of academic shitheaddery. I mean, <a href="http://www.haskell.org/onlinereport/exps.html#sect3.17.3">seriously</a>, what the <a href="http://caml.inria.fr/pub/docs/manual-ocaml/manual003.html#toc7">hell</a>.</p><p style="text-align: left;">If your concern with the death of Moore's law is that you won't be able to afford/find skilled programmers to scale your systems using multicore processors, these are not the droids you're looking for.</p><p style="text-align: left;">But even if you're got a bunch of really sharp developers on your team, I'm not sure this is the solution either. Message based architectures (especially asynchronous ones) are good, 
pretty easy to understand, and easy to test. Shared state in concurrent systems 
is a pain, and you shouldn't do that. Interprocess communication is relatively easy <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html">through</a> <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">various</a> <a href="http://en.wikipedia.org/wiki/Named_pipe">methods</a>. Whether you're using an object oriented, pure functional, or 
hybrid language, these things are true.  And while it might be possible to ignore thread safety problems by just working in a purely functional language, I think you're just <strong>trading one kind of complexity for another</strong>. And if you're working in a <a href="http://www.scala-lang.org/">hybrid language</a>, what assurances do you have, really, that your system is really thread safe? Indeed, the <a href="http://en.wikipedia.org/wiki/Risk_compensation">risk compentation</a> effect might give you a false sense of security, giving you a system that actually had more concurrency problems that one written in a "dangerous" language.</p><p style="text-align: left;">I think the downfall of some of these languages is that they get wrapped up in being "functional" rather than focusing on solving a particular class of problem. They abandon convention and common sense for <a href="http://en.wikibooks.org/wiki/Haskell/Type_basics_II#Polymorphic_guesswork">complex type systems</a> and <a href="http://www.haskell.org/haskellwiki/Functional_programming#Side_effects_through_monads">functional purity</a>. You can have an <a href="http://code.google.com/p/korus/">actor model</a> <a href="http://osl.cs.uiuc.edu/parley/">architecture</a> <a href="http://gpars.codehaus.org/">without using</a> a functional programming language. You can avoid shared state in any modern language (even JavaScript). These things are not synonymous with functional programming. </p><p style="text-align: left;">I think the future of computing is people. Lots of people. Web applications, social networks, and millions (billions?) of mobile devices interacting over the net. I think the majority of these problems can be solved with multi-process, message passing architectures. In the end, a large scale system might wind up with one core for every 10 users. Maybe less. If multiple cores are the new gigahertz, I would not be the least surprised if computing gets that cheap. All it would have to do is follow the trend of the last 40 years, just along a different axis. Really, the only barrier to a process-oriented approach in that case would be memory, and that <a href="http://en.wikipedia.org/wiki/64-bit#Limitations">may not actually be a limitation</a> at all. </p><p style="text-align: left;">So I think <strong>the cases where a functional programming language are really the best solution to the concurrency problem are, in fact, rather rare</strong>. It's worth noting that even after Twitter raised eyebrows by <a href="http://www.artima.com/scalazine/articles/twitter_on_scala.html">moving their backend processing</a> from Ruby to Scala, they "reverted" to Java for some of the concurrent operations:</p><p style="text-align: left;"><em>initially we had a number of actors inside the system...over time as we ran more and more 
system tests on it, we found that actors weren’t necessarily the ideal 
concurrency model for all parts of that system. Some parts of the 
concurrency model of that system are still actor based....but for 
other parts we’ve just gone back to a traditional Java threading model. 
The engineer working on that, John Kalucki, just found it was a little 
bit easier to test, a bit more predictable.</em>  </p><p style="text-align: left;"> So I need someone to explain this to me. The state of the art in functional languages scare me a lot more than intelligently-designed concurrent programming, but everyone is hopping on the bandwagon, so I feel I must be doing something wrong. So, in typical fashion, I've made
 a
 heretical claim in the hopes that someone will show me the light and 
prove me wrong. Because <strong>I seriously don't get it</strong>.</p></div>
</content>



    </entry>
    <entry>
        <title>Language of the year: 2010</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2010/01/language-of-the-year-2010.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2010/01/language-of-the-year-2010.html" thr:count="1" thr:updated="2010-01-24T23:44:19-06:00" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da8834012876d7ff0b970c</id>
        <published>2010-01-14T21:29:06-06:00</published>
        <updated>2010-01-14T21:29:06-06:00</updated>
        <summary>I learn a new language every year. This year, I had decided to learn a functional language. The contestants were many and varied, but I'm pleased to announce that the winner this year is... Haskell. I had seriously considered learning...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.benrady.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>I learn a new language every year. This year, I had decided to learn a functional language. The contestants were many and varied, but I'm pleased to announce that the winner this year is...</p><p>
</p>
<p><a href="http://learnyouahaskell.com/">Haskell</a>.</p><p>I had seriously considered learning Scala. I'm planning on re-writing significant portions of infinitest-core in Scala as soon as I'm done working with my current client. So I knew I'd have a chance to use it. I still plan on writing a lot of Scala this year. Haskell, on the other hand, isn't as practical or widely applicable. Although I might find myself on a project using Scala, I seriously doubt that there are going to be any Haskell jobs headed my way soon. So why did I choose it over Scala, or another language like Clojure?</p><p>Let me pause for a moment to voice a pet peeve. </p><p>The word <em>grok</em> often gets confused with the word <em>understand</em>. Although many people use it that way, that's not what it means...it means something much, much cooler. As defined in <em><a href="http://en.wikipedia.org/wiki/Stranger_in_a_Strange_Land" title="Stranger in a Strange Land">Stranger in a Strange Land</a>:</em></p><p><em>Grok means to understand so thoroughly that the observer becomes a part of the observed.</em></p><p>There's maybe a dozen things in this world that I truly grok. I grok TDD. I grok cooking. With a little more practice I think I will grok Ruby. These things have permeated me to the point where they have changed the way I think and behave, which in turn, has significantly affected others who are seeking to learn more about these topics.</p><p>I want to grok functional programming. Not just Haskell, but all FP languages. Just as moving from one OO language to the next is fairly simple once you've mastered the concepts of OOP, I want that deep understanding of FP that will allow me to pick up a new functional language by simply mapping my existing knowledge onto it's libraries and syntax, rather than having to learn a completely new way of doing things at the same time.</p><p>I think Haskell is the best language to achieve that goal. It's purely functional, so I won't spend time learning the same OO constructs over again. It's powerful, free, and there's even a <a href="http://book.realworldhaskell.org/read/">book</a>.</p><p><em>If you'd like to join me in my quest, please follow along at the newly formed <a href="http://groups.google.com/group/lambda-lambda-lambda">Lambda Lambda Lambda</a> FP user group here in DFW. </em></p></div>
</content>



    </entry>
    <entry>
        <title>Contract Tests in JUnit 4</title>
        <link rel="alternate" type="text/html" href="http://www.benrady.com/2009/12/contract-tests-in-junit-4.html" />
        <link rel="replies" type="text/html" href="http://www.benrady.com/2009/12/contract-tests-in-junit-4.html" thr:count="6" thr:updated="2010-09-23T12:28:22-05:00" />
        <id>tag:typepad.com,2003:post-6a00e54fb013da88340128768b1553970c</id>
        <published>2009-12-28T23:50:52-06:00</published>
        <updated>2010-01-07T07:13:15-06:00</updated>
        <summary>As part of his talk on integration tests J.B. Rainsberger talked about how contract tests can be used to test the interaction between classes when using a mockist approach to developer testing. He wondered aloud if it would be possible...</summary>
        <author>
            <name>Ben Rady</name>
        </author>
        
        
<content type="html" xml:lang="en-US" xml:base="http://www.benrady.com/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;As part of &lt;a href="http://www.infoq.com/presentations/integration-tests-scam"&gt;his talk on integration tests&lt;/a&gt; J.B. Rainsberger talked about how &lt;i&gt;contract tests&lt;/i&gt; can be used to test the interaction between classes when using a mockist approach to developer testing. He wondered aloud if it would be possible to write these kinds of tests using abstract classes and JUnit 4. The answer is yes, with some caveats, as I demonstrate in the screencast below. Enjoy!&lt;/p&gt;

&lt;p&gt;EDIT: If the embedded screencast below doesn't work for you, try &lt;a href="http://vimeo.com/8588491"&gt;this link.&lt;/a&gt;&lt;/p&gt;

&lt;object width="720" height="450"&gt; &lt;param name="movie" value="http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/mp4h264player.swf"&gt;&lt;/param&gt; &lt;param name="quality" value="high"&gt;&lt;/param&gt; &lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;/param&gt; &lt;param name="flashVars" value="thumb=http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/FirstFrame.jpg&amp;containerwidth=720&amp;containerheight=450&amp;content=http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/ContractTestsInJUnit4.mp4"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt; &lt;param name="scale" value="showall"&gt;&lt;/param&gt; &lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt; &lt;param name="base" value="http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/"&gt;&lt;/param&gt; &lt;embed src="http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/mp4h264player.swf" quality="high" bgcolor="#FFFFFF" width="720" height="450" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/FirstFrame.jpg&amp;containerwidth=720&amp;containerheight=450&amp;content=http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/ContractTestsInJUnit4.mp4" allowFullScreen="true" base="http://content.screencast.com/users/benrady/folders/Camtasia/media/6d8b7ca1-7370-45d2-bbdd-9fffc84174cc/" scale="showall"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;/div&gt;
</content>



    </entry>
 
</feed><!-- ph=1 -->

