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. The solutions for common general-purpose problems are good candidates for open sourcing because they do not represent core business values to keep them proprietary.

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

I worked from home for almost 4 months since the start of the quarantine before I got a monitor for working from home. I’m a programmer. I was under the impression that we were going to be able to go back to work first in April, then May. Now the government is saying August, but I no longer trust anything the government or the media says about the reopening timeline. I’m going to assume the worst that we are going to work from home until the vaccine becomes widely available. A realistic timeline for when that will be is late 2021, early 2022. I’m making preparations for a long term social distancing, work from home situation. Buying the monitor is the first step. I’m also getting a new set of furniture and moving to a bigger apartment so I’ll have a better time staying at home for an extended period of time. COVID-19 is the catalyst for me initiating the process of purchasing a home in NY, but I’ve always planned to purchase. This is my experience buying a home in NYC in the spring / summer of 2020.

Continue reading

Static code analysis

Static code analysis is a method for identifying bugs and other quality issues in the program by examining the source code without actually running it. This is achieved by scanning the codebase and tracing code paths to find common code smells, potential bugs, tech debt (e.g., duplicate code), unit test coverage, and code logic complexity. Static code analysis can be done manually but there are many static code analyzer tools to automate this. We’ll look at one of these tools, SonarQube, and walk through the process of setting it up locally and adding a static code analysis step to the Continuous Integration/Continuous Delivery (CI/CD) process for your projects.

Continue reading

Author's picture

Xiaoyun Yang

Software Engineer. Entrepreneur.

Software Engineer

New York