My team was recently tasked with developing a few HTTP endpoints in our Clojure service to be used by a separate UI. The requirements included...more.
Ruby's low-overhead metaprogramming facilities make it easy to create elegant APIs with minimal effort. As a testament to its power, I can say with a...more.
I sat down last night to watch the ’80s movie classic, "The Karate Kid." In addition to being overwhelmed with nostalgia for my childhood, I...more.
I'm a proponent of building small, composable pieces over one large piece that does many things. The large piece usually works well, but it eliminates...more.
In a previous [blog post](http://blog.8thlight.com/dave-torre/2015/03/11/the-option-type.html), craftsman Dave Torre showed how optional types can alleviate common problems with null values. Bulding on that post, we are...more.
Let's play a word association game. When I say "stack overflow" what comes to mind? Is it Spolsky and Atwood's popular question and answer site?...more.
Regular expressions are a powerful way to search through and manipulate text. But as we know from Spiderman, with great power comes greatly reduced readability....more.
The ability of lisp programs to manipulate themselves is beautiful. When we take into account the amount of the language that is implemeneted by manipulating...more.
I've been writing some [Rust][rust] recently, and have finally had my first experiences with the Option type. Also known as the Maybe monad, Option is...more.
In a [previous blog post](http://blog.8thlight.com/kevin-buchanan/2014/08/20/functional-ish-ruby.html) I discussed a few ways to think about writing Ruby methods from a functional perspective. But in Ruby, or any...more.
With the new year I decided it was time to pick up a new language. Having always used high-level languages, I decided to try out...more.
In 2009, I started an internship at a Los Angeles-based audio/video post production studio. The audio engineer I was learning from was an avid musician...more.
One of my favorite tips for writing software comes from one of my favorite software role models, Sandi Metz. In her book [Practical Object-Oriented Design...more.
How do you evaluate the health of your test suite? Here are three common symptoms that indicate that your test suite is sick, dead, or...more.
There are many "do's and don'ts" when it comes to testing code. I would like to focus on one of the "don'ts" that comes up...more.
Coming from a Rails environment, one of the things I took for granted was a nice logging setup in which all logs were written to...more.
"Abstract" is a commonly used word in software. I hear it a few times every day. *"Can we make an abstraction around this?" "Let's move...more.
I heard you got some bad news: your team lead is forcing you to pair on all stories. This sounds grim, but I have a...more.
One of the quickest ways to turn a well-factored Rails project into an old-fashioned legacy app is to use ActiveRecord `where` and `find_by_sql` calls outside...more.
Unit tests that fail intermittently, without exposing any production bugs, are the worst. Like the boy who cried wolf, they reduce our confidence that they're...more.
## Varnish From the [docs](https://www.varnish-cache.org/docs/4.0/), Varnish is a web application accelerator, or a caching HTTP reverse proxy. At its core, Varnish is designed to reduce...more.
[When we last saw our Test-Driven Game Loop](http://blog.8thlight.com/eric-smith/2014/08/18/test-driving-the-game-loop-part-1.html), we hadn’t really made it very far, at least in terms of production code. This is what...more.
When developing software, it's generally desirable to hide the details. This allows you to increase the cohesion of parts in our software, and to decouple...more.
Clojure is one of my favorite languages, and I love pairing with beginners to share the joy. Learning any new language is a process of...more.
Speed limits exist to encourage traveling at speeds that are deemed safe for a given road. Although the meaning of "safe" will vary per person,...more.
In Java, we use `InputStream` objects to read data. The smallest amount of data we can read at once is eight bits (one byte), using...more.
Yesterday, my pairing partner and I came across an interesting situation. The feature we were working on required receiving some data, constructing a date range...more.
It is convenient to throw your trash out your car window, but it is not always right. There are exceptions to this. If you are...more.
In a [recent Apprentice Blog of the Week](http://blog.8thlight.com/alex-hill/2014/07/10/useful-clojure-macros-for-the-object-oriented-programmer.html), Alex Hill detailed one way that we can apply common Ruby patterns to our Clojure code. I’ve...more.
Test Driving an algorithm is a tricky thing. Developers tend to get stuck in one of two ways: * They see that they have the...more.
This week I experienced first-hand the knowledge ramp-up that is required when joining a project of any real size and complexity. I had actually worked...more.
Ever since I first began learning Ruby a little over a year ago at The Starter League, I've been wary of using gems. I remember...more.
"I won't ask for help again", I told myself. "If I just push a little harder I'll be able to figure it out". Pride is...more.
When immersing yourself in a new programming language, as in a new culture, it’s important to take time to understand the nuances of its common...more.
When I was in high school, I didn’t have a typical job for my age. Instead of waiting tables or making sandwiches, I worked as...more.
Working with web forms can be tedious and time-consuming. Many of the tools that exist today require individual setup and handling for each form element....more.
A gerund—as I often have to remind myself—is a verbal noun. That is, a gerund is a verb being used as a noun. In English,...more.
When working in a language that’s new to you, it’s important to spend a lot of extra time making sure you are using the correct...more.
One of the most difficult aspects of learning Clojure for most programmers who have been brought up in the object oriented tradition is the Lisp...more.
Controllers are powerful and complicated objects that easily accumulate responsibilities. Even when following the classic Rails convention of "Skinny Controllers, Fat Models," controllers still have...more.
"Stack level too deep?", I asked myself, perplexed. All I did was add a gem and a few lines of initialization code. The gem that...more.
There are already several eloquent web postings available explaining the Strong Parameters feature of Rails 4. In this post I’ll provide my take on one...more.
Writing good software is hard. Fortunately, we can borrow from our everyday life experiences to make it easier. ## Consider the following situation: You're sitting...more.
A recurring practice of mine these days is to take a feature of a language and see if I can replicate its functionality or likeness...more.
I successfully upgraded a Rails application from version 2.3 to 3.2. Or so I thought. ## "The Best Laid Plans..." Though I read lots of...more.
There always comes a time on a software project when you need to decide whether to build a feature or use an open-source implementation of...more.
No doubt Rails is an amazing system. But like anything complicated it has its quirks. I ran across one of these lately as I was...more.
If there's anything where opinions amongst my development colleagues differ heavily, it's about the evil of context blocks inside a spec suite. Proponents of nesting...more.
There has been some recent interest in the [Elixir language](https://github.com/elixir-lang/elixir) and with good reason, it's an exciting language! Elixir not only brings the power of...more.
In his talk about [Redis](http://vimeo.com/56433597) at Scottish Ruby Conf a few years ago, [Ryan Briones](https://twitter.com/ryanbriones) covered the importance of deferring the design of data structures...more.
The overt purpose of testing is to ensure that code does what is expected of it, but tests themselves also act as documentation. Highly readable...more.
Controlling complexity is the essence of computer programming. Brian Kernighan As software craftsmen, complexity is intrinsic to our daily tasks. With that in mind, it’s...more.
Some Background Thoughts ------------------------ There is an experiment from Richard Held and Alan Hein who raised kittens in total darkness. For a short period during...more.
When I start a new feature I need to learn what the customer wants, what the code currently does, and how to write new code...more.
I first heard the term "Test First" in 1998. Back then it was part of the phrase "Test First Design". We often shortened it to...more.
The Hindley-Milner type system is very powerful: it allows you to express functions with complex type signatures in an elegant, readable way. For example, consider...more.
For over a month, I received occasional reports that an existing feature, adding secondary accounts, wasn't working. I could never reproduce the failure in any...more.
###We Hate If Statements Many of us have been taught that, in OOP, most of a program’s “if” statements can be replaced by polymorphism. We...more.
A Deferred object is a mechanism for referencing a value which may (or may not) be available at a later point. Every so often you...more.
I want to tell you about my Clojure toolchain of choice, but in order to do it right we need to go back; way back....more.
A few weeks ago I had an opportunity to pair with Uncle Bob. We were going to pair on a message queue convenience wrapper I...more.
Is your code really telling you to use an if statement? As a developer, it is really important to practice your craft. And a great...more.
Web developers have a habit of taking HTTP for granted because it just works. HTTP works so well that people all over the world exercise...more.
Coauthored by [Kelly Steensma](http://telladifferentstory.tumblr.com/) Wikipedia defines a kata as a detailed choreographed pattern of movement. Based on the Japanese word meaning "form", katas were originally...more.
January 1 2011 In this post we explore the Transformation Priority Premise in the context of building a sort algorithm. We also explore comic books...more.
December 19 2010 This blog poses a rather radical premise. It suggests that Refactorings have counterparts called Transformations. Refactorings are simple operations that change the...more.
February 3 2011 I read a nice blog today exploring the Transformation Priority Premise using the flash card kata. The author did it in both...more.
February 2 2011 Guilherme Silveira wrote a lovely blog exploring the Transformation Priority Premise using the Fibonacci sequence. He posed a suite of tests similar...more.
Lately I've been re-reading some of the classic books in the clean code / OOP genre and trying to apply their lessons with renewed energy...more.
A while back I wrote a little about [bugs](http://blog.8thlight.com/eric-smith/2013/04/08/we-are-principled-6). I got a few questions and objections and the most common one goes something like this:...more.
Characters seem like an easy concept to grasp at first glance. Java has a primitive type `char` and an object wrapper `Character`, and these are...more.
The process of learning Ruby has brought several surprises. Some of which are more pleasant than others. The latest I have encountered is that `Array#sort`...more.
A recurring theme on the 8th Light blog is decoupling your applications from the implementation of details. A detail can be anything from UI elements...more.
I awoke this morning to see a twitter conversation about the Open-Closed Principle. The tweeter was complaining that it didn't make a lot of sense....more.
Keep your cookies to yourself Browser cookies are a good way to provide a stateless protocol with some memory. Unfortunately, they're also good for hijacking...more.
The Riak database provides a great MapReduce framework allowing you to execute complex queries, leveraging the parallel processing power of distibuted systems. However, I recently...more.
The absolute best code I’ve ever written was when I’ve been most compatible with my pair. It wasn’t that long ago, and I was relatively...more.
This blog is Part 2 of a series of blogs about migrating to Surrogate. Part 1 can be found [here](/eric-meyer/2013/01/13/migrating_from_rspec_dynamic_mocks_to_surrogate_part1.html). If you are unfamiliar with...more.
Here's the situation: You use RSpec. You like RSpec. But you want more confidence from your tests than you get with RSpec's dynamic mocks while...more.
I’ve been using routing constraints a lot lately. Before I learned about constraints, my controllers were littered with data typing checks and filters, some of...more.
Don’t trust outside data! SQL injection attacks were once considered the greatest threat plaguing the Internet. They continue to be the source of many large...more.
Silent failures are difficult to debug -- not only is the error not noisy and obvious, but it can introduce other errors downstream that may...more.
At [SCNA 2012](http://scna.softwarecraftsmanship.com) I entered into a kata battle against [Aaron Bedra](http://www.aaronbedra.com/). The idea was that we'd both perform the [Coin Changer Kata](http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata) live in...more.
This is not the first post [cautioning the use of modules](http://blog.8thlight.com/josh-cheek/2012/02/03/modules-called-they-want-their-integrity-back.html) on our blog. However, while I do mostly agree with the points raised in...more.
Protect your users, take password management seriously. There are too many databases in the world with completely unencrypted passwords. Even when databases have encrypted passwords,...more.
What is a Singleton Object? --------------------------- The [GoF](GoF) identifies a singleton as a way to "ensure a class only has one instance, and provide a...more.
Editing text can be tedious and mechanical; you are often required repeat the same sequence of commands several times. Keyboard macros are one way in...more.
There's a special sort of satisfication I get from turning absolutely awful code into a well-tested, well-factored program. Not only have I increased the amount...more.
Dependencies are nearly unavoidable for non-trivial software projects. These can be large dependencies, such as web frameworks and databases, or smaller decisions, such as pagination...more.
“The only constant is Change.” — Heraclitus While it was doubtful that Heraclitus was addressing developers, the sentiment certainly still applies. As developers, we live...more.
Don't extract that method yet! In programming, we tend to work with collections of objects quite often. For example, we may need to check to...more.
The last 2 weeks of 8LU were very interesting. Steven Degutis delivered 2 great talks on programming languages, covering the pros and cons of a...more.
From time to time I solve levels of Smash the Stack for fun. Here's how it works. On each level there's a program with a...more.
We've all heard that Chuck Norris can count to infinity, twice. We've all heard that Chuck Norris can drown a fish. Chuck Norris can divide...more.
Could you (as a software developer) delete all of the code you wrote in a day and rewrite it in around an hour? Chances are...more.
A Rails application has many configuration options. Learn how to test one of them. Why? Well, what are the consequences of an improperly configurated application?...more.
Primitive Obsession is bad stuff. But it's bad, not because primitives are bad, but because obsession is bad. From Merriam-Webster: ob-ses-sion, noun: a persistent disturbing...more.
Many Lisp beginners find quoting to be a foreign concept. My own confusions around quote and friends began with my first ventures into Scheme, and...more.
Before I came to 8th Light, I didn’t write code all the time. I took some CS classes in college and I enjoyed programming a...more.
“Education comes from within; you get it by struggle and effort and thought.” — Napoleon Hill We all know the feeling of flow while coding....more.
One Ruby feature I fell in love with is the ability to define methods like foo and foo= which are used like simple variable accessors....more.
“polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface” -Wikipedia In most Object Oriented...more.
Many of us admire other professionals, such as musicians and athletes. We even emulate them in our own profession by practicing. What about that time...more.
TL; DR ------ Rather than including modules and hooking into `.included`, write a method that adds the behaviour (even if the method just includes and...more.
There's a revolution coming. I wonder if anyone has noticed. It's not subtle. It won't be sublime, or easy to integrate. Indeed, it'll probably muck...more.
Putting extensive business logic in Rails controllers is bad and you should stop doing it. I suppose I should demonstrate why that's true with an...more.
Recently, I was pairing with Steven. We were wrapping up work on a feature. While reviewing our changes and running our acceptance test suite, he...more.
I've spent the last several months writing my own mock objects, but for the code I'm currently working on, we were mostly using RSpec's built...more.
My first exposure to mock objects was in C++, where they are practically indecipherable to the TDD newbie, so I didn't use them. That may...more.
In the beginning of using rails it was amazing at how fast everything was compared to my previous java web experiences. I could finally run...more.
Imagine that you're nearing the end of a productive day. Just a little more work to do to finish a feature. Then, your customer calls...more.
So if you're like me, you're 5'10" and sport a ruggedly awesome beard. And if you're _really_ like me, you swallowed the T/BDD pill years...more.
I'm writing this blog from the train, my head hung in shame. I'm taking a course in Game Optimization and today something exceptionally embarrassing happened....more.
The new language Go by Google brings a few orthogonal features to the table which work powerfully together. A heavy hitter in its arsenal is...more.
I’ve been thinking about existing Lisps a lot lately and where we’re headed. In particular, I’ve been considering the possibility of writing another Lisp dialect,...more.
Do you use validates_uniqueness_of in Rails? Do you feel confident that it works to prevent duplicate records? If you’re like most of us, you won’t...more.
Most migrations do very little and run very quickly. Add a column or two; run in a second or two. Other migrations need to do...more.
If you follow me on twitter @paytonrules you’ve probably seen me griping at various times about writing a testing framework for Objective-C. I’m currently writing...more.
You are a mad scientist, and you’d like to perform an experiment on your mysterious test subjects. You want half of the subjects to be...more.
I have been working on migrating half a dozen 8th Light projects to our continuous integration server last week. Barring one open-source gem project, most...more.
We encountered a strange spec failure today in our continuous integration build. It’s a Rails project, we’re using RSpec, and this was the failing expectation...more.
Whenever I’m showing a newcomer to Clojure how to bring in code from other namespaces, I find myself apologizing that it’s a bit complex and...more.
Leiningen, a project by Phil Hagelberg , has become one of the most contributed to Clojure projects, and also one of the most used. UPDATE...more.
This blog post originally appeared on a blog I maintain for my current game development class. Generally speaking my posts over there are pretty specific...more.
A few years ago when we were buying furniture for the first 8th Light office I came across a piece called the WalkStation. It was...more.
Last week concluded the Hangman Ruby Sparring Tournament. Unlike the previous Battleship Tournament, I put the effort in to write a competitive hangman player (of...more.
Several months ago, I hosted the Ruby Battleship Tournament. It was an all-round fun event where craftsmen sharpened their claws and pitted their skills against...more.
It’s with great pleasure that I announce the creation of chiPhone, the Chicago iPhone developer’s group, with our first meeting on July 23rd at 6:30....more.
We have a couple of interns in the office this summer. They are kind of like Jr. Apprentices and are distinguished mostly by the fact...more.
Many of us have heard a lot of talk about functional programming and its benefits, especially when it comes to highly concurrent applications where thread...more.
TDD on the iPhone is a challenging experience, especially when you’ve been spoiled by Ruby like I have been, but it can be done. I...more.
While working on the slides for our upcoming talk on TDD for iPhone I asked Eric Meyer why we need the Dependency Inversion Principle. He...more.
Here’s the situation. You’ve spent days working on an open source project. Your sweat, blood, and tears have been poured into thousands of lines of...more.
Quick announcement, Selenium on Rails has been released, now supporting Rails 2.2 and with the latest Selenium Core. Numerous bug fixes are in this release...more.
I’ve been working with Ruby on embedded systems for a couple of weeks now. The final pieces have fallen into place and I’d like to...more.
Last Time I got ruby up and running on my Arm based embedded development platform. Here is a quick summary of what Santa and I...more.
I spent the beginning of my career working on embedded systems for some audio company. These embedded systems were my first love in programming and...more.
I’ve recorded my Langston’s Ant kata for all to see. This particular kata, with slight variations, has been in front of an audience twice before....more.
You remember the classic Simon game, right? The one where the electronic devise will blink a color and make a sound that you have to...more.
This release of limelight contains many new features and stability. Perhaps most notably, Limelight will no longer eat 95% of your CPU (ouch)! I’m proud...more.
Welcome to a Limelight production. I am going to go through a step by step introduction to limelight development using a tic tac toe game...more.
I went to WWDC last week 1, and while I was there I got a chance to talk to a couple of their engineers and...more.
We had a new developer join our project recently, and he needed his computer to be setup so he could run the application. “Here is...more.
When I first started writing code in Ruby, it was a breath of fresh air after writing C# code for a year. Ruby had a...more.
OCP was defined in 1988 in Bertrand Meyer’s book “Object Oriented Software Construction” as follows: “Modules should be both open (for extension and adaptation) and...more.
Last year I wrote a RubyCocoa tutorial that’s been aggregated in a few places and referenced a couple times. By my standards it was an...more.
Jim Suchy recently laid down some basics of Rinda in his blog Rinda 101. I would like to build on that and talk a little...more.
When building a software system composed of multiple decoupled components, the need typically arises for interprocess coordination and communication. As an example, say that we...more.
Recently I was adding some accessors to a ruby class on the fly, and I kept getting confused by a certain code block. The code...more.
Often times while writing meta programming code, I am using the eval function and doing manipulation on method/class/variable names. Today I needed to un–Rubify a...more.
Recently, I started reading Knuth’s Art of Computer Science. To spice up the exercises, I am writing them out in Ruby. Thinking about the basic...more.
As we work with our clients to delivery new features to them quickly and with high quality code, we are finding that the fastest way...more.
Ruby files have to require other files. There’s no avoiding it. Techniques to manage require statements are numerous and varied. Having tried most of them,...more.
Admit it, you’re new to Rails. You just got your new spiffy Rails job, and they gave you a Mac, formerly the computer of long-haired...more.
Last December I went to to StarEast in Orlando because my fiancee is a tester and I well, I like sun. While there I picked...more.
I am a better pair than solo developer. For me, software is a collaborative art from the start of a project to the end. Starting...more.
There’s a common pattern I’ve seen for developing DSL in Ruby. It’s used in RSpec, the Statemachine Gem, and Unclebob’s Clean Code talk at RailsConf...more.
Did I say I was tired yesterday? That wasn’t tired, this is tired. I’m currently training for the marathon, and today I was scheduled for...more.
Well it’s day three and I’m exhausted. As you may have noticed I posted at 3 AM last night, and getting up at 8 AM...more.
Hello again from RailsConf. I’ve gone through five presentations. I don’t have any enormous revelations, and no good pictures yet, but I do have some...more.
Recently I had the pleasure and frustration of working the net-sftp gem for Ruby. Pleasure because it’s a well written library, with an easy to...more.
Occasionally even great developers fall into bad habits, and the rest of us do it more than occasionally. This is especially true when under deadline...more.
Often in Statemachines, duplication can arise. For example, the vending machine in our examples may need periodic repairs. It’s not certain which state the vending...more.
A sign of the success of Ruby on Rails is the size of applications being written with it. Currently, we are working on a project...more.
If your situation matches the following conditions, beware! You’re working in rails. You’re using Postgresql. You’re storing binary data in the database. This was the...more.
If you’re doing any significant amount of work with statmachines, you will most certainly encounter some conditional logic in your Statemachines. Take our vending machine....more.
In my younger days I was a Line Cook at the Olive Garden. In case you’ve never worked in the food industry, Line Cooks are...more.
Using FitNesse allows you to communicate with the customer up front. Before a line of code is written, you can have all the behavior expressed...more.
This is intended to be a tutorial to get you started using FitNesse with ruby on Rails. There is some explanation needed about FitNesse, Fit,...more.
Part One demonstrated how to build states and transitions. If you go ahead and add some actions to that and you’ll have a truly useful...more.
I consider Statemachines to be a programming gem. An invaluable tool for the software craftsman’s toolkit. It’s not everyday that a Statemachine comes in handy,...more.
In rails, migrations are generated in such a way that they create a numbered migration with an up and a down schema direction. This has...more.
In Paul Graham’s Book, Hackers and Painters, he talks about patterns and Human Compilers. I started to think about how some traditional Object-Oriented patterns are...more.
I’ve been meaning to learn Smalltalk for years now. Recently Dave Astels and I have a had a few discussion on the topic. They all...more.
Pre–factoring is when you see a piece of code which the story you are working on which has a re–factorings which would make your story...more.
This IConvention is an interesting one: “Let’s prefix all interfaces with a capital I.” Who thought of this? Why did they think it was a...more.
Delegates: one of the few unique aspects of .NET. How useful are they? Here’s a delegate declaration. The syntax can take some getting used to....more.
Recently I was working on FitNesse to solve the problem of large file uploading and downloading. Previously when a file was downloaded FitNesse would happily...more.