Archive

Object Orientation in Ruby and Elixir

14 minute read

When talking about mainstream programming languages, we often put them into two major buckets: object oriented programming and functional programming. But th...

Inputs and Instance Variables

3 minute read

There’s an antipattern I see in a lot of codebases. This antipattern obstructs our vision and makes code more difficult to reason about. It’s everywhere, and...

Don’t “Use” Protected Methods in Ruby

4 minute read

For years, I didn’t understand protected methods. Not because I didn’t care to, but because I couldn’t see the practicality. I’d been writing what I thought ...

The Software Shokunin

less than 1 minute read

Traditional Japanese craftspeople believe in the spirit of the shokunin. This is the essence of pure dedication to the intricacies of a skill or craft. Sword...

Component-Based Acceptance Testing

11 minute read

Have you heard of page objects? They’re awesome. I’ll refer to them as POs. They were conceived as a set of guidelines for organizing the actions a user take...

High-Low Testing

36 minute read

High-low testing has changed the way I build software. When I first started using Rails five years ago, the paradigm of choice was fat model, skinny controll...

A Culture of Credit

1 minute read

In the United States, and worldwide, we love credit. Why? Credit allows us to accomplish things that would otherwise be unachievable. Take for example, buyin...

Learn to Learn

1 minute read

Is it actually important that you learn real things? Of course it is. But real things, especially in software engineering, tend to change hyper-regularly. Th...

Be (Very) Opinionated

1 minute read

It’s good to be opinionated. It means you’ve collected enough auxiliary details to formulate a stance. It doesn’t so much matter the stance you take as long ...

Being Succinct

1 minute read

Some years ago, I had my first and only client fallout. It’s unfortunate that the client also happened to be my uncle and the project was compelling (a story...

Versions

1 minute read

When building apps and libraries, I tend to be overly pessimistic about dependency versions. I define as much granularity as possible. For apps, this usually...

People Code

less than 1 minute read

No one would pay developers over $100/hour if they didn’t have a sense the developers could produce quality work. But characterizing quality is difficult. On...

Play Where You Work

1 minute read

The advice “live where you work/play” doesn’t quite cut it for me. If I have to choose to live where I work, then I’m sacrificing play time. If I have to liv...

Optimize Later

1 minute read

One of Larry Wall’s three great virtues of a programmer is laziness. While I generally don’t confer that laziness is a desirable attribute, when it comes to ...

People First

1 minute read

I have recently been through an unfortunate situation. A situation for which I had very little control. A situation where an executive VP needed to make some...

Taking a Risk and Sticking to It

1 minute read

In the world of consulting, it can be difficult to find time to incorporate elements outside your comfort zone. Businesses pay consultants to produce work in...

“Open Source” Everything

less than 1 minute read

I’m continually astonished by the world of open source. As a community of programmers, hackers, engineers, scientists, and more, we manage to come together o...

Practice

1 minute read

As I grow as a software engineer, I’m finding it more and more important to practice daily. I’m also discovering that, contrary to the popular proverb, pract...

DCI and the Single Responsibility Principle

6 minute read

The single responsibility principle (SRP) is one of the most widely followed ideals in object oriented programming. For decades, developers have been strivin...

DCI and the Open/Closed Principle

6 minute read

The open/closed principle (OCP) is a fundamental “run of thumb” in object-oriented languages. It has hands in proper inheritance, polymorphism, and encapsula...

DCI with Ruby Refinements

8 minute read

TL;DR - Have your cake and eat it too. Ruby refinements, currently in 2.0 trunk, can cleanly convey DCI role injection and performs right on par with #includ...

A Review of MVC

4 minute read

Recently on the object-composition mailing list, Trygve Reenskaug, creator of MVC and co-creator of DCI, posted a short reiteration of the MVC pattern. I’m r...

Exhibit vs Presenter

8 minute read

The exhibit pattern was recently introduced by Avdi Grimm in his book Objects on Rails. During its introduction, he spent a respectable amount of time laying...

Flexible Searching with Solr and Sunspot

less than 1 minute read

I just posted an article on RubySource.com titled Flexible Searching with Solr and Sunspot. It covers working Solr into a Rails app and massaging Solr to mat...

Stubbing CONSTANTS with RSpec

less than 1 minute read

There’s not any great info out there about stubbing constants. In fact, you can’t stub constants. What you can do is reinitialize them.

SOA for the Little Guys

less than 1 minute read

My article titled “SOA for the Little Guys” was just published on RubySource. It covers breaking apart a monolithic app into services with testing and Sinatr...

DCI Role Injection in Ruby

6 minute read

Injecting Roles into objects in Ruby has been a hot topic in the DCI community. What’s the correct approach when augmenting an object at runtime? I want to e...

The Right Way to Code DCI in Ruby

10 minute read

Many articles found in the Ruby community largely oversimplify the use of DCI. These articles, including my own, highlight how DCI injects Roles into objects...

Benchmarking DCI in Ruby

6 minute read

I’ve recently become quite intrigued with the concepts behind DCI (Data Context and Interaction). I won’t go too in depth about what DCI is or why you might ...

Snowday Released

less than 1 minute read

I just released an RSpec formatter to make you feel all warm inside. Like hot chocolate. It’s called snowday.

Conditional Indexing with Sunspot

less than 1 minute read

One of my favorite new features of Sunspot 1.3 is the ability to conditionally index an instance of a model based on anything that returns a boolean.

Testing subdomains with RSpec and Capybara

1 minute read

There’s a lot of ugly solutions out there regarding this problem and rightfully so, it’s a pain in the ass. I’ve gone through a good number of options and fo...

“Incorrect” Timezone on Heroku

less than 1 minute read

This is just a friendly reminder that Time.now on Heroku will give you server time, ie: PDT/PST, and not the local time for your app.

Parsing Excel files on Heroku with roo

1 minute read

When it comes to processing Excel files in Ruby, your options are slim. A quick Google or Github search might reveal roo. roo is an interesting beast. It app...

Testing Mobile Rails Apps with Capybara

2 minute read

Every web app should have a mobile version and every mobile version should be tested. Testing mobile web apps shouldn’t be any more painful than testing desk...

New/Scope Safe Constructors in OO JavaScript

2 minute read

One frequent problem when developing in Object Oriented JavaScript is how to handle the removal of the new keyword when creating an instance of a class. It’s...

FreshBooks on Rack…on Heroku - Part Three

2 minute read

In Part One of this series, we constructed a “hello world” Rack app. In Part Two of this series, we brought our app to life with the ruby-freshbooks library....

Tuesday Tricks - Splatting

1 minute read

In Ruby, the * (asterisk) token is often referred to as the “splat operator”. It’s purpose is to turn a group of arguments into an array. This can be useful ...

FreshBooks on Rack…on Heroku - Part Two

3 minute read

In Part One of this series, we constructed a “hello world” Rack app, so to speak. In this part, we’ll dive right into using the ruby-freshbooks gem and a lit...

Tuesday Tricks - Named Regex Groups

less than 1 minute read

New in Ruby 1.9 is the ability to name capture groups so you don’t have to use $1, $2…$n. First a demonstration:

FreshBooks on Rack…on Heroku - Part One

3 minute read

I love FreshBooks. It makes my time tracking incredibly easy and my invoicing hassle free. That’s not all; their website is extremely powerful but feels ligh...