Abe Voelker's blog Programming stuff, mainly

You got Haskell in my Ruby! Cleaner Ruby validations using the Either monad and Kleisli gem

17 minute read

You got Haskell in my Ruby!

Alternate title: “You could have invented Either!”

Update: It came to my attention from some Reddit comments that the simple example I use in this article is probably not the best for showing off a good use case of the kleisli gem as the “naive” code can be simplified. Therefore, I will be updating this post in the future with a more thorough example. In the meantime, I’d encourage you to read the article “Cleaner, safer Ruby API clients with Kleisli” by the kleisli gem author which has a more comprehensive use case!

I’m still a rank beginner at Haskell, but I guess it’s already leaving some tracks in my brain as I find myself wanting algebraic data types and pattern matching when I’m writing Ruby.

Why I don't use Docker much anymore

17 minute read

The Grounding of MV Rena

Update: The conclusion of this post talks about managing Docker kittens with Ansible; I no longer do that, but instead use Amazon ECS with Terraform. Docker has stabilized a lot since my early experiences as well. However some things like custom kernel parameters (e.g. for Redis) will always be a limitation. I’ll write a new blog post on how I use ECS and Terraform soon.

When I first started using Docker about a year ago for developing Rails applications, I had dreams of using it across all development environments (development/test through production) and in all related services (linked containers consisting of application servers, databases, in-memory caches, search indexes, etc.). I mean, why wouldn’t you - not only would you get more thorough guarantees of your code and systems matching what production’s running, but you are getting the high performance of containers over VMs when developing! And a year ago it seemed like it wouldn’t be long until the problem of easily deploying these linked containers across multiple hosts would be solved.

Simple, free continuous integration (CI) of Rails Docker images using fig, make, and CircleCI

12 minute read

Docker, Fig, Make, and CircleCI logos

This is my second post on Docker. Previously I showed you how I develop Rails apps locally using Docker and Vagrant on my development machine. I had planned to cover Rails production deployments using Docker next, but that post is not quite done as it got a lot longer than I originally intended and needs some editing. So for now, I’m going to show how I do simple and free continuous integration (CI) using Docker, fig, make, and CircleCI.

Sick of Ruby, dynamic typing, side effects, and basically object-oriented programming

10 minute read

This has been a long time coming. I had meant to write this post around the New Year, before the wave of death of Ruby stuff and before DHH’s “TDD is dead” ruckus:

I think subconsciously more and more people are figuring out something is wrong or lacking with Ruby development, but they are lashing out at the wrong things. Oh, your Ruby app is a steaming pile of shit? It’s because you weren’t diligent enough writing tests or you weren’t following TDD principles closely enough. Or you aren’t knowledgable enough with design patterns to break it up into the right patterns. Or you aren’t following the Single Responsibility Principle, or SOLID, or Law of Demeter, yadda yadda. Here, read this book on patterns or testing or OO design and get back to me when you reach enlightenment.