Never miss a beat

Join my newsletter.

The Archives

Building a CLI in Dart with Bosun

Published: 3/18/2022

Command Line Interfaces (CLIs) are some of the simplest program interfaces to build, but some of the most difficult program interfaces to build well. CLIs have been around longer than I have and, over my career, I've really grown to love them. CLIs can be written in many different languages (I've recently written some in Go and Rust to name a few), but today I want to talk about writing CLIs in my favorite language -- Dart. There are a lot of guides, books, and material on architecting a…

Flutter Isolates

Published: 12/22/2021

Unfortunately the documentation around isolates is not very good, but they're a very powerful feature. If your goal is to avoid jank, you need to keep your main thread's UI responsive, and you need to make sure your main thread is not blocked by long-running tasks. Isolates help you achieve this. Isolates are a way to run long-running tasks in a separate, isolated thread. They are useful for things like network requests, database access, and long-running calculations. If you're aiming for 60fps…

Boxing things in Rust

Published: 9/16/2021

Rust's memory management can feel a bit intimidating for most developers. Rust gives you some control over whether you're allocating data on the stack or the heap and its up to you to decide where memory should be allocated. When you allocate memory for values in Rust, that memory is allocated on the Stack . Memory on the Stack is allocated in a "stack frame" which contains information for the Stack's local variables and some metadata about that stack frame. When a function exits, that…

Flutter's LayoutBuilder Widget

Published: 6/7/2021

Flutter's LayoutBuilder Widget is a widget that allows you to adapt children widgets based off the constraints that the LayoutBuilder is contained in. This allows you to layout widgets differently in different sized containers (like a phone screen vs a tablet screen), but LayoutBuilder also allows you to change how widgets render based off the container that they're rendered within. A good example of the later is rendering a list of items as a list when the container is taller than 500 dp, but…

Dart Mixins Guide

Published: 4/24/2021

There are a lot of alternatives to inheritance. Abstract classes, interfaces, some languages have "traits", and in Dart, we have Mixins (and abstract classes and implicit interfaces, too). Mixins are a way to reuse class code in multiple class hierarchies. How do you declare a Mixin in Dart? Mixins require using 2 different keywords to fully make use of them in Dart. First, we use the mixin keyword to declare a new mixin. Our mixin can then be applied to other classes using the with…

Level Up by Learning How to Ask Questions

Published: 3/11/2021

There are several differences between junior and senior developers, but one of the most noticeable differences is around how they communicate. In development, questions are one of the most common forms of communication. Here are some tips that I have to help you ask senior-level questions. Ask a question. This one might seem obvious, but if you're looking for an answer, start by asking a legitimate question. "My code doesn't work" is not a question. "How do I make this code work?" is better, but…