Don't Test Like That!

As a consultant, I come across a lot of bad test suites in Rails and JavaScript apps. The following are all RSpec, Jest, or Jasmine tests that I have found in the wild – with minor changes for clarity or to protect the guilty :) (myself included!) These are some simple things not to do, along with some advice about what to do to accomplish the same goal. Don’t test internals in a system test System »

The New Best Practices Podcast

Hey everyone! We recently published the first couple episodes of my podcast The New Best Practices. Long-time friends and collaborators Jason Sich, Jace Browning, and myself discuss the process of creating software. Our first four episode topics cover: Code Review Code Comments YAGNI Story Points We are unlikely to ever have episodes like “What’s new in technology XYZ”, and instead we have upcoming »

JSON API Helpers for API Testing in Rails using Airborne

Update 05/08/2017 I made a gem! https://github.com/Ross-Hunter/jsonapi_expectations I am a huge fan of the Airborne gem for testing APIs. Airborne uses rest_client to make HTTP requests and provides the following properties for use in your tests. response - The HTTP response returned from the request headers - A symbolized hash of the response headers returned by the request body - The raw HTTP »

Topic Based Retro

At Modustri we have always had weekly retrospectives amongst the dev team. We tried a couple different formats, but now we do a simple format that we call a “topic-based” retro. The concept is simple, throughout the course of the week, if you run into something that you would like to discuss with the whole dev team, you simply post it into our “retros” slack channel, and we will cover it at our weekly »

Index Your Foreign Keys

We add indexes to our database in order to speed up read operations. Basically, an index is a sorted copy of a particular set of columns the database uses to quickly look up the attributes of another table, most commonly, foreign keys of relations. There are several ways this can actually be implemented on the database; essentially, we tell the database which values we’ll be looking up most often and »

ActiveRecord Associations & You

I love abstraction. It’s great to compartmentalize complexity and keep your application modular. SQL is not that. Relying on SQL strings in your code ties your implementation directly to the type, structure, and even the version of your database. ActiveRecord (the ORM behind Rails) is great for letting us focus on our application and not worry so much about the database particulars. However, understanding »

(Over)simplify Your Code

One of my eureka moments as a developer came when my programming pair suggested I separate some very simple math in the body of a method into another method. At the time it seemed like overkill to create an entirely new method when the operation was so simple. Wouldn’t that make it more complicated? But I quickly realized the benefits outweighed the cost. The first benefit is code reuse. This is rather »

code

Math Is Not Necessary for Software Development

As a developer, written communication and reading comprehension are more valuable than math proficiency. Sometimes, I tweet. When I tweet, sometimes people agree with me. One such occasion happened recently when I said this. Modern software development has way more to do with reading comprehension and written communication than math.— Ross Hunter (@Ross_Hunter) November 30, 2013 This was part »

code

Open + Download Native Apps with a PhoneGap/Cordova Plugin

Are you working on a PhoneGap/Cordova app that needs to be able to communicate with other native applications? You may want to get the demo code, maybe give it a once over, and then continue reading. Note: This work was completed in a pre-PhoneGap 3.0.0 world. There is now a Plugin Specification Guide that should be adhered to. This code would need to be adapted to fit that structure. Prologue »

Tips for Novice Developers (and why you should become a rubyist)

Work Locally Working locally means that you have an instance of your web app running on your machine. You edit files directly on your machine, rather than uploading every change to the server. It is tempting to edit files directly on your shared server, but don’t do it! It is a very bad practice and will bite you over and over again if you let it become habit. You may start out thinking of a website »

code