Virtual Surreality

It's too real to be true

Browsing Posts in Coding

The JAOO conference has changed it’s spelling, but not its excellent multi-technology, multi-discipline, deep, pragmatic content. Apart from the great conference lineup, I’m particularly excited to see the Erlang tutorial (by Ulf Wiger) and the F# tutorial (by Amanda Laucher and Joel Pobar). This continuing investment into functional programming by the conference organizers shows a [...]

Came across this twice in the past two weeks. How NOT to do it: $(‘form :submit’).click(function() { $(this).attr(“disabled”, true); $(this).val(“wait…”); $(this).addClass(“disabled”); }); Doing it the above way, the click event will indeed fire, but on some browsers the submit event will not. The event to bind to is submission of a form, not clicking of [...]

A little “remember me later” for conditionally deploying a Rails 3 app running on Ruby 1.9 on Heroku. $ruby_version = `ruby –version`.split[1].to_f source :rubygems source ‘http://gems.github.com’ gem ‘rails’, ‘~> 3.0.0′ gem ‘bson_ext’ gem ‘decent_exposure’ gem ‘haml’ gem ‘mongoid’ group :development, :test do if $ruby_version < 1.9 gem ‘ruby-debug’ else gem ‘ruby-debug-base19′, “0.11.24″ gem ‘ruby-debug19′, “0.11.6″ [...]

Object/Relational Mappings (ORM’s) are in the wrong place in the architecture.

An application should have minimal impedance mismatch with the persistence of its own data. External or ancillary systems should bear the cost of mapping between paradigms. If you want to access application data in a relational way for reports, do the mapping for the report.

Squealer is a simple, declarative language where the mapping from the tree structure of MongoDB to the tuple space in mySQL can be scripted.

Prepare Java strings for JavaScript evaluation, similar to SQL prepared statements. Saves you from quote escape nightmares!

When you have more backslashes than words in the strings you are constructing, perhaps it’s time to look at another way of handling special characters like quotes.

Should it be assertEquals(expected, actual) or assertEquals(actual, expected)? This discussion came about because at the Chicago Code Camp, Jim Suchy from 8th light was demonstrating TDD in JavaScript by building a simple unit testing library. One of the methods he created was the typical assertEquals. In the code on github he had a signature of [...]

CodeMash

2 comments

I’ve been given the privilege of speaking at CodeMash 2009 in Sandusky, Ohio this coming January. The presentation and discussion will cover the learning from implementations of Guerilla SOA and will include code and demonstration based on the WCF. It may change some minds about the default approach to the WCF programming model and open [...]

My colleague Jay Fields recently blogged about the value of test names. We had a little discussion about it yesterday on IM. Here’s a summary. Josh Graham I feel the test name is important for two reasons: 1) it is intentional programming – a neural pathway is established in your brain as you write the [...]

My CTO, Rebecca Parsons, announced the publication of the ThoughtWorks Anthology a few days ago: I am thrilled to announce that the ThoughtWorks Anthology is now ON SALE! http://www.pragprog.com/titles/twa There are essays by Roy and Michael Robinson, Martin, Neal Ford, Tiffany Lentz, Stelios Pantazopoulos, Ian Robinson, Erik Doernenburg, Kristan Vingrys and James Bull, as well [...]