Posts

Clojure ‘def’, ‘declare’, and ‘concat’

I hit the Aeron hard and asked my pair Liz “what’s up?” I’d been sick and she had been working on a tricky Datomic datalog query in my absence. She claimed to have solved the whole problem but the tests would not pass when run as a whole vs. when run individually. A classic problem with a big Clojure twist. I, being no stranger to this terribleness, eventually shook the sick out of my head and asked if she had tried running the singular test file by itself. Good news: it failed too.  What? I’ll explain.  We use a classic trick here at Backstop when running tests in the Clojure REPL: ‘:reload-all’ (require '[clojure.test :refer [run-tests]]) (require 'your-ns.example-test) (run-tests ‘your-ns.example-test) ; First time (require 'your-ns.example-test :reload-all) ; Picks up new changes in the files (run-tests ‘your-ns.example-test) Otherwise we’d spend all day waiting for the JVM to start up every time we run our tests. It’s a cool trick but it has its lim...

Lutz’s Super Truthful Murder-ball adventure

For backstory checkout out the previous DnD post. Landing in a pile on a large stone table in a massive room from out of a swilling green magic portal is very disorienting. However, it did lead to Lutz shaking off his magical blindness. First sight: Many intense dudes some covered in lacquer armor — Lutz didn’t even know lacquer was a thing you could make armor from. While Lutz pondered the truth of his eyesight, Lord Valparaiso threw a little fit. One: He was mighty pissed that his evil portal trap has ensnared him in addition to our heroes. Two: The portal had clearly been hijacked to another mysterious and far away land. The land was so strange and far from their home that Raest couldn’t feel his god Palore anymore which meant no spells.  Essentially this changed his role in the party from from healer/crappy fighter to, um, crappy fighter. That single set of footprints on the beach are not from Palore carrying Raest during his darkest hour.  The team had many que...

Our Purely Functional Microservice in Production

Recently I was interviewing a candidate for a job on my team at BackstopSolutions and he said something like: “I read your blog post about Microservices and was wondering if the lack of follow up meant the project was a failure.” He actually expressed this sentiment in a much nicer way as this was an interview but still it got me thinking:  "I should do an update on the status of our microservice and explain how it could be purely functional." The service is implemented in Clojure, uses Datomic for persistence, and integrates via REST. The service has been in production for several months now and has gone through a number of versions of its API. Implementing HATEAOS worked out well as it allows us decouple having to keep the service and front end in lock step. Since this is a microservice, we could keep both applications in step with each other as we own both ends of the interface. However this co-ordination is not without cost.  Release dates slip b/c of bugs in e...

Lutz’s completely accurate DnD summary for those who weren’t there

The “Curious Case of the Tiny Thieves” is being joined in progress and so a little backstory is necessary: The dexterous and rather handsome rouge Lutz was investigating these “Tiny Thieves” with his band of mostly merry adventurers: Raest a cleric of Palore, Bran the mighty barbarian, Torment the super naive atheist paladin, a wild magic user called Very Forgettable Name, and Iesha or Aida or Ada AKA: the old lady magic user who casts a lot of sleep spells. They discovered the little thieves trying to abscond with their solid gold cat statue which they received as a gift for returning a talking cat to an old lady who was really a dragon in human form — long story. Turns out the whole town hated these mini scofflaws as they has been on a veritable spree of the crime variety.  A reward was offered and pursued by our fairly fearless heroes. As far as they knew the criminals were: 6-8 inches tall, never seen in full light, and immune to sleep spells. Lutz made a super cool trap fo...

Microservices vs David Heinemeier Hansson

Hearing that David Heinemeier Hansson had slammed microservices in his Rails Conf 2015 keynote was a bit disorienting as I was developing a microservice at the time. I leaned over to the other senior developer and said: “What’s his deal?” Toby Tripp, who had just watched the keynote, explained that when David’s team implemented microservices they had terrible trouble managing all the versions between 3 systems. “Isn’t that why we use a lookup call to get the URI-map?” I asked. “Yep” he said. “That and never remove a return key/value (pair), only add new ones until you can prove they are not used anymore” He added. I returned to adding in some caching to our service calls.  Later, I watched the video which is here: https://www.youtube.com/watch?v=oMlX9i9Icno David has a meandering style but he mostly discusses microservices between 43:00 and 52:00.  The “what’s in your backpack” stuff is all about his earlier zombie apocalypse metaphor that you...

Why Group Texts Must Die

Recently I re-tweeted this thought from Pete Holmes: top reasons for divorce. 1984: 1. financial problems. 2. religious differences. 2014: 1. constant inclusion in group texts. 2. no wifi. — Pete Holmes (@peteholmes) September 14, 2014 because I'm in the middle of a communication crisis.  I do "knowledge work" so it’s considered inappropriate to have a device constantly making little beeps and boops while the person next to me is working on some insane LibXML (you don’t wanna know) bug.  Programming requires extreme concentration and distractions are to be avoided.  The rub of it is that I’m “on call” if our software product bursts into flames.  Therefore, I must keep my phone in a mode capable of disturbing me so I don’t eat lunch, play ping-pong, or just code right through the disastrous failure of our software.  This used to be fine back when text messages were either: Time sensitive Important From one person In first two cases the beeps ...

The Definition of Garbage

The views and opinions expressed here are my own and don’t necessarily represent positions, strategies, or opinions of Backstop Solutions Group. Recently we released episode 3 of the Software Apprenticeship Podcast but had to pull it back for re-editing because of some problems with how developers talk to each other.  Developers are not kind to ANY code.  Even our own.  Especially our own.  Sitting next to a dev while he or she discusses the code they are working on can be a shocking experience.  Words like “Crap,” “Junk”, “Garbage” and many worse are used often.  A lot of this type of talk was on episode 3 and when someone at Backstop (who’s job it is to protect us from ourselves and comments taken out of context) heard it they asked us to edit the podcast to take out some of the more offensive comments. This is why episode 3 sometimes fades into music and then comes back mid-conversation.  Sorry about that. I don’t know where I first heard the defin...

Software Apprenticeship Podcast Episode 3 is Out

This week we start off by throwing Jonathan into the deep end of pool where he pairs with an experienced developer on a 10 year old Java project that is the core of our signature product: Backstop.  Of course the company is called Backstop Solutions and so, in order to avoid confusion, we gave the project a different name for internal use:  Fund Butter.  The mystery of how such a terrible thing came to pass is revealed in this very episode. There’s no way we couldn’t discuss DHH’s Rails Conf declaration and blog post: “TDD is dead. Long live testing.” This, of course, leads to a discussion of our team’s test philosophy. You can find it on iTunes (search for Software Apprenticeship Podcast), any podcast app’s search function, Google, this temp page: https://itunes.apple.com/us/podcast/software-apprenticeship-podcast/id868371146 or use the RSS feed directly if your into that sort of thing: http://softwareapprenticeship.libsyn.com/rss Our panel (composed of Toby Trip...

Announcing the Software Apprenticeship Podcast

Image
In the summer of 2004 I did an apprenticeship of sorts at a place called Object Mentor.  At the time “Uncle” Bob Martin and his son Micah Martin were in leadership positions at the company and I somehow convinced them to let me work for free over the summer in exchange for teaching me software development. It wasn’t a very structured program, nothing like what Micah would later put together for 8th Light , but I was a pretty motivated learner.  I also had the advantage of coming from a teaching background so I knew how to learn. All this has been covered in daily detail, if you'd like to read more. After ten years of software experience I’m becoming a mentor to an apprentice and documenting the experience via podcast.  Backstop Solutions has graciously allowed me to pay our apprentice (the same rate we pay interns) as he is doing real work on a daily basis in addition to outside learning experiences.  From 9-5 he will be working on production code with 100% supe...

SICP Wasn’t Written for You

The number of software luminaries who sing the praises of “ Structure and Interpretation of Computer Programs ” (referred to as SICP) is such a long list that you might think only a crazy person would take issue with it. However, to ignore SICP’s problems and continue to blindly recommend it seems just as crazy. SICP was the textbook for MIT’s introductory programming class and was a bit of a departure from other into to computer science textbooks at the time.  Wikipedia sums it up nicely:  “Before SICP, the introductory courses were almost always filled with learning the details of some programming language, while SICP focuses on finding general patterns from specific problems and building software tools that embody each pattern.”  Which sounds awesome, but does essentially say that abstract principles will be introduced before the nuts and bolts of a language.  If you think about that for a minute, you may see where the problems will be. When I was training to be a...

Why I abandoned MetricFu

My last commit to MetricFu was March 2...  of 2011.  So. much. shame. Since I am throwing in the towel and handing over leadership (perhaps to you), I thought I should explain why I've been such a terrible maintainer and why I'm walking away. Reasons: 1). MetricFu is a mess.  At some point, with all the submissions coming in, the architecture and testing got away from me.  Now it's pretty depressing to see crap code quality in an app that is supposed to be about good code quality.  I can not overstate how embarrassing and frustrating this is – mostly because it's my fault (I let in things I shouldn't have. Stupid feature blindness). 2). In 2008, when I created MetricFu, I was fascinated by metrics and now I'm not because I don't need the tools to see the problems anymore.  Metrics made me better but now I'm leaving them behind:  Selfish. 3). I'm not a consultant at the moment so the exploratory nature of MetricFu isn't very useful t...

Oracle Foreign Key without Index Test

We've been having some Oracle deadlock issues that have been hard to reproduce locally. After a lot of investigation and solving of important problems that happened not to be THE problem we figured out that while we've been pretty good creating integrity constraints in the database we have not been very good about making sure that every foreign key has a corresponding index. And that can lead to problems. So we had a situation were our documents table had a foreign key on the accounts table that was not indexed. So updating an account row lead to a whole table lock on documents (instead of just a row lock which would have happened if there was an index) and that was very bad when we had two separate processes where one was doing a bunch of accounts stuff and the other was doing a lot of documents stuff. Deadlocks for everyone! The sad thing is that if we had just drank the Rails cool-aid about having no integrity constraints in the db we would have been fine but we got into ...

Ruby Kaigi 2010 Day 3

Image
Last day of Ruby Kaigi! Sad to see it go, it's been a great conference. As per usual Tweets are in bulleted italics and the rest is after the fact commentary. First I've got to show you the commemorative fans they were handing out: It's Matz and... Someone else (sorry if it's obvious - I don't know). And of course they are programing in the bath. BigDecimal: You can handle numbers as large as can fit into memory as opposed to the IEEE double #rubykaigi BigMath is the Math module for BigDecimal #rubykaigi Lots of different rounding modes in BigDecimal #rubykaigi BigDecimal.mode is global per process - not thread safe #rubykaigi So BigDecimal is Fiber unsafe #rubykaigi Bummer. .@mrkn implemented a solution storing mode in thread local #rubykaigi Oh good. Wait, is that in 1.9.2 or trunk. I'd have to be in 1.9.2 right? To the Google! ... Yep, seems like it made it in: http://redmine.ruby-lang.org/issues/show/3285 You can now change modes in a block (added to trunk...

Ruby Kaigi 2010 Day 2

Image
Holy crap am I tired. It's been a long awesome day. It started out with some excitement: Just found out I have an hour time slot when all I prepared was 30 minutes. Ok, time to write some more. #rubykaigi Panic! Maybe I'll talk about metric_fu a bit. #rubykaigi I must have looked at that schedule 20 times and never realized that I had an hour slot. Everyone else had 30 minutes so I thought I did too. Attendees of "The Importance and Implementation of Speedy Tests" will also get "Metrics Based Refactoring" at no additional cost! #rubykaigi I did something I almost never do: Look at crisis as an opportunity (crisi-tunity). I had to write "Metrics Based Refactoring" anyway for Windy City Rails so why not write it now. In less than 4 hours. While watching my friends present at a conference. Looking over those sentences now I can't believe I didn't freak out. Ted Han used publicly available data to settle reviewing bais accusations agains...

Ruby Kaigi 2010 Day 1

Image
Here I am in Japan at RubyKaigi 2010. Wow. Generally I tweet a lot about the conf live and then publish those tweets here (in italics) and provide slightly more commentary. So lets get it on. So my flight leaves at noon for #rubykaigi, takes 13 hours, and arrives at 3pm tomorrow... Wait -- that can't be right. #looksitupagain Before today's trip to Japan the furthest from the U.S.A. I've ever been is: Canada. #howisthatpossible In cab. It has begun. Someone once said "If you've never missed a flight you're spending too much time in airports" #atgate2hoursearly Yep - can you feel the panic in those first couple of tweets? I was totally freaked out. The actual trip turned out to be easy. I met up with Chad Fowler, Yehuda, and Woody at the airport and we took a bus straight to Tsukuba. I went to an exotic foreign land and the first thing I did was take a bus through 100 minutes of strip malls. But I was in Japan. And Yehuda held forth on 'snowmen...

Using Git Inside a Git Hook

Using Git Inside a Git Hook can cause problems. In my previous post: " Signal 13 Problems with Git Hooks " I describe how we are trying to automatically merge certain types of branches into a branch that is designed to hold them all. Anyway, that means we want to run some git commands inside of the git hook. We change dirs into another directory where we have a clone of the repo and start telling git to merge some stuff and we get a bunch of remote: fatal: Not a git repository: '.' But if we run the exact same commands as the git user everything works fine. Huh. Eventually we got our linux guru over and he noticed that the environment under which the git user runs is totally different when inside a hook. Gitolite does a bunch of things to the env, but the one that was screwing us up was the setting of the GIT_DIR. After we figured that out, the solution was as easy as: ENV.delete 'GIT_DIR' in our ruby script that is triggered by the 'post-receive...

Signal 13 Problems with Git Hooks

Ran into a gotcha in Git today when trying to write a post push hook. We want our designer to have a fast turn around time with clients so we're writing some hooks to merge all of the 'theme' branches he works with to get merged into a special preview branch which is then deployed to the preview site. And all this should happen after he does a 'git push.' Seems like a 'post-receive' hook is just what we want. Except that every time we tried to create one we got these errors on a push: error: git-shell died of signal 13 fatal: The remote end hung up unexpectedly error: error in sideband demultiplexer If the 'post-receive' file even existed in git_dir/hooks/ on the git repo box, we got this error. We checked permissions, gitolite docs, git docs, google, etc and no help. We finally realized that Git was piping in some information to our 'post-receive' file and since we were not consuming it, that was causing the explosion. So, I present to...

The Road to Ruby Midwest

Crazy day: It was the day before Ruby Midwest so I gave my 'Speedy Tests' talk to my workmates at Backstop Solutions during lunch today and they had the nerve to find some things wrong with it -- so I'll be doing some re-tooling before Saturday. Then I was all set to leave 2 hours early for the airport when my manager wants to talk about me helping QA understand our process, new features, and maybe get some automated tests running. Hell to the yeah. So I'm all over this opportunity but our conversation makes me leave the office a bit late to catch my flight. No problem, I build in a lot of buffer. Then the Blue line (Chicago's subway) was down. Uh oh. Some surly dude said there was a free shuttle to somewhere else but I couldn't find it so I took a cab. Crazy traffic puts me at the airport with 30 min until my flight. Panic! But the security lines are longish so I panic while inching forward in a zig-zag line. Then I sprint to terminal C (which is t...

Rails Conf 2010 Day 3

A few days late on this because I've been sick all weekend. There just has to be a way to do climate control in conference centers in such a way as to not destroy the planet and, more importantly, Jake's health. I seriously wore black jeans and 2 shirts on hot summer days and yet I was shivering and caught a cold. But let's get to last day of Rails Conf 2010 and my exciting adventures therein. (tweets are in italics ) Woke to "Relax" by Frankie Goes to Hollywood. Which is good 'cause my heart was pounding. Settled it with some bacon. #railsconf Yep, I could feel cold coming but I was in denial. I ran into Neal Ford at breakfast and we chit chatted about this and that and then he mentioned that he had read my blog post from yesterday. First thought: I published that sucker at 1am this morning and he's read it already? Second thought: Oh shit, what did I say about his keynote -- I think I called him a jerk at some point. But my brain was foggy and so...