Me on TDD/BDD/Pairing and Jason Fried’s TED Talk and “why work isn’t done in the office…”

This talk is so right, but could it be so wrong at the same time?

Just watch this, that’s all I have to say. Jason is so right about this topic. Here’s a few quotes to convince you.

  • “I’m going to talk about work, and why people can’t seem to get things done at work…“
  • “If you ask people the question, “where do you go when you really need to get something done?” you typically get three different types of answers; one is a kind of a place, a location or a room, another is a moving object, a third is a time…“
  • “The Train”  <  – That one caught my fancy, if you’ve ever talked to me about transit you know that one caught me…  🙂
  • “What you almost never hear people say is “the office”“
  • “Managers and bosses will tell you the distractions at work are things like Facebook, Youtube…”  “…and they’ll go so far as to ban it…”  “…what is this China?!”
  • “The real problem in the modern office is the M & Ms”   <  –  Oh hell yeah, so very true.
  • “Manager’s jobs are really to interrupt people…” “…they don’t really do work so they have to interrupt you.“
  • “You would never see a spontaneous meeting of employees, no, managers do that…“

To summarize, do telecommuting right, and it will absolutely blow away anything that is ever accomplished “at the office“.

Oh my Adron, you’re such a hypocrite! You are always talking about TDD and BDD and Pair Programming and teams being together and…

YES! You have a point, so let me throw this prospective hypocriticalness of mine away and prevent any concern that I’ve missed a logical connection. I assure you, I haven’t.  🙂

I do support people working remotely. I also love to have a team close together with high communication (and here’s the catch) that is focused on the problem. This is what Jason is talking about! People generally don’t stay focused in cross-cut teams, with this focus and that focus and then throw managers on top of that. The next thing you have the dreaded M & Ms dramatically decrease any chance of work getting done.

If a team can be left to their work, especially if they have clear problems to attack, to pair on, to write tests against and to implement this is the precise example of why to work together. However, I’ve also seen successful, very successful teams working together remotely. Jason & the 37signal’s crew have done that before! They’re a prime example of it.

But How Does Remote Work, Work?

You have to be disciplined, you have to have check in points, but take 2-4 hours at a chunk and do work! Use e-mail and instant messaging as Jason points out. These are the keys to successfully getting things done! Where I currently work, we actually get this type of allowance. We even do remote pairing (albeit rarely, but it has been done)!  It can work, and it can work very well. However we often break away and have time chunked where we don’t talk, but instead leap forward in our efforts to get work done. Sometimes we pair, sometimes we don’t, it generally depends on if we’re writing code or just getting configs and databases put together to write code against. No reason to pair on a configuration file!  😉

So really, the key isn’t to be physically collocated, or that you have to be remote to each other. The key is to have communication, high levels of communication, but at the right moments in time! The communication must be focused and to the point. It much bring information that is needed, not long drawn out meetings of vacuous boredom and emptiness. The work is done when someone, or a pair, can focus on the problem at hand and find the solution to that problem – alone or with their pair. These are the keys to getting real work done!

Thanks TED Talks for getting me all fired up this morning!  🙂

Ruby on Rails Hittin’ The Big Time, A Friday PSA

How do you know that Ruby on Rails has already hit the big time?  Not that it needs anymore proof that it is absolutely one of the MAJOR platforms available right now…

  1. Recruiters now regularly come to user groups & offer to “buy the beer” afterwards.
  2. The split of job searches on sites now easily come up with dozens upon dozens of Ruby on Rails Jobs.
  3. Enterprise & Other Managers are commonly asking what the “Ruby on Rails Dev Base” looks like.  In other words, they want to know who and how many people they can hire.

Anyway that you look, you’ll see Ruby on Rails making inroads at a company near you! Keep your eyes peeled, and if you aren’t polyglot now, you might want to start thinking about it.

Cheers!  Happy disruptive markets to you!  😀

High Availability From Non-High Availability: OpenStack, Dell, Crowbar, Private Clouds, and Moving the Enterprise Forward…

The Environment

Recently a conversation came up about high availability in a traditional Enterprise Environment. Let me paint the picture for this environment;

“This environment has several hundred servers, and several hundred applications. These application range in simple client server applications to n-tier applications strung across multiple services and machines. Some are resilient, some are not so resilient. These applications have administration that ranges from needing rebooted on a daily basis to not being touched for months at a time. Needless to say the range of applications is vast.

In addition to all these applications the data center had a mix of hardware concerns that directly effected how applications were built.”

With that basic idea, one can imagine that planning for high availability is by no means a simple thing. However there are opportunities now available, that Enterprises have never had previously. In the past an Enterprise would usually have some big heavy hitter come in, such as EMC. The Enterprise would then pay them hundreds of thousands or even millions of dollars to do an analysis. Then the Enterprise would probably fork over another couple hundred grand here and there. This would happen time and time again, until some level of high availability would be achieved.

Well, to put it simply, a lot of that effort is unneeded today. The effort that is needed, with the right team, is in the hands of the Enterprise itself. Some people who know me, would immediately think I’m about to say “just setup an account at AWS and build to the cloud…” which is obviously the easiest, secure, and most progressive route to go. But no, I’m going to step in with some other solutions, that can be provided on-premise. I’ll elaborate at a later time the reasons behind this.

I’m going to now step through some key technologies available today. These can be used to provide high availability from the software architecture points of view. In your enterprise, if you have off-shored, outsourced, or otherwise attained your Enterprise Software, these functionalities and capabilities will be up to the creating provider. You’ll have to go to them for further information on how to change or adapt the architecture.

Software Architecture

For in house software here are some APIs, SDKs, and tools to help attain the much sought after high availability (Always aiming for that mythical five 9’s).

Dell’s Cloud Solutions

So without significant research time, the Dell Solutions can be thoroughly confusing at first glance. They don’t offer anything related to actual “cloud services” such as AWS, Windows Azure, or Rackspace. What they’re simply offering is hardware to build out resilient data centers and contributing actively to open source software solutions.

The Dell Cloud Edge Software is available on Github at dellcloudedge. The best places to start researching what is available are on two key blogs; JBGeorge Tech Blog and Rob Hirschfeld’s Blog.

Another key part of the Dell Solution is Crowbar. Dell open sourced Crowbar at the 2011 OSCON Conference. Even though most of the sample configurations revolve around Dell Poweredge Servers and Rackspace Cloud Builder Solutions, the software is available for use on system that are completely unrelated from Rackspace or Dell Solutions. Crowbar, simply put, is the software used to get servers up and running. As quoted on the Dell Announcement released during OSCON,

“Bringing up a cloud can be no mean feat, as a result a couple of our guys began working on a software framework that could be used to quickly (typically before coffee break!) bring up a multi-node OpenStack cloud on bare metal. That framework became Crowbar. What Crowbar does is manage the OpenStack deployment from the initial server boot to the configuration of the primary OpenStack components, allowing users to complete bare metal deployment of multi-node OpenStack clouds in a matter of hours (or even minutes) instead of days.”

That quote now brings up the next piece of software, OpenStack. When building out a data-center it is a solid idea to begin building a platform on which things will operate. OpenStack enables just that. There are two major elements of OpenStack that are key; OpenStack Compute and OpenStack Storage. This is where the architectural paradigm begins to change dramatically for traditional software. This is also where there will  a major sticking point for traditional Enterprise Software that relies primarily on a database on a server, with a web server on a server, and maybe some middleware or a service bus on another server. The massive problem is applications need to focus around horizontal scalability with compute and storage being the two key elements.

In many enterprises this is unfortunate, because a safe estimate would be 95% or more of enterprise applications don’t scale horizontally, or scale at all. If you’re an SOA shop, you’re much farther along than most. Most enterprises simply rely on the traditional vertical stack. This is a major problem. So how do we bridge this gap between the compute plus storage architectural design goal versus traditional architecture? That’s where the follow software comes to the rescue.

Windows Server AppFabric

Windows Azure AppFabric (Click to visit the MS Azure AppFabric Site)

Windows Azure AppFabric (Click to visit the MS Azure AppFabric Site)

(Not to be confused with the Windows Azure AppFabric, for differences review this article)

Windows Server AppFabric (Click for the MS Site)

Windows Server AppFabric (Click for the MS Site)

The Windows Server AppFabric has several capabilities that help an enterprise application leap forward into the modern era of horizontal scalability with a more clear way to focus on compute and storage. The feature set of the AppFabric includes these key functions that enable this leap forward (more information available in this article):

  • Workflow Instance Management
  • Scaling Out Distributed Applications

These by no means are the only features of AppFabric. For a thorough description of scenarios and applications around AppFabric check out Introducing Windows Server AppFabric.

In Summary

Where Does This Leave Enterprise Environments? The simple answer is, “A really long way away from achieving the scalability, cost savings, integrity, agaility, and capabilities of public cloud computing“. You can quote me on that. The effort to acheive data integrity and up time to perform standard business, it’s already here for Enterprises, but to go beyond that and extend hours of operation, acheive 5 9’s of up time, and decrease costs in a dramatic way is generally cost prohibitive in private cloud infrastructure and especially in traditional data center operations. The fact is, things will still go down. Applications have a long way from being resilient, idempotent, or designed with an architecture that allows them with the concept of the public cloud “design for failure” concept.

So what to do about this? The best thing for an Enterprise Application Environment is simply to start building applications with horizontal scalability in mind. Build with the concept of systems being nodes, with idempotent messaging, clear and redundant messaging queues, and thinking – even while limited by traditional data centers and limited visualization technologies – thinking in a resilient architectural style instead of the traditional vertical mindset.

These tools I’ve outlined can help your Enterprise move forward in a traditional data center environment, a private cloud infrastructure environment, and be prepared for public cloud scale and capabilities.

Accidentally Monstrous Code Weekend++ Startup Weekend PDX++ Codez

This last weekend, extending into Monday, Tuesday, and Wednesday were a MASSIVE coding weekend and vacation for me. I initially left with the intent to basically just be lazy and not do anything in particular. Maybe write a little code, learn some more about Rails, RSpec, or Mongo DB. But hold, things changed!

I boarded the train down to Portland on Thursday of last week to attend the ALT.NET PDX Group at E-Discover (thanks E-Discovery for the space!). The meeting went great with a solid 10 people attending and contributing to some great conversation topics like; mongo db, migrations, windows 8, which way the cloud technologies are going, and HTML5 + CSS + Javascript came up more than once.

After that I had a full remote work day fighting with deployment of SQL Compact Edition. Even though Scottgu says you can deploy it with the magical bin deploy, I’ve found that to be absolutely NOT the case. It is unfortunate as I might have to rip something apart pending it isn’t actually going to work on SQL CE. As soon as the work day wrapped up around 4pm, I headed over for a short stay at Beer & Blog at the Green Dragon. After a beer, I was off to Urban Airship to check out this Startup Weekend that I’d managed to luckily get into. It all came about like this…

kwestinI still have two free tickets to the sold our Portland Startup Weekend….really surprised nobody has claimed them.

adron@kwestin Can I claim one? I was planning on going… but then saw they were sold out. 🙂

kwestin@adron sold! DM me your email address and I will have them set you up. It will be a great event.

adron@kwestin Awesome! DM following.

Which of course set me on a course to go build startup stuff! I was stoked! Later in the week Silicon Florist – AKA Rick Turoczy followed up with a blog entry also.

I joined a team, that eventually built an idea around searching less and learning more, which we called Digischool.me. Kind of getting rid of the noise around an individual’s efforts to learn something online. Here’s our presentation at the round up at the end of Startup Weekend.

After the intense Startup Weekend I spent the next three days (Monday, Tuesday, and Wednesday) catching up on some personal projects and coding. Overall, a very productive vacation and also very relaxing.

I’m definitely sold on Startup Weekends as a a lot of run, and will be attending these in the future. So if you’re heading to one, let me know, we might just have to team up!

Keeping Your Rails Projects Organized Right!

I’ve been working with Rails now for about 3 months. At first I jumped right in like a bull in a china shop. I have since, suffered the frustration of doing so. I’ve experimented on OS-X, Windows, and Linux (primarily the Ubuntu Distro). Among these three operating systems, getting up and running with rails is a breeze. Sure, I’ve wrecked more than a few apps I started, blown to smithereens a few machine images, and been generally destructive – but that’s not a bad way to learn at all. 😉

Through this trundling, I’ve come to find there are a few things that should be reviewed and learned thoroughly before smashing into the china shop (i.e. rails or Ruby for that matter). One of these tools is RVM. Another is Git. These tools, without doubt or question, you MUST LEARN! There is just too much value in both of these tools to try to ignore either one. First a quick description of each:

Git – Git is a source control server and respective client software.   RVM – Ruby enVironment Manager – RVM, sometimes referred to as the Ruby Version Manager also, is a way to maintain the various gems and other environment settings that are used for a particular project. It enables switching back and forth between versions of ruby, keeping ruby updated, and much much more.  In .NET, think of it as choosing which version of .NET to use, except with more power to go beyond just merely choosing which version. These two tools are pivotal in having a smooth, consistent, and understandable workflow. There is one other issue for Windows users here though, RVM does not and will not ever run on Windows. One can however install cygwin to get it running or they can use Pik.

Workflows

Below I have a short workflow tutorial, which I’ve broken out to getting started, working, and operational.

Getting Started

This is the first stage of any development project. Regardless of using PHP, Rails, .NET, Java, or whatever, there are certain things that need done. The key elements that I’ve found over the years include, not in any particular order;

  • Setup source control
  • Setup your environment
  • Start your basic project

After each of these things are done, and working together properly, it’s time to get coding. 🙂  First, setup a directory that will be the home for the entire project.

$ mkdir sampleWorkflow

Next run the command to setup your environment for this specific project.

$ rvm --rvmrc --create 1.9.2@sampleWorkflow
$ cd ..
$ cd sampleWorkflow/
==============================================================================
= NOTICE                                                                     =
==============================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory =
= This is a shell script and therefore may contain any shell commands.       =
=                                                                            =
= Examine the contents of this file carefully to be sure the contents are    =
= safe before trusting it! ( Choose v[iew] below to view the contents )      =
==============================================================================
Do you wish to trust this .rvmrc file? (/Users/adron/a_code/sampleWorkflow/.rvmrc)
y[es], n[o], v[iew], c[ancel]> yes
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
$

In the command above, rvm being the application, –rvmrc the parameter for what is being done, and –create is the command for the action to be taken. The 1.9.2 before the @ is the Ruby version and the value after the @ is the environment name, in this case being the same as the folder.

Once the command is run, move out and back into the folder to view how the rvmrc file will work. When you navigate into the directory again, the script will run, initiating the environment for Ruby 1.9.2. It will also ask to confirm if you trust the file. Running the ruby -v command to determine the version, will now display the active ruby version for this folder.

If you’re only using one version of Ruby, this might not seem that useful. But over time as you work with multiple projects, you will often find that different projects use different versions of Ruby. Sometimes 1.8.7 or jruby or rubinius. If that’s the case, rvm is a life saver in simplifying and keeping environments neatly organized.

Now that the environment is setup, we’ll need source control setup and as I generally prefer, an initial commit. Make sure to move into the directory that was just created. Issue the following git commands.

$ git init
Initialized empty Git repository in /Users/adron/a_code/sampleWorkflow/.git/
$

With our directory now intialized for git, it is best to get a git .gitignore file created. (I know, that’s a lot of get gittin). Use mate, or whatever your editor is you prefer, and create a .gitignore file.

$ mate .gitignore

At this point you’ll want to add something to the ignore file. I always start with the following basic files and folders to ignore. I’ve also written a short entry on what these files and folders are that I’m ignoring in the post Gotta Get Git.

#OS junk files
[Tt]humbs.db
*.DS_Store
.sass-cache/
.bundle

#Webstorm & Rubymine files
*.idea
.idea
.idea/

#Rails Heroku and other bits to ignore
*.sqlite3
db/*.sqlite3
public/system/*
.bundle
log/*.log
tmp/**/*
tmp/*
doc/api
doc/app
*.swp
*~

Once that is entered, save the file and close. Next we’ll do our first commit. This is always a good practice, then there are no accidental commits of files that aren’t needed. Also note, I did not exclude the rvmrc file, this is needed to insure clarity about the environment when cloning the repository in the future.

$ git add -A
$ git commit -m 'first commit'
[master (root-commit) ea81bed] first commit
 3 files changed, 131 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 .rvmrc
 create mode 100644 .rvmrc.10.29.2011-11:33:32
$

Now that this is recorded in source control history (not of course in the main repo, we’ll do that in a second) I like to go ahead and create the rails application. Move to a directory just below where the ‘sampleWorkflow’ directory is and create a rails application named the same thing. Since we already created the .gitignore file, we’ll be prompted to overwrite, which isn’t needed since the .gitignore is already setup correctly.

$ ls
sampleWorkflow		someOtherAppOrSomething
$ rails new sampleWorkflow
       exist
      create  README
      create  Rakefile
      create  config.ru
    conflict  .gitignore
Overwrite /Users/adron/a_code/sampleWorkflow/.gitignore? (enter "h" for help) [Ynaqdh] n
        skip  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css

…more stuff shows up…

 create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using multi_json (1.0.3)
Using activesupport (3.1.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.1)
Using erubis (2.7.0)

…more stuff shows up…

Using railties (3.1.1)
Using coffee-rails (3.1.1)
Using jquery-rails (1.0.16)
Using rails (3.1.1)
Using sass (3.1.10)
Using sass-rails (3.1.4)
Using sqlite3 (1.3.4)
Using turn (0.8.3)
Using uglifier (1.0.4)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

…and then when finished do a commit of the recent additions.

$ git add -A
$ git commit -m 'Adding Rails 3.1 Project.'

Now add the appropriate remote sources for git and the project is ready for development.

$ git remote add origin git@github.com:Adron/Kata-Coding-in-Rails.git
$ git remote -v
origin	git@github.com:Adron/Kata-Coding-in-Rails.git (fetch)
origin	git@github.com:Adron/Kata-Coding-in-Rails.git (push)

The example, with extra example code in place, is available on @Github at https://github.com/Adron/Kata-Coding-in-Rails.

Operational

On a regular basis, while coding, one wants to commit their regular work and push those changes to the server (@Github in this scenario). After every change, add the changes to the commit, then commit with a message as shown. When done, do a pull to insure everything is up to date and then a push.

$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout --- ..." to discard changes in working directory)
#
#	modified:   Gemfile
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git add -A
$ git commit -m 'updated Gemfile.'
[master b06aa76] updated Gemfile.
 1 files changed, 0 insertions(+), 1 deletions(-)
$ git pull
Already up-to-date.
$ git push
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@github.com:Adron/Kata-Coding-in-Rails.git
   6986cd0..b06aa76  master -> master
$

Operational

This section, I’m going to primarily provide a bunch of links to specific instances of features for Git or RVM.

Git Branching

$ git checkout -b modify-branchSwitched to a new branch 'modify-branch'$ git branch  master* modify-branch

…make some changes…

$ git add -A
$ git commit -m 'committing a minor readme.md file change while in a branch.'
[modify-branch 726e770] committing a minor readme.md file change while in a branch.
 1 files changed, 3 insertions(+), 1 deletions(-)
$ git push
Everything up-to-date
$ git checkout master
Switched to branch 'master'
$ git merge modify-branch
Updating b967d4e..726e770
Fast-forward
 README.md |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
$ git branch -d modify-branch
Deleted branch modify-branch (was 726e770).
$

Git Rebasing

Git Stashing

Managing Gemsets