• Ruby stdlib: Base64

    Base64 is a widely-used mechanism to represent binary data in an ASCII string format. There are a few different Base64 schemes that share most of the implementation. The encoding strategy consists of choosing 64 characters that are common to most other string encodings and are also printable. For example, MIME’s Base64 implementation uses A-Z, a-z, and 0-9 for the first 62 characters. Other variations share this property but differ in the characters chosen for the last two values and an extra one for padding. Each base64 digit represents exactly 6 bits of data.

    Read on →

  • The REPL: Issue 37 - August 2017

    The fallacies of web application performance

    Is performance only a production concern? Are threads enough for multi-core concurrency? Are there cost-free solutions to solve performance? José Valim answers these en some other questions in this post. José is the creator of Elixir’s Phoenix framework and was part of the Rails core team. I’ve found most of his writing to be worth my time. This is no exception.

    Developing with Kafka and Rails Applications

    Sam Goldman explains how Blue Apron uses Ruby on Rails to work with Apache Kafka. Part of the article touches on which gems they use to process Kafka streams. The other portion describes how to setup a local development environment. Docker is leveraged effectively to make a complicated setup something easy to spin up locally: The final product has 4 different services: Zookeper, a Kafka broker, A schema registry, and a REST proxy for Kafka.

    An Intro to Compilers

    Nicole Orchard writes an introductory post on how compilers work. Specifically those leveraging the LLVM toolchain – used by Swift, most Mac gcc compilers, Crystal and many more. It takes a simple “Hello, Compiler!” program through the 3 phases: Front-end, Optimizer and Back-end. Short and sweet.

    Read on →

  • Book Review: Understanding the Four Rules of Simple Design

    Understanding the Four Rules of Simple Design by Corey Haines is a book about how to approach software design from a perspective of his years of the authors involvement in Code Retreats. A Code Retreat is a day-long practice session for software developers where they can explore different ways of building software by practicing deliberately without the pressure of having to deliver production code. I’ve previously written about my experience in a code retreat.

    Read on →

  • Testing a puts method

    When I code long-running tasks, I often want to see some sort of progress report in my terminal to let me know that my code is still running. Let’s take a simple example:

    Read on →

  • The REPL: Issue 36 - July 2017

    Is Ruby Too Slow For Web-Scale?

    Nate Berkopec writes a long post about Ruby performance and how it affects web applications. Not-withstanding the click-bait title, Nate brings up that raw performance might not be as significant as many teams would like to think. Many of use work on applications that receive only a modest amount of traffic. In this organizations, the trade-off between engineering productivity and server costs tilts towards productivity.

    Five ways to paginate in Postgres, from the basic to the exotic

    Most web-applications encounter a need to paginate results into multiple page loads. Joe Nelson works his way from the most simple implementations (LIMIT and OFFSET) to the more complex. He discusses the benefits and drawbacks of each. The techniques described cover most of the typical web-application needs. The more exotic ones – like stable page loads that return the same results even if elements are added or deleted from the collection – require more exotic solutions. They are usually expensive to compute.

    An engineer’s guide to cloud capacity planning

    Patrick McKenzie writes a great guide on how to plan server capacity in the cloud. He covers decoupling the applications with knowledge from it’s deployment environment, advises to automate provisioning and deployment, covers how to estimate capacity and what to focus on as traffic grows. This is another great article by Increment.

    Read on →