There are some commands I run so often that I find it useful to assign them to single-character aliases. This has turned out to be a source of great convenience but also the cause of further problems (namely, one specific typo). First, a list of the aliases I've defined: alias g = ' git ' alias j = ' jump ' # A `cd` bookmark script I have alias k = ' kubectl ' alias l = ' ls ' alias t = '…
Until today, I thought I knew all of the ways that it was possible to define a function in JavaScript. But I jokingly tried const f = function g() {}; in a Node REPL, and it worked , so now I feel like I need to explain it to myself. Common ways to make a function To give some context for why I was surprised that "named function expressions" are allowed, I think it's worth showing examples of…
Today I learned some new visual layout terms and a new CSS feature, so this is two thoughts for the price of one! 1. Words Letterboxing is commonly used to describe the use of padding to fit a too-wide image onto a screen without cutting it (named after the shape of the mail slot present on some doors). TIL that pillarboxing is the inverse where the image is too tall (citations needed, but…
tl;dr: docs.rs/std takes you to Rust std docs, as if it was a crate name! I'm learning Rust (for the third time now) (and I mean it this time!), and I'm getting deep enough into it that I'm learning shortcuts . Based on the URL structure for crate documentation (for example, https://docs.rs/axum/latest/axum/ ), you might wonder whether…
I feel very strongly that program testing should be done through public interfaces, and there needs to be a really good reason to do otherwise. One of the things I like about Go is that its tooling makes it easy for me to say that all testing for any package must be done with only the public interface. How can that be? Aren't there complicated things that should be tested but not made public?…
I noticed a cool pattern at work recently: all of our Makefiles have a help target. Running make help prints out all targets and includes any trailing comment on the same line. And that solves essentially the only problem I've found with using make as a simple task runner: Is this a verb-noun or noun-verb project? So I took a random Makefile I had lying around at home and tried to make it…
Go modules are the standard now, and generics are on their way Last time I wrote Go, these were both experiments. It looks like go mod stopped being controversial, and it's expected for new projects to use it. The recent proposal for generics got accepted , so I guess I should actually spend time learning this version of them. go doc is really useful! This is my first time working in a Go…
Recently, I've been building a website where I know the sizes of images but I don't have the images themselves. This makes it difficult to create layouts because I'm still learning how new techniques (like CSS grids) affect content sizing. So I need placeholder images. At first, I used a real raster image editor: Open up GIMP . Set the correct size canvas. Paint-bucket fill a…
When I'm programming, I like to get feedback about my code as fast as possible. I like to learn about all of my bugs every time I'm "done thinking" (every time I save a file). Nowadays, LSP integrations have made it possible to get syntax and type checking on every keystroke, which is even faster than that! But everything else has to run on save. When I discovered entr , I knew it would…
A few weekends ago, I took part in the first Quirky Languages Done Quick mini-hackathon ( QLDQ ). I want to share my thoughts about how it went and the design process my team went through. I had fun, and we'll probably do it again, so let me know if you'd like to join us next time! If you'd like to see the language before the design process, check out the repo . How to Hackathon It…
We've been increasing our adoption of Sorbet at Gusto ! As I've been trying to type more and more complex bits of Ruby, I've found it helpful to have a single page of examples that I can search through easily. I like learning new programming languages with Learn X in Y minutes , so I tried to make this digestible in the same way. If you use this, let me know what you think! I'm…
Ever since I heard about Piet , I've wanted to write draw a program in it. It'd be really cool to paint or print the program in real life. It's the closest I'll ever be to visual art! There are two things that kept me from actually trying it. First, this is a low-level language. You're writing instructions for the stack interpreter directly, and there's no obvious way…
Note: This was an incomplete draft. You probably want the finished version ! Changes from last time : Escape hatches! I'm skipping T.assert_type! because I've only used it for testing RBI files, so I doubt that a beginner will need it. I also can't come up with a non-trivial example. T.enum Generics! This is ready for one last self-editing pass tomorrow and then peer review on…
I've been thinking a lot about the role of on-call engineers lately. Part of that is because I've realized that the best way to learn a complex system is to be "in the room" when things go wrong. Another part is that life rolled up a situation where I'm the first person to go twice in my team's new on-call rotation pattern. A principle I've held for a while is that useful…
By some mysterious business process (probably some automatic identity sync), my work Slack bio keeps getting erased. It's annoying because I never notice when it happens, but it's interesting because it gives me a chance to re-consider how I'm presenting myself to my co-workers. I started with just my team name, but I started adding my pronouns too, to help normalize the practice.…
Note: This was an incomplete draft. You probably want the finished version ! Changes from last time : Abstract classes. Coming up with an example for this took a while! I don't think I've ever actually used this pattern in real life. Interfaces I gave up on documenting sealed! and final! because they're an advanced feature. I'm skipping overridable because I haven't seen…
Note: This was an incomplete draft. You probably want the finished version ! Changes from last time : Added T.type_alias Added T.self_type Added T.attached_class Should the examples be in named methods or inlined into the module bodies? I think the method boilerplate might be more noise than signal, but maybe it's just the sig { void } that's the problem. I guess I don't need those…
Note: This was an incomplete draft. You probably want the finished version ! Changes from last time : Flow sensitivity attr_* family # Every file should have a "typed sigil" that tells Sorbet how strict to be # during static type checking. # # Strictness levels (lax to strict): # # ignore: Sorbet won't even read the file. This means its contents are not # visible during type checking. Avoid this.…
Note: This was an incomplete draft. You probably want the finished version ! Changes from last time : Describe T::Struct and its quirks Describe T::Enum common cases # Every file should have a "typed sigil" that tells Sorbet how strict to be # during static type checking. # # Strictness levels (lax to strict): # # ignore: Sorbet won't even read the file. This means its contents are not # visible…
Note: This was an incomplete draft. You probably want the finished version ! I'm watching Fleet Fatales 2020 on GamesDoneQuick ! Filling out the Sorbet cheatsheet is a great thing to do between runs 😄 Changes from last time : Fill in the combinators section. Use modules instead of classes to group sections. # Every file should have a "typed sigil" that tells Sorbet how strict to be # during…
Note: This was an incomplete draft. You probably want the finished version ! Continuing from last time . Change from last time: I filled in the standard library helpers. # Every file should have a "typed sigil" that tells Sorbet how strict to be # during static type checking. # # Strictness levels (lax to strict): # # ignore: Sorbet won't even read the file. This means its contents are not #…
Note: This was an incomplete draft. You probably want the finished version ! Time to spend another 15 minutes collecting some Sorbet examples! The earlier draft can be found in another Thinkin' Log . There are no new examples in this one, but the to-dos are more complete and better-organized. I think this includes all the types that I've actually used in my beginner-to-intermediate…
Note: This was an incomplete draft. You probably want the finished version ! As I start using Sorbet more, I've realized that I need a quick reference for some common patterns. I've always been fond of Learn X in Y minutes , so I'm going to try to copy that style. It'll take a few tries to get this right, so here's the first. # Every file should have a "typed sigil" that…
Error message: FooComponent initializer must accept `foo` collection parameter. Solutions that didn't work: ::Method.prepend(T::CompatibilityPatches::MethodExtensions) The methods we're looking at turn out to be ::UnboundMethod instances. ::UnboundMethod.prepend(T::CompatibilityPatches::MethodExtensions) Infinite recursion somehow! Solution that did work: module…
Okay internet, here's something I've been struggling with in Rails: how do I organize code that doesn't fit into one of the framework concepts? In particular, I'm trying to write some code that works with data from about 5 models, is not involved in HTTP requests, will be used by an asynchronous background job, and is reusable outside the context of that job. I've heard of…
Every time I start working regularly in a new programming language, I spend the first few months or so absolutely hating it. It has absurd conventions that make my code ugly. It doesn't let me think about my program the way I want to. It's missing some fundamental building block that I keep needing to emulate. And then, after living in that ecosystem for a while, it starts to look…
I've been helping my brother build his UX Design portfolio as a website, and I've been learning a lot about what makes the Web difficult for newcomers. In this case, it was domain-absolute paths vs. file-relative paths. The exact situation was two GitHub Pages sites where one was served at / and the other at /repo-name . For local development, both projects used <link…
This blog post got shared in my work chat today (and everywhere else programming is discussed on the internet): Technical debt as a lack of understanding . If you read it, make sure to also watch the video, because the story of the tech debt metaphor is also fascinating. I wonder what the metaphor would have looked like if it hadn't come out of finance.... I mostly fall into the applied…
A friend (thanks Bryan!) sent me a link to a podcast episode recently, and I finally watched it today: Lex Fridman | Chris Lattner: The Future of Computing and Programming Languages . This is the second-longest I've ever listened to anyone else talk about programming ( Jonathan Blow's On The Metal episode takes first place by a few minutes here). This validated a lot of thoughts…
A principle that comes up surprisingly often for me in programming is "escape hatches". When I talk about them (I'm far from the first to do this), I'm usually referring to the ways of sidestepping usually-useful abstractions. There's usually a power-safety trade-off here: more things are possible in the layer below, but you have to be more careful while you're there. This…
I read an article today that got me thinking about sign language again: Hand to mouth . Specifically, I'm thinking about it in the context of video calls being 2020's primary venue for multi-modal communication. There are thousands (millions?) of articles detailing the differences between video calls and everything else, so I'll skip my take on that in general. The article explores…
I heard about the Raspberry Pi 400 release today! I've always been supportive of the Raspberry Pi project because so much of my childhood (and life afterward) was defined by having access to a home computer. What's especially cool is that this Pi-in-a-keyboard still exposes the GPIO pins, so it's probably a great prototyping platform for Pi-based projects. I wonder if they're…
I've always thought that NaNoWriMo is a fun way for aspiring novelists to try out their writing. There's a sunk-cost-preventing time-box, a supportive community, and resources to help the lost-but-motivated. The reason I've never participated is that I'm not at all interested in writing a novel! What I am interested in is technical writing (computing, specifically) and sharing…
SQL HAVING clause When getting used to a new application (or domain area), I've found it useful to look at its data. In particular, in my team's region of the Rails monolith, I've learned so much from having SQL access to a sanitized read replica. It's been mostly simple questions, really: How many records are in this table? For example, if select count(*) from t returns less…
MacOS quick search in finder In MacOS, I'm bad at remembering which of Control, Option, and Shift is the correct bonus modifier for the action I'm trying to do. While trying to hit Ctrl+Cmd+Space to get the emoji keyboard I learned about last week , I sometimes accidentally hit Option instead of Control. That happens to bring up a Finder window with the search field automatically…
Setting MacOS mic input volume In my Six Months on a Mac experience report, I mentioned that the flawless Bluetooth audio connections comes at the price of tweaking the left-right balance on my headphones sometimes. It turns out there's actually a second problem! Sometimes, when I turn on my headset (a Jabra Evolve 75) and join a Zoom call, I'm essentially inaudible to everyone else on…
Cmd+. toggles code folding in RubyMine I've been writing a lot of RSpec tests for "legacy" code recently. Getting good coverage in this part of the app requires setting values for all the ActiveRecord associations correctly. This is about 20 lines of setup for each case. RubyMine has a nice mouse affordance for code folding (clicking the handles in the gutter), but I rarely use it because…
Six months ago, I started as a new engineer at Gusto, and one of the first new things I had to learn was how to use a Mac. There were a lot of other things, too, of course, like how Ruby works and what ACH is. But the Mac is what this post is about. I went in knowing it would be different, so I started drafting this post on day one. But I kept finding things that surprised me! Now that the rate…
I took part in Hacktoberfest this year! I successfully opened 4 pull requests on public repos in October (and will be getting that sweet participation T-shirt!), so I wanted to take a bit to reflect on the experience. I found out about the event through an announcement from Gusto's internal open source group. I then received emails from GitHub, DigitalOcean, and a few other services I use in…
I finally have my first real web presence that isn't owned by a social media company, and I'm excited to see how it turns out. I've been inspired by the resurgence of personal websites as a way of decentralizing content and returning the focus to the individuals who make up the internet. I just don't have a clear idea of what I can contribute, since I've exclusively been a…