Code And Cocktails

\LaTeX Blog Posting - a Test Post.

| Comments

I have had some annoying problems recently making posterous blog posts via email using markdown.

These problems have made me feel foolish - like I can’t get something /simple/ right. Or even more importantly, like I am incapable of simple copy editing.

Thus I am writing this test blog post.

However, not wanting to write a post saying:

> testing testing - please ignore

Instead I will mumble something about LaTeX and muse on how it would be sort of cool if I could write each post as a LaTeX document and then they’d look pretty gorgeous. Not that I need lots of equations - but really LaTeX would do it so perfectly. isn't it
lovely

Perhaps my biggest problem is that I can’t easily get a nice preview. I am editing this in Emacs using Gnus. Really given that it is Emacs there may already be a solution to my problems - or I could do it myself.

But getting back to LaTeX blogging. What might that look like? Perhaps each post would be a PDF? Or maybe the LaTeX document would be rendered as HTML? Perhaps this deserves a little more thinking.

Time to send this off and see how screwed up it looks in my posterous.

Parody & Analogy: Naresh Jain v. Robert Martin

| Comments

Recently there was a blog posting and a rebuttal and I found that I agreed and disagreed with both. I’d like to briefly discuss them and my opinions on them.

The Party of the First Part

Naresh Jain posted about his opinion about TDD and his ‘dilemma’. He discusses what he sees as the costs of unit testing, both the obvious (writing, running, maintaining), and ones he lists as ‘subtle’.

These subtle ones I recognize but perhaps do not entirely agree with: illusion of safety, opportunity cost, getting in the way, obscuring simpler design.

He concludes with:

Its easy to say always write unit tests, but it takes years of first-hand experience to judge where to draw the line.

I do not find this unreasonable.

The Party of the Second Part

In response Robert Martin posted his riposte. It is a piece of parody and while amusing I think is a smidge off the mark. He again draws the analogy between unit testing and double-entry bookkeeping. He uses the same obvious and subtle costs for double-entry bookkeeping (my understanding of double-entry bookkeeping is limited but his parody seems accurate).

It is obvious that Martin does not believe Jain’s conclusion is reasonable.

Moderation in all Things…

To me Jain’s post is mostly reasonable. I have a minor disagreement with his obvious cost of ‘…understanding other’s unit tests’. To me this is NOT a problem of unit testing at all but of ANY code. Concerning his subtle costs I can agree with this first, understand his second but disagree with his third and fourth. Unit tests are a safety net. But this do not make you safe from all danger. You need to know what they cover and what they don’t. There are opportunity costs, I would not unit test a spike and a several spikes, each of which I throw away, may definitely be a better use of time then a single attempt at unit testing a solution from scratch. However I will then unit test the final solution. His third and fourth points are again not a problem of TDD but a problem of all code.

Martin’s riposte is amusing and I can imagine him speaking it in his particular style. However I ultimately feel it is a flippant response. I don’t think Jain’s position is worthy of ridicule. I think it is worthy of disagreement.

… including moderation.

I am not suggesting some sort of PC-ish self-censoring or to ‘Teach the Controversy’. I disagree with Jain’s post. I have found (warning anecdote:) that TDD outweighs the costs 95% of the time, and in fact the remaining 5% is shrinking as I continue to learn.  

It Has Occurred to Me That D&D Is Opposite of Normal Mythology

| Comments

In normal mythology the far past golden-age was an age when people were
stronger, more beautiful and intelligent than they are now. We have
diminished over time.

With D&D it is the opposite:

 

* In 1974 D&D heroes had +1 bonuses if they were lucky. You got d6 hit
points and you were happy (pretty good for the magic user actually).
Everything did d6 damage. Magic was smaller and rarer - there was no
such thing as Magic Missile. Clerics didn't even get a spell until
second level and getting to second level was hard!

* In AD&D they could get +3, or even the the amazing +3/+6 with 18/00
STR. Fighters got d10 hit points and it was amazing! Magic was more awesome, but still not everyone had it.

* In 2nd edition characters got SKILLS! Clerics had powers

* In 3rd edition characters had /FEATS/! It was like everyone got a
bit of magic now! And people started talking about BUYING magic
items - those things were for sale now in game worlds!

* In 4th edition - this is the golden age. First level characters have
double digit hip points and do massive damage. There are lots of
'magical' abilities for everyone. I'm sure the local beggars have
some sort of daily begging powers or something. Everyone is studly
and puissant.

Thus D&D is the opposite of mythology in a way. But also in a way I
think we may have still diminished a little along the way.

To Name a Thing Is to Have Power Over It.

| Comments

(warning: an odd half-formed thought is contained herein[1])

  1. Yaweh let Adam name all the creatures in the world – this gave Adam dominion over all the creatures.[2]
  2. Medieval magicians believed that knowing the name of a thing would give them power over that thing.[3]

In software development we name things to keep tabs on them. To get a handle on them. Without a name we can’t refer to things — we can’t move things around — we can’t organize them.

More importantly: to have the true name of a thing allows one to have absolute control over it. Without the true name we don’t have full power.

Naming seems to be a special case of the power of language. With language we have the power to communicate, to do things collaboratively. Names let us do actions to things, and to collaborate on those actions.

Footnotes:

[1] In a discussion on Naming in the context of Software Craftsmanship I made an odd statement linking naming in software with medieval magic and the naming of all the creatures from the Judeo-Christian Genesis myth. I thought I could expand it slightly here.

[2] A mashup of the two Genesis myths (1:36 & 2:20).

[3] http://en.wikipedia.org/wiki/True_name, http://en.wikipedia.org/wiki/BSD_Daemon

Century Ride Report

| Comments

This is what a completed century looks like: DONE Everything else are just details.

The dramatis personae of this story are: a 40 year old male: myself and a 39 year-old lady Gale

The trip was approximately[1] the following route.

The fact that it ended up being a Century was a bit of a self-trick on my part. I planned on the trip to Salem and maybe further. Of course when i got to Salem I felt great (only 15-20 miles) so I went off to Manchester-by-the-sea; and still felt great so off to Gloucester etc. Thus after 50 miles I was standing on the train platform in Rockport looking at the sign: Inbound to Boston and thinking – yes, time to head back.

Along the way I saw some lovely sea-sides, like the dock at Rockport where Gale posed for me Gale at the water's edge and Independence Beach in Beverly: Left Side Right Side Also somewhere, I passed this lovely marsh: a lovely marsh

It wasn’t all lovely however, the roads were not always pleasant, the hills steep, and the pilgrims unfriendly: Conant disapproves of this frivolous travel on a Sunday!

Salem, where I took my longest stop in either direction seemed to have only one bike rack in the center of town The official Salem Bike Rack(tm) The sad monuments in Gloucester made me remember the loved one I left behind when I “[went] down to the sea [by bike]” Loved ones left behind They that go down to the sea in ships

In the end it was a great trip. The day was lovely and I managed not to back down from the challenge. I set myself a goal of riding a century this year and have done it. It’s very good to know that I can set myself a goal and carry it out. I hope to take this knowledge and remind myself of it when I hit low points in my other goals/projects.

=====

Footnotes:

[1] (I say approximately since I took several wrong turns here and there (more like wrong straight-ons-when-should-have-turned-s) but that luckily found a slightly nicer track right when I got into Beverly by going on Lothrop Street which led me along the water.)

Bike Ride Report: Longer, Cuter Than Expected

| Comments

On Saturday (2011-06-18) I set out for a 50 mile ride. I was going to
do my 'usual' loop[1] backwards (/e.g./ home -> Norumbega -> Walden ->
Concord -> Bedford -> Lexington -> Home (plus something more to fill in
extra mileage). It did not turn out as expected...

For one, it was cuter than expected. I saw a total of 10 chipmunks[2]
(3 suicidal), 1 groundhog, a serene black-and-white cat sitting on a log
in the woods and 1 duck with bevy of ducklings paddling along in a
culvert. That along with the usual set of squirrels and birds made for
a high cute-level of the ride.

Secondly the ride was longer than expected. I was 6-7 miles short when
I stopped off at home to refresh my water and make some. I decided to
take the loop around the Charles, boring, but would be easy enough -
even with the remnants of Bruins fans littering the ground. However
when 50 showed up on my odometer I decided to press on - I was feeling
pretty good[3]. In all I rode 62.39 miles. That put me just into the
100km territory - thus I have unlocked my next 'achievement': Metric
Century.

One other oddity of this ride: tourists at the Norumbega tower. I was
sitting there at my first way-point sipping my coffee when they arrived
in two cars and came up and started reading the plaque. As I prepared
to leave I told them about the plaque at Mt. Auburn Hospital and the
Lief Erikson statue on the Commonwealth Mall. Then they asked what else
I knew about this odd guy - thus I became briefly a sort of tour-guide
for New England's bogus Viking heritage. I am annoyed with myself that
I never asked them what brought them to the tower however.

Trip Statistics:
* Miles: 62.39
* Riding Time: 5:38:44
* Total Time: (uh... more...)
* Average Speed: ~11mph

I am quite pleasantly surprised that even after such a long ride my
knees/legs/butt is doing pretty well. Right after the ride I was pretty
beat, and the next day as well my knees (especially the right)
complained about stairs. Now on the 2nd day after there seems to be no
problems and riding my bike today felt great. A hundred miles seems
very doable given time in the day. I'm going to do a few more 62 mile
runs and at least one 75 before I do my Century. I might be able to do
it as early as September which might make a great thing to do for my
birthday.

Footnotes: [1] Here usual means the route I've taken twice before.

[2] They must have been metric chipmunks since on average they appeared
1 per 10km

[3] Of course about a mile later, one knee and the opposite calf
started complaining. Typical.

Viking Boston Bike Ride: The Trip to Norumbega

| Comments

Norumbega is a mythical place, a sort of place holder name for unknown locations in the New England area[1]. Today I biked there, battling thunderstorms, mobs of Steampunk cosplayers[2], and mechanical failures[3], to the dark, abandoned, closed tower which is the lonely outpost of the area’s long lost Viking past.

Eben Norton Horsford[4] held the Rumford Chair of the Application of Science to the Useful Arts at Harvard in the late 1840’s[5]. He later founded the Rumford Chemical Works and produced an improved recipe for baking powder. This baking powder is still being produced as Rumford Baking Powder. He also held the controversial[6] idea that Lief Erikson[7] sailed up the Charles River, as far as Waltham (near present day Brandeis University) and ultimately building a house in Cambridge.

I decided that I would trace Leif’s trip up Charles River, Gale would be my longship and we’d brave all trials and tribulations we might find along the way.

The expedition started as all good expeditions do with a good breakfast (in this case supplied by my lovely wife Wendy who cooked some delicious pancakes[8]), and the laying in of supplies (16oz of Clover™ brewed New Guinea coffee put into my thermos from the local Starbucks). With these preliminaries completed I started my fateful trip.

Stopping first to contemplate the location of Lief Erikson’s house.

Location of Lief Erikson's House

It lay just outside the back of Mt. Auburn Hospital, I wondered just what this spot must have looked like in the year 1000 BCE; probably less traffic.

From there I started the long ride up the river to my next destination. I had not before ridden so far up the river (usually just stopping at Watertown dam). I took several wrong turns because I didn’t know how the “Blue Heron”[9] path ran so I missed it in a few places; and worse turned in the wrong direction entirely when part of it turned out to be closed in Waltham. The clouds were rolling in and so was the thunder, I was worried that I was going to be caught in the rain and I had not yet found the tower. Riding through Mt. Feake Cemetery the rain caught up with me. Through the cemetery quickly and then ducking into the Brandeis-Roberts train stop I hoped to wait out the rain. I sipped some coffee and waited. The rain continued but it looked like it was brightening. Checking my map I knew I was close to the tower. I decided that the rain was lightening up so I recounted for the final stretch.

Mother Nature, that fickle woman, was up to her usual tricks and mere moments later I was soaked as the rain quickly got worse. I pressed on to the tower and was pleasantly surprised to find it much easier to find than expected.

The tower marks the location where there had been a Norse fort/city[10] according to Horsford.

Norumbega
 Tower

At one point it seemed that the public could climb the inside of the tower to enjoy the view from the top, but now it was all blocked off with welded in gates. Some of them had been broken/pulled off but the holes were not big enough for me to enter but I could still contemplate the dark mysteries that might have been hidden within.

What
 lurks

The rain was fluctuating in intensity and since I was already wet I decided to just start heading back. For the first five or so miles I held out the hope that the rain would stop and the sun would come back out. After that I gave up that hope. I was so wet that stopping to get out of the rain would be useless. I probably would be drying if I had jumped /into/ the Charles River. I even decided to ride /past/ home to finish this expedition.

My final stop before turning to home was the Lief Erikson statue at the beginning of the Commonwealth Avenue Mall.

Lief Erikson
 Statue

Having attained pictures of the statue, I hoped back into my longship and rode it over the Harvard Bridge[11] into Cambridge and finally home.

The expedition, though wet, was a success. Total ride length: 31.21 miles. Total ride time: 3:00:22[12].

All pictures, in full size, of my ride are available on my flick account in their own set.

Footnotes:
[1] It appears on a map dating from 1570

[2] I didn’t know that it was the Steampunk Festival in Waltham. Quite surprised to turn onto Moody street and see lots of be-goggled folk. And Morris dancers! Who let the Morris dancers in?!

[3] Gale’s chain needs replacing, it is at that stage where it will jump off the rear cog if I am pedaling over hard bumps. Furthermore she has taken to shifting randomly from 1st into 2nd.

[4] http://en.wikipedia.org/wiki/Eben_Norton_Horsford

[5] He was appointed to the chair in 1847.

[6] And, frankly, silly.

[7] http://en.wikipedia.org/wiki/Lief_Erikson

[8] Thanks Wendy!

[9] http://farm6.static.flickr.com/5064/5697393836_98b183d40f.jpg

[10] http://en.wikipedia.org/wiki/Norumbega_Tower

[11] The name of “Mass Ave. Bridge” is “The Harvard Bridge”. Of course no one calls it that since it is no were near Harvard.

[12] My cyclocomputer only counts time that the wheels are spinning. So times I took a break or waited in traffic are not counted in this time.

What I Learned During My First Week.

| Comments

The past week was my first week at the new job. I learned a few things:

  • I learned how good pair programming can be. (But I worry I hogged the keyboard)
  • I learned a bunch of IntelliJ features/keystrokes.
  • I learned the beginnings of Java vs. Groovy.
  • I learned the power and the pain of “magic”.
  • I learned that working hard and going home at 5 without feeling guilty is great (and also actually taking lunch too).
  • I learned that having lunch with the team is really nice.
  • I learned that there is such a thing as a good retro meeting
  • I learned that pairing is a great way to be productive on the first day on the job.
  • I learned that knowing the programming language isn’t really that important at the start of the job.