A day is a remarkably long time. It can be easy to forget that. Sometimes I like to take a minute and stare at a clock, feeling the eternity of each second. But more often than not, I find myself at the end of a day, questioning how I managed to spend all of those hours occupied with something. This is a common idea in regards to “wasting time”: for example, you might wake up on a…
If you’ve ever been advised to “[not compare yourself to others]”1, you’ve been given an impossible task2. This is because the analysis of the behavior of other humans is how we make sense of the world3. It gives us a baseline idea of “what direction is up”, of what behavior is “right”, what behavior is “normal”, and generally how to…
Most normal people find skydiving frightening, and for good reason1. When you jump out of the plane, you put complete trust in your parachute2. Letting go of the aircraft becomes an act of faith3. While such faith might seem crazy4, I’m convinced that this calculated, eyes-wide-open faith is a prerequisite to embarking on some of life’s most rewarding pursuits. Fear Fear is mechanism…
“Types and Programming Languages” (T&PLs) is a relatively-esoteric1 textbook about type theory. The professor2 of my college PLs class3 has an old webpage that recommends this book: If you are serious about programming languages Benjamin Pierce’s Types and Programming Languages is a must. This intrigued me, of course4, but it also appealed to my ego. Not only was it an…
I’m an enthusiast and daily user of git’s command line interface 1. While GUIs offer advantages in visualization and intuition2, they greatly fall short in power3, concision, and extensibility. Like vim, learning to use git (or any other CLI tool with lots of input options) has a steep learning curve4 and many little shortcuts and conveniences that left out of tutorials and references5…
What is Competitive Programming? “Competitive Programming” (by its name) encompasses all programming done in competitive nature. This post will specifically focus on (and use the term “competitive programming (CP)” to refer to) data-structures/algorithm (DSA) style contests. These contests usually have a similar format: solve as many problems as possible, as fast as…
Intro Motivation, though often overlooked, is arguably the strongest influence on a developer’s1 productivity. While skills, obstacles, and environments define the challenges we face, motivation defines the speed and fervor with which we approach them. Motivation is dually the great enabler and the great disabler. With sufficient motivation, no challenge is too difficult to overcome; without…
Ideas and Code Writing code is a never-ending battle to translate abstract ideas into formal instructions. This translation is lossy by nature: by making our ideas concrete, we are forced to face their inherent complexity and the bewilderingly large set of ways to arrange their inner-workings1. Programming is ultimately about coping with this complexity, often by imposing extra constraints, for…
Note: this isn’t a security post: “hacking” here means “unclean coding”, i.e. “I quickly hacked together a shell script as a temporary fix to the issue”. Sorry, cybersecurity enthusiasts. Obsession Over Details The better we get at coding, the more we become aware of the fine-grained structural details of our programs. As programmers (whose nature it is to…
All Hail The Object Design Patterns is a classic book from the 90s that centers around low-level OOP idioms. While I’m sometimes quick to criticize OOP1, I still think there’s a lot of utility in understanding its principles and learning to work with it. This is partially because OOP is so widely used: even in languages that claim to be multi-paradigm (e.g. Python and Rust), objects…
In my youth, I practiced Tae-Kwon-Do1. I had very little talent, but I still learned many valuable lessons. Few of those lessons were directly related to computer programming, but I have a knack for drawing tenuous connections between code and the outside world. Board-breaking was an occasional2 event in the school that I trained with. We didn’t do anything too fringe3 (mostly thin4 boards),…
I don’t know of a developer who doesn’t appreciate version control. The undo-on-steroids it provides is convenient and invaluable. But there’s a much more subtle aspect of version control (perhaps even a by-product) that I think has equal (if not greater) effects on development: commits. Atoms (Peeling Apart) Every git repository is made up solely of commits. Assuming that each…
I’ve written a lot of posts glorifying functional programming lately, but they tend to be abstract and hypothetical. They roughly amount to “ADTs, higher-order-functions, and immutability are usually better1 than their counterparts”. In those posts, I attempted to explain why that is true; here I hope to show it. The Program UW-Madison’s CS 536 (Compilers) features a2…
Learning computer science is a lot like forming an n-dimensional1 snowball. Beginning is tough, because you must start from nothing; the snowball begins as a tiny clump, and is prone to crumbling. Eventually, you reach a critical mass, and the snowball can be rolled along the ground, and its own weight helps it effortlessly pick up snow and build upon itself. The snowball’s mass grows until…
Disclaimer: This post is unapologetically romantic. When people ask me why I’ve chosen CS over other majors/careers, I usually respond something along the lines of: “Computers have interested me since my youth”, or “I’m driven by the creative power of computers”. These are understatements, though, and they do a poor job at conveying the nature of my feelings…
Programming is hard. It’s hard to work with tools, to formulate ideas into code, and to make that code work. As developers, we are inevitably forced to manage many responsibilities at once, more than can be reasonably managed by a single human. This can have a huge psychological strain: when one responsibility deeply focused on, the others go into subconscious1, yet the programmer still…
Before I discovered programming, a lot of my time around computers was spent becoming intimately familiar with the software I used on a daily basis. I became a master of Microsoft Power-Point transitions, keyboard shortcuts of all kinds, and I had a particularly curious habit of exploring the Windows1 and iOS settings menus, where I would toggle every setting and observe its impact on the system.…
No, this is not an April Fools’ Day joke. I’m currently taking a class on programming languages as a part of my CS degree at UW. The class briefly touches on Haskell, and somebody posted the following question to Piazza1. The question is almost certainly a joke: our professor set up a bot that will generate responses to posts tagged with “gpt”: this question is likely a…
A few decades ago, universities were the only place where it was possible for students to use and learn about computers; now it’s possible to teach yourself the entire curriculum without leaving your basement. This has led to the popular social-media trope of “first line of code to FAANG engineer in X months”, and the frequent discussion of “college vs bootcamp vs…
Functional programming (FP) has an odd status among developers. It is1 simultaneously loved and feared. I suspect most programmers would agree that maps and folds are useful, but concepts like immutability and pure functions are more controversial, and the especially technical bits (e.g. monads) are flat out polarizing: the people who use them do so obsessively, and those who don’t avoid…
There are a lot of opinions about the “best ways” to learn programming on the internet, but they’re usually some combination of the following: “Just write code” (“learn by doing”) Learn “the basics” (e.g. DSA) Learn certain technologies (e.g. React) Use resource x (e.g. books, websites, courses, video tutorials) Get a degree By far, (1) seems…
Monads are data types1 that expose methods for chaining, typically for the sake of abstracting state. More concretely, a monad is a type m where there exist the two2 functions: class Monad m where (>>=) :: m a -> (a -> m b) -> m b return :: a -> m b The above signatures might be confusing, because they make use of several of Haskell’s language features. Infix Operators:(>>=) is a…
I’ve been working on writing an APL Interpreter recently. Understanding the language is a prerequisite to writing an interpreter, and I’m pretty sure I’ve got it figured out, but I figure it’s still a beneficial exercise to transcribe that knowledge into an explanation. APL was originally a mathematical notation rather than a computer programming language, so there are many…
I love vim. It makes editing text fast and fun. The learning-curve is admittedly steep, however, and the return-on-investment for seeking new bindings looks too much like the reciprocal function. I have nevertheless spent several hours reading the majority of the vim user manual and searching for new vim tips online. That information was terribly uncompressed, though, so it took way longer than it…
I recently started learning Haskell, and I came across a structure in the language that really made me think: Currying. Consider a function called “add” that takes two integers and returns an integer. Here’s the function signature in C: int add(int a, int b); And in Haskell: add :: Int -> Int -> Int If you’re not familiar with Haskell, the above signature probably…
The Vim Lecture I was initially hesitant to write a post about Vim, because most of what I have to say about it has already been said somewhere on the internet1. My mind was recently changed when, in my Programming III class, approximately 10 minutes of lecture were spent on “teaching Vim”, which consisted entirely of using the arrow keys to move the cursor around, “i” for…
TL;DR: long cards are bad; short cards are good. The TL;DR says it all, but I want to elaborate on how I fell into the trap of making bad cards. I have no excuse for not knowing what good cards look like: I first discovered Anki through Derek Banas’ tutorial, in which Derek makes suggestions to keep cards simple, avoid lists, and avoid grouping similar data. While this was very natural in…
What and Why Leetcode is a popular platform for studying DSA (Data Structures and Algorithms), especially for coding/technical interviews, competitive programming, and education in general. It offers a growing list of problems (~2,750 as of July 2023), which can be solved directly in the browser, typically in 10-50 lines of code. I’ve solved over 400 problems on Leetcode (roughly 15% of the…
I like to plan things out, especially things of high importance. Since college happens to fall into that category, I’ve spent a significant amount of time planning out courses, and I’ve made a habit of studying for every math/cs course before the class begins. I was able to do both of these things with the help of online resources, many of which were student-created. I intend for this…
There seems to be a notion that owning an expensive computer is necessary to study computer science. While I do think that buying the most expensive notebook at Best-Buy would probably be the most convenient option (in the short-run, at least), after carrying around a $90 Chromebook every day of my freshman year, I found that computational power and software compatibility alone isn’t what…