When I was filling out an online form today, I became unsettled by the choices presented in the “Age Group” selection: 18-24, 25-35, 35-54, 55+. It suddenly hit me that in just a few weeks, I will be entering the 35-54 range. This realization brought about a wave of emotions, including a sense of urgency to reflect on all the life lessons I learned so far and a desire to understand how to thrive in the years ahead.

Continue reading

I spend 3 hours at the gym every day, go on mountaineering and snowboarding trips every three months, work as a founding engineer at a Series A startup, and still have time for side projects like this blog post.

Someone recently asked me what’s my secret for getting all this done. How do I have time to do all these things?

In this blog post, I’ll share my secrets on how to be hyper-productive using some theories from business books I read and insights from science (e.g. three laws of thermodynamics), with examples from my experience climbing, training at the gym, and working as a software engineer.

Continue reading

The chat app is a table-stakes feature for any dating app. A responsive and reliable messaging experience encourages users to stay on the platform for communications. This is desirable from a trust and safety standpoint, as abusive messages produced on the platform can be effectively moderated and proper actions can be promptly taken.

In this article, we will explore the design of an offline-first chat app on the OkCupid website, in particular, how we achieved responsiveness by implementing optimistic UI design patterns and reliability by incorporating a messages cache to support offline-mode.

Continue reading

A few weeks after I turned 30, the world went into a lock-down. During the COVID-19 pandemic, I’ve done a lot of growing and learning as there is a lot of time to reflect on our values and think about better ways to live a more fulfilling life. There are two categories of lessons I’ve learned in my 30s. First is how to make better tradeoffs - opportunity cost, money vs time, efficiency vs effectiveness, and quality vs quantity. Second is how to prioritize.

Continue reading

In classic implementations of a CRUD app, the client app makes a request to the server and only updates its display state if the server responds to the request. However, in many modern applications like chat apps and note taking apps, users expect the display state to immediately update after they initiate an action.

Quick response time from the server is not always achievable, especially when the user is on a slow network on a mobile device.

Continue reading

We developers often find ourselves faced with a problem that seems general enough and common enough that someone else could have already developed a solution for it. But what if an existing solution does not exist?

I recently open sourced an ESLint plugin for OkCupid called eslint-plugin-i18n-lingui. The plugin is an extension for ESLint’s core static code analysis rules that enforces localization best practices by catching and fixing errors during development. The best practice rules were inspired by the learning pains from our efforts to localize our website.

This post will discuss why we developed our own ESLint plugin, why we open sourced it, and the steps I took to open source a ESLint plugin.

Although this post will not discuss the localization best practices that eslint-plugin-i18n-lingui enforces or how to create an ESLint plugin, keep an eye out for future posts written specifically about these!

Continue reading

A finite state machine (FSM) is an architectural design pattern that allows us to model a large system as a collection of loosely coupled components. Each component in the system changes its behavior when the internal state changes. This pattern allows us to write flexible, reusable, and testable code. In this article, we will explore the use of FSM in building complex React components.

The primary use of FSM has been in programming embedded systems but in recent years, there has been an emergence of FSM in other applications like managing states in the browser, modeling behavior, and building chatbots. The goal of this post is not to evangelize FSM as a better state management solution than its alternatives like Redux but rather, to introduce a pattern for simplifying the architecture of a system and write robust code that is understandable, extendable, and delete-able.

Continue reading

Author's picture

Xiaoyun Yang

Software Engineer. Climber. Snowboarder.

Software Engineer

New York