I’ve Never Met These People

Ted defines the “software laborer” as:

“somebody who comes in at 9, does what they’re told, leaves at 5, and never gives a rat’s ass about programming except for what they need to know to get their job done [...] who [crank] out one crappy app after another in (what else?) Visual Basic, [that] were [...] sloppy, bloated, ugly [...] cut-and-paste cobbled-together duct-tape wonders.”

Now let’s look past the hyperbole, and the populist jargon, and see if we can identify just who Ted is talking about. Firstly, they work 9-5. Secondly, they get their job done. Thirdly, they crank out lots of (apparently useful) apps. And finally, they make a mess in the code. The implication is that they are not late, have no defects, and their projects never fail.

I’ve never met these people. In my experience a mess in the code equates to lots of overtime, deep schedule overruns, intolerable defect rates, and frequent project failure — not to mention eventual redesign.”

Source: Uncle Bob: “The Laborer and the Craftsman”

The Backwards Monk

A certain monk had an odd method of writing code. When presented with a problem, he would first write many automated tests to verify that the yet-unwritten code was correct. These would of course fail, as there was nothing yet to test. Only when the tests were done would the monk work on the desired code itself, proceeding diligently until all tests passed.

His brothers ridiculed this process, which caused the monk to produce only half as much application code as his peers—and even then only after a long delay. They called him Luohou, the Backwards Monk.

Java master Banzen heard of this. “I will investigate,” he declared.

Upon his return, the master decreed that all members of the clan who were done with the week’s assignments could accompany him to the swimming hole as reward for their efficiency. The Backwards Monk stayed behind, alone.

At the top of the diving cliff, the eldest of the monks peered over the edge and shrank back.

“Master!” he cried. “Someone has scattered the stones of the dam! The swimming hole is empty of water. Only weeds and sharp rocks await us below!”

With his staff Banzen prodded the youth forward towards the precipice.

“Surely,” said the master, “you can solve that problem when you reach the bottom.”

Source: The Backwards Monk

Sequence, Selection, and Iteration: Scala

I’ve been picking up Scala recently, and in my studies I discovered that code such as the following:

class Foo {
  def bar(strings: String*): Seq[String] = {
    strings.map((s:String) => s.bazify())
  }
}

Can be shortened to the following:

class Foo {
  def bar(strings: String*) = strings.map(_.bazify())
}

The idea here being that since the function provides a data mutation on a set of variables, it becomes unnecessary to actually declare the variable each time through in the map. For those of you with a Perl background, this ought to look familiar. It’s called the ‘default variable’ $_ in Perl:

foreach (@strings) {
    print "$_\n";
}

I wonder if this cross pollination between languages was a direct inheritance from Perl or if it was just a natural best choice?

Interesting side note: While I almost universally appreciate C# over other languages, C# provides no such automatic variable wiring:

class Foo 
{
    IEnumerable<string> Bar(IEnumerable<string> strings)
    {
        return strings.Select((s) => Bazifier.Bazify(s));
    }
}

Really I think what this all boils down to is people trying to optimize around the common theme in structure programming, of “Sequence, Selection, and Iteration”. Uncle Bob put it thusly at RailsConf 2010:

Once you strip away the syntactic sugar, argues Uncle Bob, our programming languages essentially boil down to three things: sequence, selection and iteration, and every construct within those languages is some combination of them.

Android Development – Stack Careers

I’ve been itching to get into Android development for some time now. I must confess my ultimate goal is to create games for Android, but I actually can’t do that right now for some reasons I won’t explain here (contact me privately if you’d like to know more). That’s ok though, because creating games is a more complex undertaking on a platform you’re not familiar with. I needed something to get my feet wet, so I chose to create something that is simple but still useful.

‘The Lean Startup’, a book by Eric Ries about how to create successful products and services, proposes a method for accomplishing that goal:

  • Leverage validated learning
  • Scientific experimentation
  • Iterative product releases
  • Measuring progress
  • Gaining valuable customer feedback

To accomplish this, the book defines a ‘minimum viable product’ (MVP). An MVP is “a version of a new product which allows collection of the maximum amount of validated learning about customers with the least effort.”

The general idea is that you should develop something extremely simple in quick order, put it out there, and use it to gain feedback early and begin successive iterations to improve upon it. The advantages are numerous, but most notably is this: If you spend a lot of time scheming and planning out a project and developing without releasing it for a while, you may end up developing something that isn’t quite what your customers want at best, and at worst is something completely useless and opposite of what your customer actually wants.

androidSo I decided to build an Android app that is really simple with limited scope so that I could get something out there that provides value early and is open for feedback loops.

If you’re familiar with Stackoverflow (I really hope you are if you’re a software developer) you may be familiar with Careers 2.0. It’s a job search site tied in with the Stack Overflow crowd. Unlike traditional StackExchange sites which have full APIs, this site has only a limited RSS feed for job seekers (there is no API for employer or resume/CV data, which makes sense given that it’s a source of revenue for StackExchange). I chose to make an app that leverages that simple RSS feed data.

Here’s what parameters this simple RSS ‘API’ supports:

http://careers.stackoverflow.com/jobs/feed
    ?searchTerm=ruby&location=seattle&range=20&distanceUnits=Miles

Given that this is my first Android project, I knew I needed to limit my scope as much as possible because a non-trivial amount of time and effort would actually be just in learning the Android SDK and development process. So to further limit the scope of the effort, I decided I would only implement the skill and location search abilities.

I learned all about Android concepts like activities, intents, and the lifecycle of such things. I learned best practices for network communication, xml parsing, asynchronous work off of the UI thread, and more. I kept a set of bookmarks and guides that were helpful to me along the way, with the intention of writing a blog post series on basic Android 101 development in the future (keep your eyes out for this soon).

48 hours of effort later I have a first iteration suitable for release. Behold, ‘StackCareers’:

Stack Careers Stack Careers

It’s nothing amazing I suppose, but it does one job and does it well (those Unix guys in the days of yore were on to something). If you check it out, I’d love your feedback and suggestions.

Stack Careers app on Google Play

Google Play is a trademark of Google Inc.

The Stack Exchange and Stack Overflow names and logos are trademarks of Stack Exchange Inc.

 

 

YAGNI and Supporting Professional Production Software

Ayende: On Professional Code

“A professional system is one that can be supported in production easily. About the most unprofessional thing you can say is: “I have no idea what is going on”.

YAGNI and Professional Code

“While it’s a relatively rare occurrence, I absolutely hate having to say, “I don’t know what’s going on”. When there’s an odd error being thrown at a user who is trying to do something in our system it’s terribly frustrating to have to crack open the source code of the system to figure out why it’s being thrown.”

Interesting Links for 12/10/2012

Looks like Valve is going to be a contender in living room hardware. Steam Box confirmed: