This video is a preview of all the great content in the Weekly Iteration. Scroll down to see some of the great videos. Want to watch them all?
Elixir & Phoenix, so hot right now! On this week’s episode we’ll take a look at some of the great features of both Elixir and Phoenix through the lens of Bamboo, a library for sending emails in Phoenix apps, recently released by thoughtbot...
What is a line editor, and how can you use it in your workflow? In this Weekly Iteration, George Brocklehurst and Chris Toomey explore Readline, the most common line editor. Learn how to use it in the shell, your REPLs, and even in your GUI.
certain presentational features such as animations and transitions. With modern
CSS features, some of these capabilities can now be achieved with little to no
On this episode of The Weekly Iteration, George Brocklehurst, development
director from thoughtbot's NYC office, joins us to take a tour of a handful of
design patterns through the lens of the Django web framework. Specifically,
we'll take a look...
If your application uses third-party APIs, it can be complicated to write good, flexible tests that don't depend on the service being present (or don't touch production data). In this Weekly Iteration, Joël Quenneville and Chris Toomey examine...
Blocks are a core concept in Ruby, and while they make frequent appearances in
Ruby code, developers may not be aware of exactly how they work or all the
things they can do. In this video, Boston Development Director Josh Clayton
Often when talking about optimizing data SQL in web applications we focus on
the application layer concerns like n+1 queries and the like, but occasionally
we'll need to dive down into the database layer itself to optimize our
queries. In this...
Retrospectives are a core part of our process for keeping projects running
smoothly, encouraging open communication, and hitting our goals. In this
video, Joe Ferris, thoughtbot CTO, leads Chris and Ian through a typical
retro while describing the...
Meetups are a great way to involve yourself in your local programming
communities, as well as find other people with similar interests. Join Melissa
Xie and Gabe Berke-Williams to learn how to organize and run your own meetups.
In this video we'll show you the range and power of type systems of various languages, and explain why you might be interested in checking out a more strongly typed language.
Managing your dotfiles can be a real pain. rcm lets you organize related configuration files with tags, safely install your dotfiles, and share your dotfiles with others so that they can try out pieces of your configuration.
A metaprogram is a program that writes other programs, and metaprogramming is
the process of writing these metaprograms.
A common use of metaprogramming
Here's an example of metaprogramming in Ruby:
React Native is a project from Facebook that allows developers to use React to
build native mobile applications. This presents an amazing opportunity as now
we can use the same tools, workflows, and approach to build for both web and
Take a peek behind the scenes at some of features and workflows we've built up
to help support Upcase as a production application and manage it across the
varied environments of development, staging, and production.
Join Tute Costa, the maintainer of thoughtbot's Paperclip gem, as he talks about how to be the best maintainer you can be, including how to quickly respond to issues and how to version your code.
Join Chris and Derek Prior (Development Director in thoughtbot's Boston office) to talk about Clearance, a great solution for email and password authentication. Just like Rails, Clearance is opinionated, and those opinions help make it more
Rails 5 is on the horizon and now's the perfect time to take a look at the features and changes coming with this major release. Derek Prior takes us on a tour of the changes, as well as showing us how to upgrade to the current Rails 5 beta.
Join Tute Costa and Chris Toomey to learn about contributing to open source
projects. Let's dispel some of the myths, learn how to be a better contributor, and start giving back to the projects we use every day.
Computer science can seem scary, but with the right mental framework it's actually quite approachable. Follow along with Harry Schwartz, thoughtbot developer in Boston, as he walks you through his favorite parts of computer science and why it even...
As developers, naming is our most powerful tool to make our code understandable. It's an essential part of refactoring. Learning what to pull out, and what to name it, makes our code more maintainable. In this episode, you'll learn how to apply...
Vim's true power lies in its command language. Learning that language can
exponentially increase your knowledge because we can combine new operators with
what we already know to create powerful new operators and mappings. In this
Keyword arguments allow us to write code that is both more expressive, and more flexible. Tune in as Ian and Chris dive into some of the more subtle aspects and demonstrate how we can use keyword args to produce clear, reliable code.
Promises are an abstraction that makes working with asynchronous code more
manageable and consistent. Rather than passing a callback function to an
asynchronous operation (and possibly falling into the dreaded callback pyramid
of doom), the...
Database views are a great way to separate the complexities of database persistence from your application logic. Unfortunately Rails doesn't have built-in support for them, making them difficult to work with. Scenic, a new gem from thoughtbot,...
REST is the core architectural pattern we use to build our Rails applications,
but it's not always clear what exactly is and isn't REST. Tune in as Matt Sumner joins Chris to discuss exactly what REST is, and how best to embrace it in your Rails...
SSH is a foundational topic for anyone working on the web, and at a minimum
it's important to understand how SSH is used for authentication with Git and
similar tools. In this episode we'll cover these basics as well as some of the
Responsive design is a critical approach to making sure your content is useful
and readable on the increasingly large array of device sizes in use today.
Tune in as Chris and Ryan discuss the ins and outs of responsive design,
This week, Chris is joined by thoughtbot's Development Director in Boston, Josh
Clayton, to talk about factory_girl; a topic near and dear to Josh's
heart, as he's been the maintainer of the project for over five years.
Factory Girl is one of...
Rails makes many of our day to day tasks much easier, but sometimes this ease
comes at a cost. Consistently across applications we see a lack of
encapsulation and the shared global state of controllers and views to be one
of the biggest sources of...
gitsh, a thoughtbot open-source project, is an interactive shell specifically designed for git. This week, Chris shows us how it can really streamline our workflow.
On this week's episode, Chris takes us through everything we need to work with
PDFs in our Rails apps: the easiest way to generate them, how to properly serve
them as responses in our controllers, and even how to test them.
On this week's episode, Chris is joined by Derek Prior to discuss Rspec's
Bisect, a tool to track down order-dependence in your test suite and banish
pesky intermittent test failures.
Recently, we ran a group-coding app-building contest for Upcase subscribers. In this video, Ben and Chris review each of the submissions, both highlighting great aspects and suggesting some areas for improvement. Live code review at its finest!
"Just mark it as executable and place it somewhere on your PATH." If that
sentence leaves you with more questions than answers, then today's episode is
right up your alley. Chris & Harry team up to provide a concise but thorough
We've avoided it for a hundred episodes now, but the time has finally come to
talk about that other text editor. Join Chris and Harry as they dive into the wild world of Emacs and see what things look like on the other side of the aisle.
The Chrome DevTools are an amazing tool and a critical part of our workflow on
Upcase and client apps. Tune in as Ben & Chris discuss their favorite features
and tips for getting the most out of the DevTools.
When all you have is the hammer of Rails, everything looks like a database
backed dynamic site. But often we'd be much better served by a simple static
site, and Middleman is a great choice for building these static sites.
Join Chris as he shows...
Slow and redundant database queries got you down? Well have no fear! On this
week's episode, Chris and Joe dive deep into the strategies you can use to
optimize your queries and get your app back to ludicrous speed ASAP.
Tests are code too, and they deserve the same love and careful refactoring
you'd show to your production code. In fact, there are a number of
antipatterns and pitfalls unique to test code that can trip you up. Tune in to
learn all the dos and...
Elm is a new language for building browser based applications that brings
getting the best of both worlds. Tune in as Chris and Joël dive into Elm to
see what it's all...
Rack is the glue that binds application frameworks like Rails and Sinatra to
web servers like thin and puma. In this episode Joël Quenneville takes us
on a tour of Rack and shows us how we can take advantage of the Rack pattern
to build more...
This week we take a quick detour into the design world to learn about Flexbox,
a major enhancement to defining layouts in CSS. Chris is joined by thoughtbot
designer Mike Borsare to learn the ins and outs of flexbox and how it can make
Chris is joined by Blake Williams to get an introduction to the Elixir
programming language. Tune in to learn about this functional, concurrent,
fault tolerant wonder-language with a Ruby-like syntax.
Derek gives Chris a rundown on a11y, aka web accessibility. Tune in to the
learn why accessibility matters for all apps, how to approach it, and what
tools are available to help on the journey.
On this week's video, Chris is joined by Derek to discuss web security. Tune
in to learn about the available resources and tools, and some specific issues
to watch out for in Rails apps.
On this week's episode, Chris is joined by thoughtbot CTO Joe Ferris to
discuss Docker, the open platform for building and running containerized
In this episode, Chris is joined by thoughtbot CTO Joe Ferris.
With the magic of live-coding, Joe demonstrates how a simple Extract Class
refactoring can lead to a host of code improvements.
On this week's episode, Chris is again joined by Josh Clayton, Boston
Development Director and TDD master, this time to discuss the power of page
objects for cleaning up feature specs.
On this week's episode, Chris is joined by Boston Development Director and TDD
master Josh Clayton to discuss some of the tips we have here at thoughtbot
for working with Heroku-deployed applications.
On this episode of the Weekly Iteration, Chris is again joined by Derek
Prior, this time discussing building and extracting gems.
On this week's episode, Chris is again joined by fellow bot Derek Prior,
this time to discuss Turbolinks. Tune in to learn how to speed up your
Rails apps, almost automatically!
On this week's episode, Chris is again joined by Melanie Gilman to
discuss the amazing array of extensions added to Ruby by Rails' Active
On this week's episode, Chris is joined by fellow thoughtbotter, Melanie Gilman, to discuss the wonder of Ruby's Enumerable and Comparable interfaces and how you can incorporate them into your own classes.
Chris and Ben discuss the magic of speaking, from lightning talks all the way to conferences. Tune in to learn the specific tips and approach that will help you land a spot and deliver a great talk.
In this week's episode, Chris is joined by Gabe Berke-Williams to discuss all
things API, HTTP, and JSON. Tune in to learn the tools, workflows, and
approach that Chris, Gabe, and thoughtbot at large use to interact with APIs.
In this weeks episode, Chris & Gabe dive into the world of dotfiles, the
files we use to configure some of our favorite tools. Tune in to find out how
Chris, Gabe, and thoughtbot think about and organize these critical files.
On this episode of the Weekly Iteration, Chris and Ben discuss the recently
added Flashcards feature on Upcase. See a behind the scenes look at the
processes, decisions, and code used to release this new feature.
On this weeks episode Chris and Goose present an introduction to writing a programming language. From lexing to parsing find out more by watching this week's episode.
In this episode of the Weekly Iteration, Chris is joined by Matthew Mongeau,
aka [Goose], to discuss regular expressions. Learn how to work with them,
where they fit, and perhaps more importantly where they don't.
In this week's video, Chris is joined by Josh Steiner to discuss the git and github workflow we use here at thoughtbot. We'll cover feature branches, pull requests, rebasing, and finally merging our new feature into master!
Internationalization (i18n) is well supported in Rails. Being aware of and using i18n in your applications as you build them can save you significant pain from having to retrofit a larger application at a later date and on a deadline.
In this week's video Chris is joined by Derek Prior and they run through the
process used to solve a real production bug on Upcase! Check out the PR that
fixes the bug discussed in this video for more context.
Matt joins Ben to discuss the pros and cons of Ember, as well as resources to get started learning this framework for creating ambitious web applications.
In this episode, Ben shows you how to use vim's windows to efficiently edit code.
In this episode, Ben shows you how to use vim's powerful built-in help.
In this screencast, Ben and Chris go back to basics and tackle the first exercise in the Rails Fundamentals trail, "Route, Controller, Action". They create a route, controller, and action using TDD to tell them what to write next.
Ben & Chris give some tips and tricks on how to survive your first week in Vim.
Ben and Joe continue to develop the Pastie application, demonstrating how to introduce authentication. We discuss how to retrofit existing components with unit tests, as well as the differences between authentication and authorization.
Ben joins Joe and build out the first feature in a Rails application, from scratch. Learn our process for jump-starting new applications using Suspenders. We'll also use our first integration test to help sketch out the first interactions in the...
Lydia joins Ben to talk about the front-end tools that thoughtbot designers use: Bourbon, Neat, Bitters, and Refills. Then, see them in action while styling a production app!
Gabe joins Ben to discuss Apprentice.io. They discuss how to be a great mentor, how to help apprentices feel comfortable, and how (and why) to run an apprenticeship program at your company.
Melanie joins Joe again to discuss the classic refactoring step: Extract Class. Learn how to safely split up a Large Class in small steps, keeping your tests green as much as possible while Melanie demonstrates this technique live....
Melanie joins Joe to demonstrate a simple (but useful) pattern: Parameter Objects. Melanie replaces a long parameter list with one object in a single bound! Try it for yourself in our refactoring trail.
Melissa joins Joe once again to demonstrate another refactoring technique from Ruby Science: move method. Learn about Feature Envy, how to reveal it using Extract Method, and how to remove it using Move Method. Follow along yourself...
Melissa joins Joe to discuss a basic refactoring technique: Extract Method. Follow along as Melissa applies this refactoring live to an example from Ruby Science. After watching, you can refine your refactoring techniques using our refactoring...
Pat joins Joe again to continue our tour of Haskell. Learn how Haskell replaces most if statements with the powerful concept of pattern matching, including some instances where object-oriented programs would use polymorphism. Learn how to both...
Pat joins Joe again to discuss Haskell's type system. Learn how to add type signatures to your functions, create your own types, and work with generic types using type classes.
Pat joins Joe to give an introduction to Haskell. Learn basic function syntax and dive into the world of pure, lazy, functional programming. We also cover basic lists, and discuss how almost everything in Haskell is a function, such as operators.
Gordon joins Joe to discuss an alternative approach to testing for situations where unit testing falls flat. Learn how property-based tests can be more useful than unit tests. Gordon discusses unit testing in Swift using Quick and Nimble, then...
Joe and Tony look at how Swift can reuse code from Objective-C libraries. Dive through a real example of using the Dropbox Objective-C client. See how to use bridging headers to pull in Objective-C code, how to handle failure in a more idiomatic...
Joe and Gabe review form objects, and explain why they can almost always replace accepts_nested_attributes_for. See an example Rails app written with nested attributes and how and why we recommend switching to form objects.
Joe and Gabe review the four types of test doubles: stubs, mocks, spies and fakes. Learn what the key differences are between each type, as well as when you'd want to consider using them. See examples written using rspec-mocks, as well as an...
Gabe joins Joe to discuss how to run tests quickly and efficiently. People who
haven't done TDD a lot often find that running tests is painful and takes them
out of the moment. Learn how to run tests easily while staying focused on your...
Tony joins Joe to introduce some functional programming concepts in Apple's new language, Swift. Tony uses the magic of Apple's new playgrounds to demonstrate some simple functional ideas, such as functions as values, closures, currying, enums,...
Chris joins Joe to discuss Vim configuration. Do you customize? Do you change? Do you extend? Learn how most of Vim's power comes from Vi, and how you can embrace that power rather than fighting it to become a more efficient editor.
Joe and Tony run through some common Ruby idioms, demonstrating how they work in Swift. Examples include using Swift's Optional to replace Ruby's nil and using closures to navigate collections.
Joe and Ben discuss the reasons for testing, and how integration and unit testing each serve different reasons. Dive into the benefits of drawbacks of testing at each point in the isolation/integration spectrum by looking through examples.
Ben and Joe provide a high-level introduction to ClojureScript, featuring Flappy Bird!
Joe and Ben discuss the benefits and drawbacks of isolated unit testing.
Mocks Aren't Stubs
Ben and Joe discuss which testing metrics you can stop caring about (and which you should continue to watch).
Learn how to keep your TDD cycle snappy and keep your test suites short. Ben and Joe demonstrate an ideal setup for TDD, with focused test runs integrated into the editor. They also discuss approaches for integration and unit testing, as well as...
Learn how to use a high-level test to guide you through the requirements for a new feature or change. Ben and Joe discuss the benefits of starting with an integration test, how to descend through the layers until you find the unit which needs...
A grab-bag of tips to speed up your vimming!
Ben's vim talk at Railsberry
Ben and Joe dive into the Upcase exercises system, exploring inversion of control. We previously covered inversion of control, but now we tackle it with a new twist: a new dependency injection framework for Rails which makes this style of...
This episode covers one method of dividing a test into four distinct phases and the benefits of doing so.
xUnit Patterns Wiki
xUnit Test Patterns book
Joe and Ben introduce a concept from the functional world: Functors. Learn how you're using functors in your every day work already, and see how to apply those concepts to make code with nils safer.
Check out Learn You a Haskell For Great Good...
In this episode, Ben and Joe discuss Sandi Metz's rules.
You can read the summarized rules.
Ben offers a few concrete tips on landing a new (or better) Rails job.
Watch Ben and Joe move some gnarly CoffeeScript into a TDD'd class.
Ben and Joe compare a number of code samples and compare solutions written using both inheritance and composition. Learn how to use composition to place an emphasis on objects and flexible runtime state.
Ben and Joe review several pull requests against the Learn database, pointing out techniques and patterns for having a constructive and efficient code review. Learn how the thoughtbot protocol leads to cleaner and faster reviews. Follow along as...
Ben and Joe discuss the dos and (mostly) don'ts when it comes to ActiveRecord callbacks. You'll find out why you're generally better off not using this feature, with several suggestions for better alternatives.
In this episode, Joe and Ben look at a class which was written without using TDD. By rewriting it with tests first, we discover that a new class was waiting to be extracted, making the overall solution clearer.
How do functional program and object-oriented programming stack up in Ruby? In this episode, Ben and Joe dive find out. We've put together a number of code samples, each of which follows an object-oriented, functional, or hybrid approach. We'll...
In this episode, Ben shares a story of how he screwed up but still had some good come of it.
Kent Beck's tweet
When to refactor
In this episode, special guest Tony joins us to give his first impressions on Swift as an Objective-C developer.
Swift Programming Book
WWDC Swift Session Videos: Tony recommends Intro, Intermediate & Advanced Swift to get started.
By popular demand, Ben and Joe return with the "Ship A Feature" series. This time, they add Markdown support to the comment field for Learn's exercises.
The pull request
Previous Ship A Feature
In this episode, Ben and Joe extract a matcher written in a project and create a pull request to include it in shoulda-matchers.
Check out the pull request
Learn how to debug confusing test failures using interactive tools like byebug. Also learn the difference between REPLs like pry and stepping debuggers.
In this episode, Ben and Joe ship a feature from start all the way into production.
For more info, check out:
The actual pull request and commit in the Learn codebase. Our protocol for getting things done, The parity gem and Travis, our CI...
In this episode, Joe demonstrates his setup for development including:
How he uses rcm to combine the thoughtbot dotfiles with his own customizations
How he uses MacVim, vim-rspec, and OS X Terminal to streamline TDD
How he uses snippets to...
Ben and Joe follow up on a previous episode on extracting classes to demonstrate the classic followup punch to Extract Class: Invert Control.
They show the previous example in the context of an integration-tested Rails application, and...
In this episode, Ben and Joe discuss value objects.
You can learn more about value objects in Ruby Science, or on Martin Fowler's blog.
You might also want to try you hand at our Extract Value Object exercise.
This episode covers the D in SOLID, the Dependency Inversion Principle (DIP). In it, you'll learn why you might want to inject a class' dependencies and how to do so. Additionally, we'll show how following this principle makes it easier to follow...
Take a tour through the history of dependency management in statically compiled languages. Learn why languages like C++ and Java need to explicitly build up small interfaces where Ruby is saved by duck typing, and then discover the lessons Ruby...
Ben and Joe tackle the third principle in SOLID: the Liskov Substitution Principle. Learn some basic rules you can apply to subclasses and other "is a" relationships to improve flexibility in your applications and reduce subtle bugs from interface...
In this episode, Ben and Joe discuss the Open Closed Principle. Also mentioned was polymorphism, the composite design pattern, decorators, factory method, and chain of responsibility.
Finally, you might be interested in the immutable data...
Ben and Joe cover "S" from SOLID, which stands for "Single Responsibility Principle," often abbreviated as "SRP."
We show examples of why you might choose to obey this principle, as well as how the principle relates to [cohesion], Tell, Don't...
Ben and Joe discuss Joe's recommendations for RSpec best practices.
You can read Joe's original blog post, peruse our style guide's testing section, or review our summarized best practices for RSpec.
You might also want to read about the mystery...
Ben and Joe do a little live coding, demonstrating how to extract a Null Object from an existing class in order to encapsulate conditional logic related to nothingness. If you'd like to play along, we have two exercises for practicing Null...
In this episode, Ben and Joe demonstrate the ping-pong approach to pair programming. They alternate back and forth, writing test for each other to pass. You'll also get a glimpse into the problem-solving tactics of thoughtbot developers as they...
In this episode, Ben and Joe take a look at the Haskell version of Noodle, a zsh history analyzer.
We cover some interesting Haskell nuggets in the implementation. If you'd like to see more, we recommend Learn You a Haskell. You can also see...
In this episode, Ben and Joe showcase the most interesting parts of the
Clojure implementation of
Noodle, a zsh history analyzer.
During the episode, we go through a few interesting Clojure-y bits of the
implementation. If this tickles your...
The Law of Demeter.
In this video, Ben and Joe illustrate the steps to safely extracting new
classes. You'll learn a reliable, repeatable process for creating new classes
and moving functionality into them without risking bugs in your application or
failures in your...
In this episode, Ben and Joe tackle a highly useful but lesser known method
from Ruby's Enumerable module: inject.
While watching, you'll see how inject is just an abstraction over certain
types of recursion. We'll use examples to demonstrate...
In this episode, Ben and Joe discuss the an OO design principle known as Tell
Don't Ask. They walk through a number of examples, discuss its subtleties when using
MVC, and cover query and command methods.
Original blog post
PragProg blog post on...
In this episode, Ben and Joe refactor some code submitted by a subscriber in
our forum. Starting with a controller action containing complex business logic
adding up to more than fifty lines, they extract a class to encapsulate that
In this episode, Joe and Ben discuss a fairly advanced example of refactoring.
You'll dive into the good, the bad, and the ugly of code before and after being rewritten. The new code uses a number of design patterns, including the Builder...
In this video, Chris shows off his highly-efficient programming workflow.
Ben and Chris discuss shell optimizations, advanced vim operators, using Dash for fast documentation lookup, and configuring Alfred to make darn near everything...
In this episode, Ben and Joe discuss several different types of coupling in code.
While watching, you'll learn about three different types of coupling: Pathological Coupling, Global Coupling, and Control Coupling. You'll learn what these...
In this episode, Ben and Joe discuss why abusing nil is unfriendly to your fellow developers, and dive into some of the other ways of representing nothingness.
While watching, you'll learn how nil can be contagious, confuse a domain, and violate...