30 January 2009

RubyCamp Lyon 2009

J'ai appris l'existence de ce barcamp dans le blog de Ruby onRails - comme quoi, la lecture de RSS n'est pas que de la procrastination ;-)

Dans la série "troublantes coïncidences", j'avais déjà prévu de passer sur Lyon le WE du samedi 21 février et ce pour des raisons personnelles. Ce barcamp tombe donc bien à point! Etant donné que je suis en train de planifier mon retour en France pour le second semestre 2009 - sans doute dans la région lyonnaise - cela sera une parfaite occasion de rencontrer les rubyistes locaux.

Je compte faire un remix de mes présentations de Paris on Rails 2008 et citcon amsterdam 2008:

  • La vengeance du concombre masqué: Tests d'Acceptance utilisateur avec cucumber
  • Rouge, Vert, Refactor: Initiation au Test Driven Development avec RSpec
Par rapport à Paris, je compte faire beaucoup plus court, 15 minutes - 10-15 slides - et beaucoup plus simple. Si vous avez des attentes particulières, je vous serai reconnaissant de bien vouloir me contacter ou de laisser un commentaire.

Plus d'info sur http://barcamp.org/RubyCampLyon

27 January 2009

n-dash VS m-dash

The good thing with software engineering is that you learn a new thing every day. Computer programs depend on so many different layers, libraries, hardware that it should be no surprise that things go wrong all the time.

One of the Agile practice to fight this entropy is unit testing and especially Test Driven Development (TDD). Since 2005, I work with TDD, writing the specs (tests) before the code and this is the best design method I have used so far! No more dead code :-) Moreover, the final code looks really clean and the tests are the best up to date documentation with examples I will ever write.

I am implementing a Schedule class which encapsulate event times such as in the flavorpill.com. Following TDD and being lazy(!), I wrote the spec first so I copy pasted directly the "When" text from the event page in flavorpill to my editor:

it "should output in a pretty format such as Tuesdays–Sundays (10am–5pm)" do
@schedule.starts_at = 10.am
@schedule.ends_at = 5.pm
@schedule.pretty_format.should equal("Tuesdays–Sundays (10am–5pm)")

=>expected "Tuesdays–Sundays (10am–5pm)", got "Tuesdays-Sundays (10am-5pm)" (using .equal?)

Don't you see the difference? Me neither, and it took me at least 5 minutes to understand what was going wrong.

After increasing the size of the font, it's a bit easier to spot:

expected "Tuesdays–Sundays (10am–5pm)", got "Tuesdays-Sundays (10am-5pm)"

Olala! A colleague of mine who works as an editor introduced me to the wonderful world of n-dash and m-dash.

The hyphen is used to hyphenate compound words and between non-continuing numbers, e.g., phone numbers.

The en dash - is used to "connect continuing, or inclusive, numbers -- dates, time, or reference numbers." [Chicago Manual of Style, sec. 5.115]

The em dash is used "to denote a sudden break in thought that causes an abrupt change in sentence structure." [Chicago Manual of Style, sec. 5.106]

Morality: copy-paste is evil!

But be honest, who knows about these characters, did you learn it in english classes? As far as I am concerned, there is no key in the keyboard to type the m-dash...