Monday, June 21, 2010

User Interface ambiguity - never good

This browser dialog was produced as part of the flow of stopping gas service. The text and buttons combine for almost perfect ambiguity. Continue to stop the service? Continue the service? Cancel stopping the service or Cancel the service?

You have elected to stop your NSTAR service.  Do you wish to continue?

      Cancel          OK

Much clearer would be text and button labels such as:

You have elected to stop your NSTAR service. Please confirm that choice:

   Yes - please stop my service
   No - I have changed my mind

Even a simple yes / no would be so much better.

Wednesday, June 9, 2010

Rubinius 1.0 at RailsConf

Rubinus is currently at 1.0.1 as of last week.

No continuations but otherwise Ruby 1.8.7 compatibility.

Faster string method performance through better algorithms than MRI and the just-in-time compiler.

DataMapper 1.0 was demonstrated with Rubinius 1.0 at RailsConf.

Rubinius has a built-in profiler -Xprofile. Also a sampling profiler which will show a high-level view of where your code spends its time - but with a negligible CPU overhead.

The Debugger is targeted to be fixed for 1.1. There is a Ruby API which can be used to integrate another debugger into Rubinius' debug support.

A new Query Agent API which can provide information about the state of the VM even when it is otherwise unresponsive. To be used with a control console (bin/rbx -Xagent.start and bin/rbx console) a port file is produced which the console reads to find how to communicate with the query agent. The console has commands such as pid, mem, set, threads, name and get. The latter gets variable values e.g. get system.backtrace produces the stack trace of the thread which is waiting for user input or whatever else the VM happens to be doing. This interface is very basic but has a lot of potential with future debugger/console integration.

Tuesday, June 8, 2010

Real Software Engineering (at RailsConf)

Glenn Vanderburg is analyzing how software engineering was defined by in the late 1960s and how we got to where we are today. If software engineering is not defined by the waterfall development process or other denigrated process then how is it defined?

"Cost is always an object." - there is a price to 'do things right' and sometimes it is too high.

"Software engineering will be different from other engineering."

Traditional engineering produces a design which a manufacturing group turns into a product. In software engineering a similar process has not been very successful (Software Architects passing off designs to Programmers for implementation).

Reeves suggests that, with the cost of prototyping so low, that testing models to verify that they meet requirements is practical (and much cheaper than the example of testing the wings of a Boeing 777 until they broke).

Vanderburg mentions that Agile practices are criticized by some for being bad engineering - cowboy coding because of the flexibility of the process.

Software engineering assumptions which are now invalid: code is hard to read, to change, and that testing is expensive.

His thesis is that Real Software Engineering is unlike creating bridge designs but retains a process which delivers a product which meets requirements where the key engineering document is the source code.

Monday, June 7, 2010

Rails 3 Deep Dive - part 2


Rails 3 uses Railties to integrate your plugin/gem more cleanly. Having your plugins be gems is a goal.


Lots of configuration possibilities. There is now much more fine-grained support for hooks into the Rails startup process. You now inherit from Rails::Engine to initiate the integration.

Jeremy adds a small sample engine very quickly. Interestingly he appears to be running on Rails 3 on ruby 1.9.2-head - a vote of confidence in the recently attained support.


Now generators have simpler syntax but all the public methods are generator tasks, so make other code private.

Thor is behind the generators and has a lot of built-in support for file system and other operations.

It is easy to configure the components which you want to be used with your custom generators:

view template - say :haml
test framework - say :rspec
fixture replacement - say :factory_girl

The generators use this configuration to create appropriate files (e.g. unit tests with the correct testing framework when a new model is generated).

Rails 3 Deep Dive

Surprisingly, Sinatra was a major part of the first lab in the Rails 3 Deep Dive. The idea was to understand how to use Rack with middleware and Rails, using Sinatra as an easy introduction. I love to learn new stuff but, if you want to teach Rack this way, please give us a heads-up so that ignorance of Sinatra won't slow us down.

The takeaway: Rails 3 uses Rack much more than Rails 2. A lot of Rails filters may or have become Rack middleware.

Git Immersion

The tutorial was good for people who had never used git before. It also gave a good background on the implementation strategy. However, everyone there had used git before so I think a lot of the introductory material about add, commit, status etc would have been too familiar for most.

I zipped through the lab exercises and moved to Brian's Rails 3 Ropes tutorial during the mid-morning break. Over there, I had to race to catch up but got some fun experience upgrading a Rails 2 application to Rails 3. The second half was well-presented (and I will assume the first half was too) by the Envy Labs folks with Gregg Pollack doing the speaking and the rest of the team assisting people as they had problems with the exercises.

RailsConf Baltimore

I have been using Ruby on Rails since just before 1.0 and yet now is the first time I have been able to get to RailsConf. It is also my first visit to Baltimore and my first trip on Amtrak's Acela brought us down here from Boston. RBM sent Brian and myself down here and, given the very productive rail journey, we are already off to a good start.

We have tried to split a lot of the conference content between us. Monday is tutorial day and while Brian is getting an introduction to Rails 3 via Rails 3 Ropes, I am going to a Git Immersion tutorial. This afternoon there is a deep dive into Rails 3 which I am looking forward to.

We have using git for a couple of months now and, while we are very confident in how we are using it, git has far more options that Subversion and I really want to understand more of the possible ways to use it.