Lazycoder

22Jan/080

Productivity vs. quality

Phil Haack linked to an interesting paper which intended to provide evidence that Test Driven Development increases the overall quality and productivity of developers on a given project.

I’m not going to debate the merits of TDD right now, did enough of that on Twitter last night ;) , but I did notice something interesting that I hope the group conducting the test follows up.

It’s in a PDF so I can’t quite link to the appropriate charts, but they are regression charts on page 10 and 11. One compares quality to # of tests written and the other compares productivity to # of tests written. (I’m summarizing). The interesting part to me was that there were some of the participants in the TL (test last) group that scored higher than some of the TF(Test First) group members. In fact, if I’m interpreting that chart correctly, the highest quality code was written by members of the TL group.

The second chart appeared to show that the overall productivity for ALL group members was low, with the exception of a couple of members who fell way outside of the C.I.

I also liked that it appeared that the regression lines were hand-drawn on after the fact. ;)

8Oct/075

What do you want out of a framework?

Had an interesting discussion with blowmage (Mike Moore) over Twitter. I said that having the “param1/param2″ pattern in the ASP.NET MVC made me itchy from a security standpoint. He replied.

Eh, just don’t add them to the URL. The ASP.NET MVC assumes you know what you are doing. I’m sick of frameworks babysitting me.

I replied:

and yet you use a managed language that holds your hand and cleans up your memory for you. ;)

Which came out a little harsher than I meant. But my gist is, isn’t a GC system babysitting you already? How much abstraction do you want out of a framework?

Bottom line is: a web application, is basically an abstraction for sending and receiving headers and HTML to/from a browser. You can dress that process up with domain models and other abstractions. But you *can* build a web application strictly using sockets if you really don’t want to be babysat.

Now that’s absolute crazy talk. No one wants to build an eCommerce site by sending packets over a pipe. That’d be a crazy as writing an operating system today using 32-bit/64-bit x86 assembly. So we accept some levels of abstraction. In fact, we embrace abstraction. Hunting down errors in a memory dump is no fun. Neither is making sure all of your string buffers are properly allocated and sized. We don’t want to have to malloc() and free() char buffers when we want to concatenate strings, so we make a StringBuilder class that handles all the nastiness for us.

It’s also not fun to get stuck in a framework that is so opinionated that when you stray from it’s primrose path you are assaulted by rabid dogs. Opinionated software is good, but a framework should allow you to inject your own opinion.

So what do you really want out of a framework. Ultimately, I think developers really want a framework that will nerf the sharp corners of the underlying hardware for us. We want to be babysat.But we also want the freedom to rip things out and route around the hard parts. And frankly, we want frameworks that work for us, not against us. It’s when the framework is working against us that we rail and rant and cry out for change.

Me? I want the full on Star Trek-Computer:write-me-a-program-that-will-let-me-sell-my-”My Little Pony”-collection-on-eBay” framework.

Feel free to leave your own thoughts below. Difficulty: No Linking to Spolskys “Leaky Abstractions”

31May/073

IronRuby to ship at OSCON this year

via John Lam:

In the end, I think that it’s important to judge our effort based on the code that we ship. We’re going to ship our first CodePlex release of IronRuby at OSCON this year.

There has been a lot of speculation about Microsofts intentions towards our daughter Ruby. Will they try to turn Ruby into Ruby++ the same way they tried with Java? John has been VERY transparent about the process and his intentions. I can safely say that if the project gets derailed (pun intended) in any way, that it won’t be because of John Lams efforts.

That being said, I have no idea how Rails would work inside the CLR. Would your Rails app run as a service on the server? Would it be a new type that gets filtered and executed by ASP.NET?

Filed under: Languages, Ruby 3 Comments
31May/070

Review Board – Code Review workflow from VMWare

I noticed via Reddit:Programming that VMWare has released an online code review workflow system called Review Board. It’s been released under the MIT license and includes hooks for Perforce and Subversion. It’s written in Python using the Django framework.

Very cool. Code Reviews are usually a time intensive activity involving lots of print outs. This application looks to streamline a lot of that.

29May/070

Grady Booch on Software

Saw a video of Grady Booch over at the YUI blog titled “The Promise, the Limits, the Beauty of Software”.

Just the thing to get the old brain working on a Tuesday morning.

10May/0712

Why use XAML?

I'm looking at the SilverlightPad example for the 1.1 alpha version of the plugin. Has anyone else noticed that pretty much all XAML code exhibits the arrow anti-pattern?

XML:
  1. <!---
  2. ///////////////////////////////////////////////////////////////////////////////
  3. //
  4. //  blocks.xaml
  5. //
  6. //
  7. //  2007 Microsoft Corporation. All Rights Reserved.
  8. //
  9. // This file is licensed as part of the Silverlight 1.0 SDK, for details look
  10. // here: http://go.microsoft.com/fwlink/?LinkID=89144&clcid=0x409
  11. //
  12. ///////////////////////////////////////////////////////////////////////////////
  13. -->
  14. <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="500" Width="500">
  15.   <Canvas.Triggers>
  16.     <EventTrigger RoutedEvent="Canvas.Loaded">
  17.       <EventTrigger.Actions>
  18.         <TriggerActionCollection>
  19.           <BeginStoryboard>
  20.             <Storyboard BeginTime="0" Duration="Forever">
  21.               <DoubleAnimation Storyboard.TargetName="path1" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="300" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:2" RepeatBehavior="Forever"/>
  22.               <DoubleAnimation Storyboard.TargetName="path2" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="400" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:4" RepeatBehavior="Forever"/>
  23.               <DoubleAnimation Storyboard.TargetName="path3" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="200" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:8" RepeatBehavior="Forever"/>
  24.               <DoubleAnimation Storyboard.TargetName="path3" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="350" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:4" RepeatBehavior="Forever"/>
  25.               <DoubleAnimation Storyboard.TargetName="path4" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="250" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:2" RepeatBehavior="Forever"/>
  26.               <DoubleAnimation Storyboard.TargetName="path4" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="30" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:2" RepeatBehavior="Forever"/>
  27.               <DoubleAnimation Storyboard.TargetName="path5" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="278" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:4" RepeatBehavior="Forever"/>
  28.               <DoubleAnimation Storyboard.TargetName="path6" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="176" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:4" RepeatBehavior="Forever"/>
  29.             </Storyboard>
  30.           </BeginStoryboard>
  31.         </TriggerActionCollection>
  32.       </EventTrigger.Actions>
  33.     </EventTrigger>
  34.   </Canvas.Triggers>
  35.  
  36.   <Rectangle x:Name="path1" Opacity=".65" Fill="orange" Height="100" Width="100" RadiusX="10" RadiusY="10" />
  37.   <Rectangle x:Name="path2" Opacity=".65" Fill="blue" Height="100" Width="100" RadiusX="10" RadiusY="10" />
  38.   <Rectangle x:Name="path3" Opacity=".65" Fill="red" Height="100" Width="100" RadiusX="10" RadiusY="10" />
  39.   <Rectangle x:Name="path4" Opacity=".65" Fill="yellow" Height="100" Width="100" RadiusX="10" RadiusY="10" />
  40.   <Rectangle x:Name="path5" Opacity=".65" Fill="green" Height="100" Width="100" RadiusX="10" RadiusY="10" />
  41.  
  42.   <Rectangle x:Name="path6" Opacity=".65" Height="100" Width="100" RadiusX="10" RadiusY="10">
  43.     <Rectangle.Fill>
  44.       <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
  45.         <LinearGradientBrush.GradientStops>
  46.           <GradientStop  Offset="0"  Color="white"/>
  47.           <GradientStop Offset="1" Color="Gray"/>
  48.         </LinearGradientBrush.GradientStops>
  49.       </LinearGradientBrush>
  50.     </Rectangle.Fill>
  51.   </Rectangle>
  52.   </Canvas>

I'm not a big fan of the declarative UI movement. (XUL, Apollo, XAML, and now JavaFX). The reasons given for declarative programming usually center around making the UI code human readable making a cleaner break between the UI(view) and the controller(code driving the view). But UI's are complicated things, the code or markup used is complicated also. So what's the first thing most developers do? They go find a tool that makes sure they never, ever have to deal with the complicated markup and code. So if you're never going to read the UI code, why bother making it human readable? Apples Interface Builder has known this secret for years.

Interface Builder stores user interface resources in "nib" files. Nib files are a statically stored representation of the set of interface objects used by the application and their relationships which can be efficiently brought into memory when needed, reducing development time and making it easier to localize an application for different markets.

You could make an argument that Nib = binary XAML. The UI is "freeze dried" at design time and then reconstituted and instantiated at run time.

If you search for "Why use XAML", the pages of results never tell you what the advantage of using XAML over imperative code is. The results just say, "WPF uses it. That's why you have to use XAML".

That isn't to say there aren't some benefits to working with XAML. I love the fact that I can dump ALL my markup and UI code in one file, and concentrate on manipulating the UI in another. You could do that during standard Winforms development, but it wasn't as easy. I'm all about easy. The ability to define timelines and animations within XAML put it above the Nib format.

What benefits do you see in using XAML?