Replace Temp with Query in Clojure
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...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...more.
A while back I wrote a little about bugs. I got a few questions and objections and the most common one goes something like...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.
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...more.
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. If you are unfamiliar...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.
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...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.
JavaScript frameworks like Backbone.js can provide the structure missing in ad hoc approaches but there are some common pitfalls.
Like many developers today my first...more.
At SCNA 2012 I entered into a kata battle against Aaron Bedra. The idea was that we'd both perform the Coin Changer...more.
This is not the first post cautioning the use of modules on our blog. However, while I do mostly agree with the points raised...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...more.
What is a Singleton Object?
The 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...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...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...more.
“The only constant is Change.”
— Heraclitus
While it was doubtful that Heraclitus was addressing developers, the sentiment certainly still applies....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...more.
From time to time I solve levels of Smash the Stack for fun.
Here's how it works. On each level there's...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...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.
Well, what are the consequences of an...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:...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,...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...more.
“Education comes from within; you get it by struggle and effort and thought.”
— Napoleon Hill
We all know...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...more.
“polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface” -Wikipedia
...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...more.
I know some people cringe at the idea of writing JavaScript. They opt to write CoffeeScript instead and make every attempt to avoid looking...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 extends).
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...more.
Recently, I was pairing with Steven. We were wrapping up work on a feature. While reviewing our changes and running our acceptance test...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...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...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...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...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...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...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...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...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.
...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...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...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...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...more.
Leiningen, a project by Phil Hagelberg , has become one of the most contributed to Clojure projects, and also one of the...more.
JavaScript is a very misunderstood language. It has gotten a bad rap because most people that use it don't look for its brighter side....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...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...more.
Last week concluded the Hangman Ruby Sparring Tournament. Unlike the previous Battleship Tournament, I put the effort in to write a competitive...more.
Several months ago, I hosted the Ruby Battleship Tournament. It was an all-round fun event where craftsmen sharpened their claws and pitted...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...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...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...more.
TDD on the iPhone is a challenging experience, especially when you’ve been spoiled by Ruby like I have been, but it...more.
While working on the slides for our upcoming talk on TDD for iPhone I asked Eric Meyer why we need the...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...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...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...more.
Last Time I got ruby up and running on my Arm based embedded development platform. Here is a quick summary of what Santa...more.
I spent the beginning of my career working on embedded systems for some audio company. These embedded systems were my first love in...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...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...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...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...more.
I went to WWDC last week 1, and while I was there I got a chance to talk to a couple of their...more.
We had a new developer join our project recently, and he needed his computer to be setup so he could run the application.
...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...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)...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...more.
Jim Suchy recently laid down some basics of Rinda in his blog Rinda 101. I would like to build on that and talk...more.
When building a software system composed of multiple decoupled components, the need typically arises for interprocess coordination and communication.
As an example,...more.
Recently I was adding some accessors to a ruby class on the fly, and I kept getting confused by a certain code block.
...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...more.
Recently, I started reading Knuth’s Art of Computer Science. To spice up the exercises, I am writing them out in Ruby....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...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...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...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...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....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...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...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...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...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...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...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...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...more.
If your situation matches the following conditions, beware!
...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...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...more.
Using FitNesse allows you to communicate with the customer up front. Before a line of code is written, you can have all the...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,...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...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...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...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...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...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...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...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...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...more.