<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>"fallenrogue" Under Leon's hat.</title><generator>Tumblr (3.0; @fallenrogue)</generator><link>http://fallenrogue.com/</link><item><title>mnmal:


designeriphone:

“Good design means never having to say...</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_kwgteohiSm1qahc9uo1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://mnmal.tumblr.com/post/438815483/designeriphone-good-design-means-never-having" class="tumblr_blog"&gt;mnmal&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://designeriphone.tumblr.com/post/348146742/good-design-means-never-having-to-say-click"&gt;designeriphone&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Good design means never having to say “Click Here”.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;</description><link>http://fallenrogue.com/post/439007809</link><guid>http://fallenrogue.com/post/439007809</guid><pubDate>Wed, 10 Mar 2010 08:57:26 -0500</pubDate></item><item><title>Photo</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_kywbv3HrUi1qz534vo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://fallenrogue.com/post/431706808</link><guid>http://fallenrogue.com/post/431706808</guid><pubDate>Sun, 07 Mar 2010 00:13:48 -0500</pubDate></item><item><title>Sooooooooooo tired. And bored.  Gnoght.</title><description>&lt;p&gt;Sooooooooooo tired. And bored.  Gnoght.&lt;/p&gt;</description><link>http://fallenrogue.com/post/431705616</link><guid>http://fallenrogue.com/post/431705616</guid><pubDate>Sun, 07 Mar 2010 00:13:12 -0500</pubDate></item><item><title>"You have enemies? Good. That means you’ve stood up for something, sometime in your life."</title><description>&lt;p&gt;‘You have enemies? Good. That means you’ve stood up for something, sometime in your life.’&lt;/p&gt;

&lt;p&gt;- Winston Churchill&lt;/p&gt;

&lt;p&gt;(Via &lt;a href="http://mnmal.tumblr.com/"&gt;Minimal&lt;/a&gt;.)&lt;/p&gt;</description><link>http://fallenrogue.com/post/349835224</link><guid>http://fallenrogue.com/post/349835224</guid><pubDate>Sat, 23 Jan 2010 20:13:49 -0500</pubDate></item><item><title>The CodeMash Precompiler Part 0</title><description>&lt;p&gt;I’ve had several interested friends ask about “how the precompiler” went. As the acting Iteration Manager I can say that it exceeded my every expectation but what does that “mean”. Well I’m going to be compiling the information that was collected from the event and putting it into a case study for a team of 50 developers, whom only half of which were familiar with the tools and process methodology, working from scratch on an application. &lt;/p&gt;

&lt;p&gt;What did we learn? &lt;/p&gt;

&lt;p&gt;What did we succeed at? &lt;/p&gt;

&lt;p&gt;What did we fail at? &lt;/p&gt;

&lt;p&gt;Those at the retrospective probably know some of those answers because we discussed them as a group and I made notes about how I may present this workshop in the future. (possibly at CodeMash again next year?) &lt;/p&gt;

&lt;p&gt;But I wanted to let everyone know that we did complete most of the app to make it fully functional. In fact, in the afternoon we were already looking to refactor the architecture of the application and that is where it is right now. So, Cory Flanigan’s group at set out to do just that. Cory and I will seek to complete the touches and push out to &lt;a href="http://symposiast.com"&gt;http://symposiast.com&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;So, stay tuned and if you’re interested in seeing where we ended up check out the code that was committed and merged into master at &lt;a href="http://github.com/fallenrogue/CodeMash-2010-Precompiler-Application."&gt;http://github.com/fallenrogue/CodeMash-2010-Precompiler-Application.&lt;/a&gt;&lt;/p&gt;</description><link>http://fallenrogue.com/post/339398651</link><guid>http://fallenrogue.com/post/339398651</guid><pubDate>Sun, 17 Jan 2010 12:55:49 -0500</pubDate></item><item><title>iPhone and Android Development - NOT STARTING A FLAME WAR!!!! </title><description>&lt;p&gt;Perception is truly reality. The way we see the world shapes how we look to solve problems. It’s with that grain of salt that I offer up this response to Mr. @JonathanPenn’s tweet to substantiate my claims on the interwebs this morning. Boy, I hate getting into these messes but he’s right to call me out and clarify. Here’s our convo:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://grab.by/1qkY" alt="Our Tweet Convo!"/&gt;&lt;/p&gt;

&lt;p&gt;With that history you must know that I spent years in .NET and C# so Java is going to seem like second nature to my eyes; rather than, say, a C++ programmer who will, likely, see something familiar in Apple’s Cocoa/Obj-C environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That said&lt;/strong&gt;, my comment takes the following into consideration…&lt;/p&gt;

&lt;p&gt;Java is dominant right now &lt;a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html"&gt;(stats!)&lt;/a&gt;. In the Enterprise, they’ve got a pretty large hold on the development community and love it or hate it, that lowers the barrier of entry to developing on Android. Most Java developers will be immediately comfortable with the conventions laid out in Android’s development cycle and given there’s an exceptional Eclipse plugin for Android development Java developers don’t need to learn much more than Android’s specifics in their own language, IDE and platform of choice.&lt;/p&gt;

&lt;p&gt;There’s a mountain of Java tutorials available. Even if you’re new to Java you’re going to be hard pressed to miss out on the latest and greatest information that the platform has to offer. My searches for information on Cocoa development have met with wildly differing opinions and little consensus. In fact, I was in the C based API on my sample app to play/manage sounds until Jon mentioned there was an Objective-C based API that could do the same thing. Even Apple’s documentation was wishy-washy on the subject until I took the time to read the Cocoa Touch programming guide for Audio (not a fun read, BTW) that it even mentioned the class Jon pointed out.&lt;/p&gt;

&lt;p&gt;On a 1-1 basis Android’s frameworks seem to be providing developers simple abstractions to every possible task that you’re going to want to perform on the device while Apple’s Cocoa Touch frameworks seem to be a mess of improvements over Cocoa, missing abstractions and idioms are published by Apple and not driven by the community using them. AGAIN- that is conjecture but that’s what I’m seeing.&lt;/p&gt;

&lt;p&gt;Take, for instance, the following snippets to load an internal sound file reference and play it. First iPhone -&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;NSString *soundFilePath =
    [[NSBundle mainBundle] pathForResource: sound
                                    ofType: theType];

NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];

AVAudioPlayer *newPlayer =
    [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL
                                           error: nil];


[newPlayer prepareToPlay];
[newPlayer setDelegate: self];
[newPlayer play];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See, it’s not complex. The syntax is simple enough (for the AVAudioPlayer class, this is &lt;em&gt;not&lt;/em&gt; the C API which is &lt;strong&gt;far&lt;/strong&gt; more complex) but things like getting a reference to an internal URI is 2 lines of chunky code that create references that I need to track now. &lt;strong&gt;It’s not bad, but there should be a simple way to load our references.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s compare that snippet with the Android version.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;MediaPlayer mp = MediaPlayer.create(this, R.raw.mySoundFile);
mp.start();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That’s it. I’m not splitting hairs over brevity; that’s not the point, the point is that the abstraction seems to be in the right place. We &lt;em&gt;know&lt;/em&gt; we’re going to play sounds on a device. We &lt;em&gt;know&lt;/em&gt; that those sounds are going to be local or networked. These are clear points of abstraction in OO and should be provided to the developer (IMHO).&lt;/p&gt;

&lt;p&gt;From my perspective I get to tell the right objects to do what I want them to do and the details and minutia are encapsulated behind a nice API. If we’re on the same topic here are 2 equally good APIs first from iPhone and then from Android&lt;/p&gt;

&lt;h3&gt;Taking a photo with iPhone (in main.m)&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

// cruft leading to our delegate implementation...
-(void)imagePickerController: (UIImagePickerController *)picker didFinishPickingImage(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
    // now I have image reference I can use! Sweet! 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See, there’s an operation that I &lt;em&gt;know&lt;/em&gt; I’m going to need to perform on a phone equipped with a camera. Once you’re familiar with cocoa’s delegate/callback system then doing something with the camera is that simple. But still, I’m interfacing with a Controller object and not the Camera or “media” object. From an MVC perspective Apple’s controllers seem pretty heavy and try as I may there’s something icky. The Abstraction is there, though which is my complaint with many of the other functions I’d expect an always connected device to abstract. Let’s look at Android’s API for doing the same thing.&lt;/p&gt;

&lt;h3&gt;Taking a photo with Android&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;Camera camera = Camera.open();
camera.takePicture(null, null, new PictureCallback(){
    public void onPictureTaken(byte[] _data, Camera _camera){
        //Handle the photo
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So, lines of code aside they’re very similar but the Android object API is clear and uses the same idioms it has established with other objects in the system. There’s no muddy “is it a Controller or Model” confusion. To me, that’s an simple OO encapsulation that provides an intuitive API. AGAIN: my eyes, my perspective and my opinion.&lt;/p&gt;

&lt;p&gt;For the last few points, before I go back to exploring both of these &lt;strong&gt;GREAT&lt;/strong&gt; platforms. Things that have me more interested in Android at this moment than iPhone…&lt;/p&gt;

&lt;p&gt;1: &lt;strong&gt;Android is open&lt;/strong&gt;. Which means there’s a greater chance that your app will be seen on a diverse set of devices. This is a blessing and a curse. You’ll be required to handle such discrepancies but again, Google seems to have abstracted those decisions into small questions you can ask the platform in one method. But you &lt;strong&gt;will&lt;/strong&gt; have to be concerned about it and I can see a legion of experts born from this very issue. Good knew is you can sell or give away your apps on your terms. Not Apple’s.&lt;/p&gt;

&lt;p&gt;2: &lt;strong&gt;Testing&lt;/strong&gt;. Java has better support for current BDD/TDD methodologies. I’m going to state conjecture as fact here. I can’t find a great BDD framework for Obj-C and who cares if I can’t use it well in cases where I’m testing C code.&lt;/p&gt;

&lt;p&gt;3: &lt;strong&gt;Memory Management is a solved problem&lt;/strong&gt;. Google knows it, you know it. the C champions will always lay claim that Garbage Collection is slower than their own hand crafted memory management techniques and that may, in fact, be true. But by what degree? What about line of business application developers? They know the value of one less thing to worry about; one less thing that can go wrong. I know obj-C 2 has an opt-in GC but I never see it in use on the iPhone and I’m not sure why. I assumed it wasn’t supported, again, someone please let me know in the comments if this is wrong.&lt;/p&gt;

&lt;h2&gt;In the end, everything is perspective&lt;/h2&gt;

&lt;p&gt;As one who primarily has developed line of business applications and the bulk of that on the .NET platform or in Ruby, Google’s Android platform seems directly poised at the GTD crowd and Apple’s iPhone seems hell bent on restoring C++ and it’s superset Obj-C to the forefront of Alpha-Geekdom. Both are great approaches but when you couple the innovation coming out of the Android devices, the open source ease of startup, tooling support and articulate APIs; Apple needs to continue to innovate on the development side as well as the consumer side.&lt;/p&gt;

&lt;p&gt;Apple is, hands down, the reason we’re even interested in this comparison. I love my iPhone. I’m certainly not giving up on my goal of getting in the App Store with something, ANYTHING. But I must say, if they are not cognizant of the power that Google is providing developers they may see folks piloting, prototyping and promoting Android over the iPhone.&lt;/p&gt;

&lt;p&gt;I don’t know if it’s time for the Cocoa community to build a better boat or Apple’s but somehow, to me, that’s yet another solved problem and therefore another win for Android.&lt;/p&gt;

&lt;p&gt;OK, Jon. I await your post clarifying all of this up for me on the iPhone side and even better, I CANT WAIT to pair with you on iPhone fun at CodeMash! ;)&lt;/p&gt;</description><link>http://fallenrogue.com/post/304905380</link><guid>http://fallenrogue.com/post/304905380</guid><pubDate>Mon, 28 Dec 2009 15:56:32 -0500</pubDate></item><item><title>Lessons from Uncle Bob</title><description>&lt;p&gt;Those of you who were fortunate enough to hear Uncle Bob Martin speak at Columbus Ruby Brigade last Monday are aware of the amount of wisdom that can be garnered from listening to him. If that is the case then certainly pair programming with him for the day would be equally enlightening.&lt;/p&gt;

&lt;p&gt;Monday morning when I walked into the EdgeCase offices there in a corner was a face that I was familiar with but had never met personally. This is not unfamiliar for me, I’m usually the last person to know anyone with a reputation that precedes them. I say hello and introduce myself but as he was already pairing with our friend Adam I said hi, got a Mountain Dew out of the fridge, found a seat in the bullpen and got down to the business.&lt;/p&gt;

&lt;p&gt;10 minutes into the day Adam has something else that has to be done for a client so we look around and Ken says: “Leon why don’t you pair with Uncle Bob on a few features”&lt;/p&gt;

&lt;p&gt;I don’t know the app.&lt;/p&gt;

&lt;p&gt;I don’t know what were working on.&lt;/p&gt;

&lt;p&gt;I run to sit next to Uncle Bob.&lt;/p&gt;

&lt;p&gt;I don’t care what we’re working on, there’s no way that I’m going to impress a man who’s literally been there and done that so it was time to sponge. Or at least I thought. Over the next 5 hours we meticulously poured over the details of what I would perceive as a simple feature to understand not just what the feature is but why we couldn’t test the particular abstraction. Uncle Bob was interested in seeing how we could test a haml view in isolation of the rest of the app and frankly I was fascinated. We were looking over APIs and playing around with how to mock state for our view just so we could ensure that numbers that were currency would be properly set to 2 decimal places.&lt;/p&gt;

&lt;p&gt;You see, it was not that the task was simple or complex, the task was not important. What was important was how we were planning to &lt;strong&gt;work on&lt;/strong&gt; the task. How were we going to cleanly isolate the functionality so that we could simply test and verify that we had, in fact, completed the task. In the end, we didn’t quite isolate the view in the way that he (and eventually I) wanted but we completed the task and Uncle Bob was clearly amused by the session that day and, as I hope, he seemed to have fun pairing with me as we ran down the rabbit hole, exploring the possibilities of our API and expanding my concept of what it means to be testable.&lt;/p&gt;

&lt;p&gt;It’s difficult to communicate wisdom transferred; it’s difficult to work next to someone whom you’ve respected from a far for so long and package the experience in 500 words or so and I hope that I’ve been able to capture a bit of it. While I may not communicate it well now, know that it was a great experience, one that I hope to replicate again and again as I seek to improve how I approach my craft and evolve my understanding of the profession I’m in.&lt;/p&gt;

&lt;p&gt;Thanks Uncle Bob for the great day of code! I had a blast!&lt;/p&gt;</description><link>http://fallenrogue.com/post/296832517</link><guid>http://fallenrogue.com/post/296832517</guid><pubDate>Wed, 23 Dec 2009 09:28:18 -0500</pubDate></item><item><title>JavaScript Part 5 - The Client Side</title><description>&lt;p&gt;So, if JavaScript ever really had a true intention, I believe that intention was to bring static HTML documents to life. I’m sure if we read the history since 1995 (give or take a year) then we’ll notice that most work with JavaScript was aimed at giving the static web a much needed shot in the arm.&lt;/p&gt;

&lt;p&gt;To understand how JavaScript works its magic we have to dive into the DOM or Document Object Model and it’s relationship to the document being rendered to the client.&lt;/p&gt;

&lt;h3&gt;DOM: The Document Object Model&lt;/h3&gt;

&lt;p&gt;At the top of the stack we have the object that does the presenting to the user: The Window aka The browser. This is represented as the &lt;strong&gt;Window&lt;/strong&gt; object. A window is presenting one document at a time (I mean, you can’t have more than one URL at once, right? Well, frames but those are children of the main document.) and therefore Window has a property of Document.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;window.document
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;or just…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;document
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Why can we just call on &lt;strong&gt;document&lt;/strong&gt;? Because our top level object is implicitly the window. Pretty sweet, right? Making sense? I hope you said yes. If not, we’re just looking at the HTML document you requested from the server the same way JavaScript does… as objects. Now we know we’re speaking the same dialect but what else is added?&lt;/p&gt;

&lt;p&gt;In plain English: The DOM is an object model for traversing and manipulating documents rendered by web browsers. There is a W3C standard for the DOM and the reason that JavaScript can hurt is because it is inconsistently implemented by browsers. So developers took to writing a lot of boiler plate “browser sniffer” code to ensure that behaviors were similar for all users viewing their sites. Internet Explorer is typically dragged through the mud because it’s version 6 of the browser was exceptionally slow to adopt DOM elements and events as standard and instead continued down its own path. But why? The answer is simple. IE 4 and 5 drove innovation in the DOM/JavaScript space. IE added additional attributes and events, e.g. drag and drop&lt;/p&gt;

&lt;p&gt;As you can imaging there are various objects representing the HTMLElements that are part of the document (and some that may not be!) so we won’t list all of them here, I just wanted to let you know the top level context in client side JavaScript (window) so that you’re not surprised but what you’re going to see when we move to the bane of client side JavaScript: Events. (this is, without jQuery or your lib of choice!)&lt;/p&gt;

&lt;p&gt;So, working with the DOM is made stupid easy when you’ve got help in the form or jQuery or MooTools or Prototype or some other lib that equalizes the DOM implementations of various browsers. Those folks are doing great work and I encourage you to use them (I certainly do!) for your work. BUT let’s look at what Mozilla’s Firefox does with HTML events so we can see how these event objects and the implicitly passed &lt;strong&gt;this&lt;/strong&gt; contextual object cause confusion to the uninitiated.&lt;/p&gt;

&lt;p&gt;First we have to establish an event to listen for. We do this in Mozilla’s flavor of JavaScript by doing adding a “listener” to a particular event. How about a click on a button? Easy enough. :)&lt;/p&gt;

&lt;p&gt;Here’s the HTML document we’re going to use. Save it as an html page and open that document in Firefox. Open Firebug and follow along.&lt;/p&gt;

&lt;script src="http://gist.github.com/260659.js?file=blank_doc_with_button.html"&gt;&lt;/script&gt;&lt;p&gt;OK, first up is to grab a reference to the button element in the document.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var btn = document.getElementById("clickr");
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, let’s create a simple function that will handle clicks the user makes on “clickr”.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function ourCallback(evt){
    alert(evt);
    alert(this);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now let’s listen for clicks on &lt;em&gt;btn&lt;/em&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;btn.addEventListener("click", ourCallback, false);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you’ve been reading along then it should come as no surprise the to types of objects that are alerted when we run this code in the Firebug JavaScript console.&lt;/p&gt;

&lt;p&gt;The event object sent as an explicit argument is…
    [object MouseEvent]
The &lt;strong&gt;this&lt;/strong&gt; operator at this point gets the value of the implicitly passed sender… 
    [object HTMLButtonElement]&lt;/p&gt;

&lt;p&gt;So our button is this because it directly broadcasted the click and all listeners know who initiated the click.&lt;/p&gt;

&lt;p&gt;That should make pretty good sense by now but what happens if the callback function has expectation on &lt;strong&gt;this&lt;/strong&gt; that we’re not going to know at runtime? Here’s a case where things can be odd and cause lots and lots of frustration, well at least for programmers in the late 90s. :) Let’s create an object that simply counts a number every second. We’ll add an interval counter that alerts that value. Sounds simple right? It is, if you know what to expect when using &lt;strong&gt;this&lt;/strong&gt;. Consider the following…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var ob = {count:1, currentCount: function(){ alert("my count is "+ this.count);}}
ob.currentCount();
setTimeout(ob.currentCount, 2000);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So, what’s going to happen when we run this sample? We’ve created an object to do our incrementing (even if we don’t have an incrementer for it… details!) for us. On line 2, ob calls currentCount and then on line 3 we ask the window to tell ob to call currentCount after 2 seconds. right? well, not so much, go ahead on run it. If you’re following along you’re going to see the following message alerted to the window:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my count is 1
my count is undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;OH NOES!!! That’s right, friends, let’s read these same 3 lines of code the way JavaScript did… in plain english:&lt;/p&gt;

&lt;p&gt;“Ok, the programmer created an object with one property and one method and assigned it to a variable named ‘ob’. Cool. I can do that. Next the programmer is asking ob to call currentCount. Cool, no problem. Finally they want the window to call currentCount in 2 seconds. done and done!”&lt;/p&gt;

&lt;p&gt;You see, here we have our first curiosity caused by the simplicity and power of JavaScript. Remember when we said functions where higher order and first class citizens? Remember how “this” refers to the contextual object? Well if you do, then in plain english, what is happening here is that we’re delegating the function defined in ob.currentCount which is&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function(){ alert("my count is "+ this.count);}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So, when we call the setTimeout method we’re just caching the function signature and not any reference to the parent object that references the function. So when the function is called after 2 seconds what is &lt;strong&gt;really&lt;/strong&gt; being called is this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;window.currentCount(); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But that’s not what we &lt;em&gt;mean&lt;/em&gt;. We want ob to call it. SO, let’s not forget that other great feature of JavaScript: &lt;strong&gt;closures&lt;/strong&gt;. Let’s instead, curry the exact state that we want in the form of a closure to be called at the timeout.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;setTimeout(function(){ob.currentCount();}, 2000); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now when you run line 3, you should see the right alert message. WOW! Isn’t JavaScript cool?! I think so! Anyway, I hope that goes a long way to helping you understand what’s going on in the browser when you’re using JavaScript. Even though libraries like jQuery let us forget about these particulars when we code it’s nice to know what’s going on under the covers. :)&lt;/p&gt;</description><link>http://fallenrogue.com/post/292361688</link><guid>http://fallenrogue.com/post/292361688</guid><pubDate>Sun, 20 Dec 2009 18:10:46 -0500</pubDate></item><item><title>JavaScript Part 4 - the "this" operator</title><description>&lt;p&gt;OK, take a deep breath, hold your nose and get ready to finally understand &lt;strong&gt;this&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When my friends first dive into JavaScript the this operator throws people for a major curve. To really understand what it is I’m going to try my best to distill its essence into a simple explanation that while not fully encompassing the nuances of “this” use should go along way to helping you understand the resulting behaviors of using &lt;strong&gt;this&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From Mozilla:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The &lt;em&gt;this&lt;/em&gt; keyword refers to the context object aka the current object.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;See, that’s simple right? Well, not really. The problem presents itself when we add in JavaScripts scoping rules (hopefully in this series soon!).&lt;/p&gt;

&lt;p&gt;OK, first &lt;strong&gt;this&lt;/strong&gt; being a pointer to the context object is passed into functions implicitly. That’s right folks, it’s not sitting there waiting in the scope that it was originally created in, no, it’s actually passed through to functions auto-magically when you call a function. Consider the following code running in a browser context.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var frank = {name:"Frank"};
var betty = {name:"Betty"};

function sayMyName(){
    document.write(this.toString()+"'s name is "+this.name+"&lt;br&gt;");
}

betty.sayMyName = frank.sayMyName = sayMyName;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All we’ve done here is introduce a few new objects, frank and betty, a globally accessible function called “sayMyName” and gave both betty and frank properties that will call that function. So, if we run this we’re going to see…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[object Window]'s name is
[object Object]'s name is Betty
[object Object]'s name is Frank
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ah, did you see what happened there? the first time we call it the current top level context in the browser is actually the Window object! It was passed to our function (because there’s always a caller) implicitly. So, when betty calls the function the betty object is the current object making the call. Therefore, we see it’s something of type Object (remember where we inherit from?) and that it responds to name with Betty. Frank is the same.&lt;/p&gt;

&lt;p&gt;The lesson here is that &lt;strong&gt;this&lt;/strong&gt; is not set when the function is defined it’s determined when the function is executed and the current contextual object is &lt;strong&gt;this&lt;/strong&gt;. So, where does this mess with people’s heads? Check this example out…&lt;/p&gt;

&lt;script src="http://gist.github.com/258229.js?file=js-this-fail.js"&gt;&lt;/script&gt;&lt;p&gt;Let’s run this sample and then run it again with the commented out line… well back into the code. That should bring this crazy subject clearly into light.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="370" id="viddler_fallenrogue_10"&gt;&lt;param name="movie" value="http://www.viddler.com/player/97dd7b5/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;embed src="http://www.viddler.com/player/97dd7b5/" wmode="transparent" width="437" height="370" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" name="viddler_fallenrogue_10"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;The important thing to remember is that this is a reference to context object. When we transfer the context to a variable in the top level (global) space we’re really adding that as a property on Window in the case of browser scripting. So, the first time we call it, name is not defined, but if you call it a second time, you’ll notice that name is updated to the variable and since window now has a name value it’s printed to the screen.&lt;/p&gt;

&lt;p&gt;There’s a whole host of variations on this very wide topic but I believe if you understand exactly what &lt;strong&gt;this&lt;/strong&gt; is referring to it can help you to quickly identify when it’s been used in an unintentional way in your JavaScript code. In fact, having written this part, I believe we could do another follow up on the quirks of &lt;strong&gt;this&lt;/strong&gt; in the browser which is where most will have context to it. Events… yes… events + this can be tricky. Stay tuned for that. :)&lt;/p&gt;</description><link>http://fallenrogue.com/post/286582175</link><guid>http://fallenrogue.com/post/286582175</guid><pubDate>Wed, 16 Dec 2009 17:27:00 -0500</pubDate></item><item><title>JavaScript Part 3 - Prototype Based Language</title><description>&lt;p&gt;For a few years the alpha geek crowd has been debating (read: justifying their own preferences) what type of Object Oriented Language features are the most developer friendly. I never have the heart to remind these folks that everyone experiences the world differently and some will always understand class based OO and others want something else. Well, one of those “something else” is used in JavaScript: Prototype Based Objects.&lt;/p&gt;

&lt;p&gt;Given my known readership and audience I’m going to assume you’re all familiar with a class based language. I’m going to use C# in this example but the comparison should hold up for similar languages like Java.&lt;/p&gt;

&lt;p&gt;Let’s take a look at defining a class with with to create objects (a.k.a. instances). My example is a simple model that most folks can relate to… Person!&lt;/p&gt;

&lt;p&gt;C#
&lt;script src="http://gist.github.com/257978.js?file=C%23+baseed+object+creation"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;Now let’s do the same thing in JavaScript…&lt;/p&gt;

&lt;p&gt;JavaScript 
&lt;script src="http://gist.github.com/257979.js?file=JavaScript+object+creation"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;These examples are nearly identical from the standpoint that they represent the same data. They are 2 ways of saying the same thing, one in class based way and the other in a prototype based way. By assigning the &lt;strong&gt;proto&lt;/strong&gt; attribute on a prototype based language you’re essentially saying this is your new “parent”, thus providing the object the features and functionality.&lt;/p&gt;

&lt;p&gt;Now, in the JavaScript version we did not create a constructor for creating those objects but we can do that too if we like…&lt;/p&gt;

&lt;script src="http://gist.github.com/257990.js?file=JS-+alternative+object+const."&gt;&lt;/script&gt;&lt;p&gt;And finally, remember that our functions are first class citizens and can be used to establish members for an object.&lt;/p&gt;

&lt;script src="http://gist.github.com/257991.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;p&gt;Now, &lt;strong&gt;proto&lt;/strong&gt; is not the idiomatic why of defining this inheritance. Most the time you’ll see the more common “prototype” property. Why did I show the other? Just giving you options. Here’s a slight variation on what we’ve done using the prototype object.&lt;/p&gt;

&lt;script src="http://gist.github.com/258119.js?file=alt+inheritance+-+JS"&gt;&lt;/script&gt;&lt;p&gt;As you can see, this is &lt;strong&gt;very&lt;/strong&gt; close to the version I presented and is more common. It’s nice to know but methods just for your own reference. I personally prefer the latter but that could be habit more than preference.&lt;/p&gt;

&lt;p&gt;OK, well, that’s basically it for now from a 500000 foot view. Well talk more about this awesome topic soon!&lt;/p&gt;</description><link>http://fallenrogue.com/post/286438599</link><guid>http://fallenrogue.com/post/286438599</guid><pubDate>Wed, 16 Dec 2009 15:09:36 -0500</pubDate></item><item><title>JavaScript Part 1 - hello JavaScript!</title><description>&lt;p&gt;JavaScript is an object oriented scripting language.&lt;/p&gt;

&lt;p&gt;It is a dialect of the ECMAScript standard.&lt;/p&gt;

&lt;p&gt;It is dynamic, loose typed and prototype-based.&lt;/p&gt;

&lt;p&gt;It has first-class functions. That means a function is an object in JavaScript. You can treat it as such.&lt;/p&gt;

&lt;p&gt;If you’re looking for some history of the language and an introduction of the “why” check out Mozilla’s &lt;a href="https://developer.mozilla.org/en/A_re-introduction_to_JavaScript"&gt;A re-introduction to JavaScript&lt;/a&gt; And once you’ve ready that or if you’re skipping it please continue…&lt;/p&gt;

&lt;p&gt;It’s time to say hello to one of my favorite languages again. This time from my perspective. If there’s something you love, I believe you have little reason not to share it with the world. Do I want everyone to start programming in JavaScript? Well, that’s a lofty goal and not really my point here. My point is more to share my passion and clear up a few misconceptions.&lt;/p&gt;

&lt;p&gt;So, play along with me friends… first task is to create a way to play. There are many but I’m going for low barrier for entry. Open firefox and download (if you don’t have it) firebug.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="329" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/66e7aacb/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/66e7aacb/" width="437" height="329" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;Now that you’ve got a way to play with JavaScript and the DOM, let’s start building a better understanding the features of the language. Create a blank HTML page and open it in Firefox. This will be the blank canvas with which we experiment with the language in a REPL style system via Firefox and Firebug. Let’s play with the loose type system first. Try assigning a variable a numeric value and then assign the same variable a string.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="353" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/33e38452/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/33e38452/" width="437" height="353" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;See? Type is loose.&lt;/p&gt;

&lt;p&gt;Wanna see why we functions are “first-class” or “objects”? Let’s create a function. The syntax for creating a function is…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function [name](params[,n]){
    //method body
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, why is name optional? Because functions, even without a name, are still objects. A common practice is to keep the function anonymous but assign it to a variable for later use.&lt;/p&gt;

&lt;p&gt;var sayHello = function(say){alert(say);}&lt;/p&gt;

&lt;p&gt;If you type both types of function into firebug you’ll see…&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="353" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/2b2fac2c/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/2b2fac2c/" width="437" height="353" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;That they can be called the same way and as objects can be passed around just as you would any other type of object.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="353" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/9c022013/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/9c022013/" width="437" height="353" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;Internet darling jQuery makes extensive use of this feature in its implementation. It typically calls this practice “accepting a callback” which is just another way of saying “give me a function to call when I’m done doing whatever I’m doing and I’ll call it. I will also pass that function data related to my initial task.”&lt;/p&gt;

&lt;p&gt;Finally, what does it mean to be “prototype based”? Well, that’s where we’re going to start Part 3, so until next time write something fun using Firebug and JavaScript. Try using the DOM’s document object to write something to the page.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="353" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/6a5bb39b/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/6a5bb39b/" width="437" height="353" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;See, good times. gooooood times. :)&lt;/p&gt;</description><link>http://fallenrogue.com/post/286438240</link><guid>http://fallenrogue.com/post/286438240</guid><pubDate>Wed, 16 Dec 2009 15:09:11 -0500</pubDate></item><item><title>JavaScript Part 2 - The Free Stuff</title><description>&lt;p&gt;This is a tough one. I don’t generally like to discuss the built in objects of a language because they are easily searched for. Instead I’ll list a few and then talk about using them as that’s a little more subjective and worthy of discussion and continual review.&lt;/p&gt;

&lt;p&gt;Quick Reference:&lt;/p&gt;

&lt;h4&gt;Types&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;ul&gt;
&lt;li&gt;Numbers&lt;/li&gt;
  &lt;li&gt;Strings&lt;/li&gt;
  &lt;li&gt;Booleans (true|false) &lt;/li&gt;
  &lt;li&gt;Objects&lt;/li&gt;
  &lt;li&gt;undefined and null &lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h4&gt;Special Objects&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;ul&gt;
&lt;li&gt;Date&lt;/li&gt;
  &lt;li&gt;Regular Expression&lt;/li&gt;
  &lt;li&gt;Functions&lt;/li&gt;
  &lt;li&gt;Array&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, yeah, mostly these will function as you’d expect them to. Therefore, as I stated before, let’s skip that. Instead let’s discuss some fun things that are legitimately ambiguous to developers sharpening their JavaScript knives.&lt;/p&gt;

&lt;h3&gt;Objects in JavaScript&lt;/h3&gt;

&lt;p&gt;One of the things that throws folks is the notion of object being a specific type and staying that way after being initialized from a class. But in JavaScript objects are more like Hashes in Ruby or Dictionary&lt;key, value&gt; in C#. If you make that mental connection then seeing the JavaScript Object Notation (or JSON) will provide context for what you’re working with.&lt;/p&gt;

&lt;p&gt;If you remember from part one, our first object creation was done as such:&lt;/p&gt;

&lt;script src="http://gist.github.com/257991.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;p&gt;If you look the object is created as it’s defined using the object notation which looks &lt;strong&gt;remarkably&lt;/strong&gt; familiar to just some key-value collections mentioned about. When doing this you can then access those properties on the person instance using the dot or [] notation&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;person.name
person["name"]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;both are fine ways to access the properties on your objects. So, knowing that, there are a couple of ways to create new objects in JavaScript they both establish a direct relationship to the super “Object” class.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var person = new Object();
var person = {}; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;{} is object notation so by specifying it on the right side of the assignment operator (=) yields a new Object instance to person.&lt;/p&gt;

&lt;p&gt;There are many different ways to use the properties of this new object (which we mentioned earlier see new/[]) but the important thing to note is that since our objects have no concrete relationship to strong types we can access and assign properties on our objects at will.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;person.likes_cake = true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;if perfectly legal even if the member “likes_cake” is not a property on person. This allows for some real dynamic behaviors to occur at runtime. So, why would you use [] vs the . property syntax? Well, if you’re a daring individual you could assign properties that are named the same as reserved keywords. for example, “if” is a reserved keyword in JavaScript so just coming out with&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var letter = {};
letter.for = "leon@foo.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;is not going to work. BUT if use the [] property notation we can!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var letter = {};
var letter["for"] = "Leon@foo.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;pretty cool stuff there! I don’t know that you’d want to do it from an idiomatic standpoint but it’s possible if you’d like to have it.&lt;/p&gt;

&lt;h3&gt;Functions&lt;/h3&gt;

&lt;p&gt;Functions are important to understand and as a bonus they are remarkably simple to understand. Basically, here are the “rules” to live by…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;defined with the function keyword&lt;/li&gt;
&lt;li&gt;optional name&lt;/li&gt;
&lt;li&gt;optional argument list&lt;/li&gt;
&lt;li&gt;code block to be executed when the function is executed. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AND as a bonus every function gets a few properties that may be of value. One of my favorites is the “arguments” object. It’s just an array of all the arguments that were passed to the function. Let’s play a bit with it.&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="353" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/86d8dd31/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/86d8dd31/" width="437" height="353" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;pretty excellent stuff, right? many languages share this feature but I enjoy the compact way that JavaScript lets you extend the use of a functional all the way to runtime. Now that’s fun but with all languages that provide higher order functions it becomes very important to understand how they can be called recursively. Tail recursion (in short: last part of the function calls itself again until told not to) is an important concept but how do you know what do call again if your function has no name? Well, the answer lies in the arguments object. Let’s write a small tail recursive anonymous function. We’ll assign it so that we can call it a first time but since it doesn’t know what it’s own name we’ll use the arguments object’s callee property to call the method until we’re done. Type along with me using FireBug…&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="300" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/956b2001/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/956b2001/" width="437" height="300" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;In there we see 2 things: first that the callee property is a little more than just a pointer to the current function, it also is an object that is persisted across the function calls so we were able to use that to hold a reference to a number as we counted down from the first argument that was passed in. Pretty cool, right!? That’s some wonderful, powerful introspection and provides JavaScript some of that signature magic that makes me fall in love with it over and over again.&lt;/p&gt;

&lt;p&gt;Next we’ll take a look at arguably the most powerful feature in JavaScript and one that has gained a lot of exposure in other languages recently: closures.&lt;/p&gt;

&lt;h3&gt;Closures&lt;/h3&gt;

&lt;p&gt;Now closures have variation of definition and the minutiae of that semantic debate are not in the scope of this article. Instead let’s go with the following simplistic definition: closures maintain the scope of the variable at the time that the function is created and persisted after you believe they have fallen from scope. A simple example of this “scoping” would be using an inner function to establish an outer scope while establishing an inner scope for later use.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function greeting(prefix){
    return function(name){
     return prefix + " " + name;
 };
}

helloTo = greeting("hello there,")
document.write(helloTo.toString());
document.write("&lt;br&gt;&lt;br&gt;");
document.write(helloTo("Leon"));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;let’s run this code to examine the results in our REPL environment: FireFox+FireBug :)&lt;/p&gt;

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="300" id="viddler"&gt;&lt;param name="movie" value="http://www.viddler.com/player/4e16a696/"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="flashvars" value="fake=1"&gt;
&lt;embed src="http://www.viddler.com/player/4e16a696/" width="437" height="300" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="fake=1" name="viddler"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;That’s enough for now, friends!&lt;/p&gt;</description><link>http://fallenrogue.com/post/286438451</link><guid>http://fallenrogue.com/post/286438451</guid><pubDate>Wed, 16 Dec 2009 15:09:00 -0500</pubDate></item><item><title>Cucumber intro</title><description>&lt;p&gt;Well, I’ve had a few requests for the slides on this one. So, without further adieu, I present the slides for my cucumber introduction.&lt;/p&gt;

&lt;p&gt;I will also be presenting this topic at CodeMash in January and the Cleveland Ruby Brigade on 11/30/09. So, stop on by and let’s talk BDD in person.&lt;/p&gt;

&lt;iframe src="http://docs.google.com/present/embed?id=ajdp6bntgf8h_51fxs2bjft" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;</description><link>http://fallenrogue.com/post/257331789</link><guid>http://fallenrogue.com/post/257331789</guid><pubDate>Wed, 25 Nov 2009 16:13:55 -0500</pubDate></item><item><title>Re: "It's OK not to unit test" or what you do on your time is your business. </title><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/cashto/archive/2009/03/31/it-s-ok-not-to-write-unit-tests.aspx"&gt;Read this. Don’t skim, read the whole thing.&lt;/a&gt; Then come back here. I have a thought that I wish to express here and it may be controversial to some. You’ve been warned.&lt;/p&gt;

&lt;p&gt;The issue in this cashto’s blog entry hovers mostly around platform and language. Simply put, unit testing is the art of testing small units of code. In Test Driven Development you do not write new code until you’ve written a test that clearly articulates your intent. You essentially &lt;strong&gt;use&lt;/strong&gt; the code that you plan to implement via a test and only &lt;strong&gt;then&lt;/strong&gt; write the implementation behind the api that you’ve just crafted. That process has a side effect, commonly referred to as “Emergent Design”. One commonly documented side effect of Emergent Design is that it encourages highly modular, de-coupled sections of code that have high cohesion and low coupling. In some circles, these are indications of a healthy code base.&lt;/p&gt;

&lt;p&gt;Now, having spent a great deal of time in C# and about a year doing Ruby professionally, I can say that the approach that I prefer to take, BDD, is significantly more complex in a static language on a proprietary platform than when writing similar software in a dynamic language on an open platform. Therein lies the difference. When I read articles like this, I see them almost universally from the static language camp. By camp, I mean to imply that these are folks that have chosen to work in static typed languages on open and closed platforms. The bemoan the time it takes to craft tests, ponder their significance and after some frustrating exploration chalk it up to another fad but ivory tower academics. The problem with this assumption is that these techniques are solving big problems for folks like me who, in a dynamic language, needs a little more coverage to ensure that the expectations I’ve defined for the system are being met. Unit testing provides this. If I were interoperating with SharePoint’s object model (and I have… extensively) then I would not worry about unit testing. Why? Because the effort that it takes to isolate the units provides diminishing returns against how I will write it. So, if you want to skip it there… I’m not gonna hold it against you. BUT, if you write a Ruby gem that I plan to use and I install it and run the tests and there are &lt;strong&gt;no&lt;/strong&gt; tests then you’re not playing nice and I WILL hold it against you.&lt;/p&gt;

&lt;p&gt;Yes, my expectations for cultures and communities is slightly different. That’s me. that’s my experience. How about an analogy? In static languages, I believe that Dependency Injection is a valid and powerful pattern. In Dynamic languages it’s a waste of time that provides no value. Does that mean that DI is bad because I prefer a dynamic language? No, of course not. It only means, given my circumstances, DI is worthless. Is DI worthless? no. Make sense? Yes. Sound overly politically correct? Yes.&lt;/p&gt;

&lt;p&gt;This is all to provide the following context: The blog above was written by a man who works for Microsoft on Microsoft products. Given their slow uptake for developer testing support and de-emphasis on unit testing and TDD(ing) .NET projects. That’s the experience that has shaped cashto’s reality and you should know that when you read that article. It’s no wonder, to me, that when developers look to gain from the experiences of developers outside their home platform they grow frustrated and no amount of practice ever seems to make the problem go away. The reason is not that they don’t understand or haven’t tried the idioms they see rather that culturally, it is not valued in the same way that watching the compiler fail is, or in the case of ASP.NET, the same way pressing F5 and getting a mini browser REPL going is.&lt;/p&gt;

&lt;p&gt;When I worked, briefly, at Telligent their code base was written using that “Microsoft” model. I often tried, sophomorically, to get the entire team to see the benefits of testing, because I was needed it in my own workflow. As the other developers either sided with me or against me I noticed how smart people with lots of experience can simple never come to an agreement. If I wasn’t laid off, then it was clear to me that we were probably never going to be a match made in heaven. That’s not a slight on Telligent, they were a great employer and I got to work with some very highly respected developers in the Microsoft domain. It simply proved to me, that I didn’t belong there. So, I joined EdgeCase. Suddenly I’m not fighting anymore. I’m not arguing. I’m back to the business of writing software and not fighting ideological battles and writing “memos”.&lt;/p&gt;

&lt;p&gt;So, is it “Ok &lt;strong&gt;not&lt;/strong&gt; to write unit tests”? Sure, of course it is! If you wish to do so, it’s quite alright. The chances are, though, you will find it difficult to relate to and work with an increasing number of talented software craftspeople who believe in automated testing as a fundamental aspect of their workflow and that would be the real shame.&lt;/p&gt;</description><link>http://fallenrogue.com/post/234250827</link><guid>http://fallenrogue.com/post/234250827</guid><pubDate>Thu, 05 Nov 2009 16:43:30 -0500</pubDate></item><item><title>My jQuery talk for the MVC firestarter</title><description>&lt;p&gt;Hey, if you would like to follow along today during my 1:00 talk please feel free. If you missed it, here are the slides, I’ll publish the code samples some other time.&lt;/p&gt;

&lt;iframe src="http://docs.google.com/present/embed?id=ajdp6bntgf8h_29gpjjgngc" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;</description><link>http://fallenrogue.com/post/215515425</link><guid>http://fallenrogue.com/post/215515425</guid><pubDate>Sat, 17 Oct 2009 10:52:08 -0400</pubDate></item><item><title>Goodbye, Twitter</title><description>&lt;p&gt;Twitter has done more harm to my emotional state than it has ever done good. The good is that for people that I really enjoy communicating with I get insight into their lives and what they are into. Twitter was a place that helped me find EdgeCase and for that I’m grateful but one good thing and n+1 arguments, well, it’s not balance.&lt;/p&gt;

&lt;p&gt;The bad part is that sometimes you do not want a direct line into someone’s inner most thoughts, including my own. People sometimes get quite hostile when you’re not agreeing with them and they often think that an alternative opinion is ALWAYS a request for debate. Sometimes it’s not. Sometimes it’s just view from an alternative perspective. Not a excuse for a 140 character lecture.&lt;/p&gt;

&lt;p&gt;Anyway, the signal to noise ratio on twitter has led me to the point of truly diminishing return with the service and I’ve deleted my account. Who know, perhaps this will get me back into blogging… probably not too  heavy though.&lt;/p&gt;

&lt;p&gt;The point of this post is that while I had fun, everything ends and for me Twitter ends today.&lt;/p&gt;</description><link>http://fallenrogue.com/post/214907142</link><guid>http://fallenrogue.com/post/214907142</guid><pubDate>Fri, 16 Oct 2009 15:38:30 -0400</pubDate></item><item><title>Because I'm lazy... Fundamentals of OOP in C#</title><description>&lt;p&gt;Here you go friends, I’m sorry this took soooooo long but it’s up.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://fallenrogue.s3.amazonaws.com/Fundamentals_of_OOP.ppt"&gt;Fundamentals of OOP in C#&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;:) Please to enjoy!&lt;/p&gt;</description><link>http://fallenrogue.com/post/206044560</link><guid>http://fallenrogue.com/post/206044560</guid><pubDate>Tue, 06 Oct 2009 15:06:52 -0400</pubDate></item><item><title>The Leon Gersing over-exposure tour continues!</title><description>&lt;p&gt;If there is such a thing as over exposure, then I’m experiencing it at the moment. So, please try to bear with me and I’ll do my best to keep from jumping the shark. For those interested here’s a list of some shows that feature me. Also, a few notices of where I’ll be speaking in the near future, please drop by and let’s chat! :)&lt;/p&gt;

&lt;p&gt;David Giard’s Technology and Friends - &lt;a href="http://www.davidgiard.com/2009/09/02/LeonGersingOnRuby.aspx"&gt;Leon Gersing on Ruby&lt;/a&gt; We had a great time taping this during DevLink!&lt;/p&gt;

&lt;p&gt;Dot Net Rocks #476 - &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=476"&gt;Is Software Too Complex?&lt;/a&gt; I’m not featured but do speak from the audience… which lead to:&lt;/p&gt;

&lt;p&gt;Dot Net Rocks #482 - &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=482"&gt;Leon has a love affair with Ruby!&lt;/a&gt; - That’s me talking about using language as the right abstraction.&lt;/p&gt;

&lt;p&gt;Deep Fried Bytes #36 - &lt;a href="http://deepfriedbytes.com/podcast/episode-36-what-happens-in-the-speaker-rsquo-s-lounge-is-supposed-to-stay-in-the-speaker-rsquo-s-lounge/"&gt;What happens in the speaker room is supposed to stay in the speaker room&lt;/a&gt; - What started as a group session for my burnout has become a podcast! Make sure you listen through the credits for some great outtakes!&lt;/p&gt;

&lt;p&gt;UPCOMING DATES -&lt;/p&gt;

&lt;p&gt;Tuesday 9/22 - Quick Solutions Suite in Polaris - Cucumber 11:30 AM - This lunch and learn goes over the basics of BDD and using Cucumber as a tool to bridge the gap between technology and business.&lt;/p&gt;

&lt;p&gt;Wednesday 9/23 - &lt;a href="https://www.clicktoattend.com/invitation.aspx?code=140649"&gt;Software Engineering 101&lt;/a&gt; - Introduction to OOP using C# and TDD hands on - in the first session we’ll cover the basics of OOP and how those are applied to C#. In the TDD session in the afternoon we’ll be building a small game together using the TDD method. Bring a laptop and courage!&lt;/p&gt;

&lt;p&gt;10/15 - Louisville .net user group - Cucumber talk from above&lt;/p&gt;

&lt;p&gt;10/17 - ASP.NET MVC firestarter - JQuery 101 - what it is, what it does and how to use it. In this session we’re going to talk about jquery from bottom to top.&lt;/p&gt;

&lt;p&gt;That’s it for now! Come say hi!&lt;/p&gt;</description><link>http://fallenrogue.com/post/190227174</link><guid>http://fallenrogue.com/post/190227174</guid><pubDate>Thu, 17 Sep 2009 10:31:00 -0400</pubDate></item><item><title>Value and Money are not the same.</title><description>&lt;p&gt;It’s difficult in the U.S. to really understand value. The value of a hard day’s work. The value of a hug. The value of trust. The value of the qualitative. When commoners in the middle to lower classes in America debate politics they do so in an aimless, impotent fashion that allows them to build fortresses of self perpetuating plausible deniability. Instead of understanding issues fully, contemplating the nuance and subtly of an issue, many resort to scripted straw man rhetoric recycled from the “news”. I use “news” in quotes because in a for-profit market even the news is bought and paid for. The information is presented in the same way it is regurgitated and our collective ability to think critically and creatively suffers.&lt;/p&gt;

&lt;p&gt;When I think back to my youth I think back to my parents talking of times of social change and solidarity. They were hippies by their own admission but it’s clear to me that my mother more than my father held to their ideals. It’s possible, I assume, that he was just trying to get laid (successfully, if you count me and my brother) but I digress.&lt;/p&gt;

&lt;p&gt;The health care debate rages on in Washington DC but just like the last 6 elections in this country the debates and arguments are semantic bordering on dogmatic. Representatives are not listening to their constituents because they don’t need to. The changes proposed feed a for-profit medical system at the expense of the very constituency it’s trying to help.&lt;/p&gt;

&lt;p&gt;Single Payer is not on the table and Obama’s solution is a government run insurance plan. Wait… what? you mean, it’s more of the same I just pay for it via my taxes instead of the tax I’m essentially paying by being employed? Who does that help? How does that help? It seems to benefit only one class of people in the equation: insurance companies. By introducing a public insurance company cost of frequently covered procedures will drop, same with some medications and they will see themselves getting paid due to the lower prices. They’ll complain at first because they have to wait 2 years instead of 2 months to buy that island in the South Pacific but they’ll get over it when the number of delinquent accounts is dramatically lower.&lt;/p&gt;

&lt;p&gt;Which brings me around to my point. Value is not only calculated in monetary terms; even in a capitalist society like ours in the US. It can be calculated there but other factors must be considered as well. For instance, as some point we decided that having our neighbor’s homes burn to the ground when someone could have done something about it killed the private Fire Brigade system we had the US. We agreed, collectively, that since we have to pay for it anyway, we might as well make Fire a government run program. It’s locally run and funded and works really well. Is it better than a private only fire system? I suppose that debatable but it’s certainly easier to understand and benefit from. We value that service in our neighbors and communities and we benefit from it personally when/if we need it. If you don’t think your neighborhood suffers from a burnt lot, you’ve never lived near one.&lt;/p&gt;

&lt;p&gt;I don’t know if single payer is the best solution to the problem but I do know that a healthy society that can go to the doctor without fear of losing everything they’ve ever worked for in their lives is more valuable to me than the executives lining their pockets at the expense of my friends and family. I already pay a high premium to insure my family (and it doesn’t cover everything) and if that same money could be used to equally care of my neighbors I’d gladly continue to pay it. If it meant that I never have to spend a day requesting medication that my doctor has prescribed can actually be given to me then that is worth more than any amount of money I can dream of.&lt;/p&gt;

&lt;p&gt;The value of my neighbors’ health; the value of my community is in actively participating in its success not becoming a profiteer in its inevitable hardships.&lt;/p&gt;

&lt;p&gt;In my opinion, and this is simply my opinion, it’s incumbent upon us to care for each other. To value life and freedom over profits. Money is not everything, it’s not even half of everything. The minute we remember that a friendship and health are more important than the bill for those things is the minute we know exactly what adds value.&lt;/p&gt;

&lt;p&gt;UPDATE: for the record, I’m not saying Single Payer is without fault or that it’s even the best solution. I’m just saying there’s got to be a way to care for people without compromising on the quality of that care. I simply do not believe the for-profit medical system works to that end. The details for that I leave in the hands of politicians. I’m just trying to put my thoughts down so I do not have to repeat them in public over and over again. :)&lt;/p&gt;</description><link>http://fallenrogue.com/post/154435501</link><guid>http://fallenrogue.com/post/154435501</guid><pubDate>Sun, 02 Aug 2009 17:13:32 -0400</pubDate></item><item><title>Apple's Google Voice Fail.</title><description>&lt;p&gt;Look, I’m no pundit. I’m just a developer trying to do right by the world. When giant corporate entities start pissing all over one another I could usually care less. The PC vs Mac debate, for instance, is something I never really cared about. I don’t prefer the Windows OS. I prefer OS X. That’s a preference not a condemnation of Windows. I develop on/for windows machines, happily.&lt;/p&gt;

&lt;p&gt;So, when I noticed that Google has filed with the FCC because Apple has rejected their app due to competitive issues I have to side with Google. Mostly because I believe if you have a marketplace to sell apps you should be given a choice in apps. I mean, I loathe the Apple iPhone Mail application. I HATE it. I would love to see a great alternative but that’s probably not going to happen anytime soon because Apple will reject the app before anyone gets the chance to choose an alternative. I’m sure most people love it, and that’s great but limiting my choice so you can lock folks into your idea of a good app is pretty lame.&lt;/p&gt;

&lt;p&gt;But Google vs Apple… I don’t really care. They make enough money to make Solomon blush so what the hell do I care. The truth is that Apple wants you to use their shitty phone service because of ATT. Google wants to funnel your calling through it’s Google Voice app to provide Google Voice customers a seamless experience. Either way I’m making phone calls and ATT and Apple both benefit by my using the phone even if it goes through the Google Voice proxy. But they want to have a “bottom-line-fight” to ensure that their projections are accurate and revenue streams do not dry up due to… dare I say… competition.&lt;/p&gt;

&lt;p&gt;All of that will be fought in courts and we’ll hear of it second hand and yawn. I’ve made a financial commitment to Apple’s iPhone platform (for 12 months that is) and during that time, I don’t care.&lt;/p&gt;

&lt;p&gt;What I DO care about is &lt;a href="http://www.maclife.com/article/feature/how_google_voice_debacle_hurting_thirdparty_developers"&gt;this gem&lt;/a&gt; which is about how Apple then went after 3rd party developers looking to provide a bridge to the Google Voice service in the form of a native app on the iPhone. Apple, unceremoniously, pulled all GVoice apps from the store and placed the onus back onto the developers to communicate the change to their customers. The essentially removed a product from the public market without notice, making the developers look bad and ensuring a horrible customer service experience from the folks that purchased apps in earnest.&lt;/p&gt;

&lt;p&gt;Not only is this poor form but it’s monopolization reminiscent of IE 6 on Windows. When that was the default browser and it couldn’t be uninstalled from the system and bullied others out of the market. A few law suits from the Europeans and finally we get choice on Windows and less lock in from the vendor. That’s what’s happening on iPhone right now. The suits are doing all the thinking and it’s making life shitty for the people who are constantly paying into the closed iPhone system.&lt;/p&gt;

&lt;p&gt;I’m now seriously considering my options for the phone that I’m going to choose in 12 months. If this is how Apple chooses to conduct its business, it’s developers and the community that’s formed around these products then I may have to see what all the buzz is about in Palm Pre or Android’s neck of the woods.&lt;/p&gt;

&lt;p&gt;UPDATE: here’s another &lt;a href="http://www.riverturn.com/blog/?p=455"&gt;account of Apple’s Douche nozzlery&lt;/a&gt;&lt;/p&gt;</description><link>http://fallenrogue.com/post/154394865</link><guid>http://fallenrogue.com/post/154394865</guid><pubDate>Sun, 02 Aug 2009 15:47:00 -0400</pubDate></item></channel></rss>
