As you’re working day-to-day, every so often it’s nice to take a step back and improve things. Some changes require having a strong understanding of how things are done and why, but can lead to huge benefits. Think: a chef finding a better way to brine poultry to preserve flavor, or finding a baking schedule that lets most customers get bread fresh out of the oven. Other changes lead to a slightly…
You’re a line programmer for EvilCorp, and it’s just an average day working on some code to collapse the economy. Then you realize you need some code for disrupting supply chains. Should you split it into a new file? Let’s say you do. Pretty soon your directory looks like this: It’s so well organized! You want to know what it tracks about the robot armies, it’s right there. Except that all your…
There’s a ubiquitous piece of startup advice: “Sell painkillers, not vitamins.” With painkillers, the story goes, you fix something that’s been bothering the customer immediately. With vitamins, all you have to offer is some vague future wellness benefit. Through this lens, a lot of product ideas are bad businesses because they are vitamins. But is it true? I think there’s a message here that a…
Resume-writing is a game. There are two players. There's you, trying to condense your whole life into one page in a way that presents you as the most impressive candidate possible. And then there's the reviewer, trying to decode that page into a real person they can assess. There’s been a lot written about writing resumes. And also on getting awards and grants, another variation of this game. My…
Lessons on code quality start in the first few weeks of learning to program, when a newcomer to the field is taught the basics of variable naming and told why programming languages have comments. They continue in countless blog posts and in every debate on a pull request. Avoid it or embrace it, code quality training permeates one's entire career. But it is so easy to lose sight of why. Says the…
The title of this post should be in double quotes, but it seems parts of Google have not learned about abstracting sanitization . Screenshots of bug here . As systems grow, they become more complex, overwhelming the mind. And yet we humans have a trick to build objects of far greater power than could be understood by any one person. That trick is modularity: the ability to create something out of…
Software engineers are continuously improving in ways deep and shallow. The easiest things — surface knowledge like how to use git bisect or how to file an expense report — can be taught by straightforward practice or even by post-it notes. The hardest things — the assertiveness to say no, and the confidence to admit when you don't know — are foundational changes thought to require years of…
Some readers may have seen the first 2/3 of this post previously, under the name "Demystifying Dependence" parts 1 and 2. When posting the final third, I decided to merge them back into one. --> Update Oct 30, 2022 : Professor Daniel Jackson wrote a response to some of the criticism this post experienced on Hacker News. This post is based on a research paper at Onward! 2020 and loosely follows the…
As a high schooler in the 70’s, my father enjoyed playing the Star Trek game written for the Sigma 7 mainframe. You play as the Enterprise surrounded by Klingon ships, and to shoot them down you have to look at a grid and figure out which angle (in degrees) to fire at. It was fun right until he learned trigonometry. Three days ago, Conrad Barski, creator of the absolutely delightful book/comic…
“Interfaces are abstractions” — Olaf Thielke , the "Code Coach" “Interfaces are not abstractions” — Mark Seeman , author of Code that Fits in Your Head and Dependency Injection “Abstraction in programming is the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use” — Richard…
Update 6/14/21 : Now available in Chinese . I started working on advanced developer tools 9 years ago. Back when I started, “programming tools” meant file format viewers, editors, and maybe variants of grep . I’d mention a deep problem such as inferring the underlying intent of a group of changes, and get questions about how it compares to find-and-replace. Times have changed. It’s no longer…
I’m currently taking my 5-person advanced coaching group on a month-long study of objects. It turns out that, even though things called “objects” are ubiquitous in modern programming languages, true objects are quite different from the popular understanding, and it requires quite a bit of theory to understand how to recognize true objects and when they are useful. As our lessons take this…
The C++ STL may be the most impressive achievement in language standard libraries. Where most programmers are stuck complaining that their language’s default strings aren’t performant enough, about every standard C++ function for strings actually runs on arbitrary character sequences. Design your own container? std::find_if works just as well as for the built-ins. And it does this while often…
A few months ago, I sat down with Adam Gordon-Bell of CoRecursive to share my thoughts on software design and self-improvement. It's actually a bit funny how I found him. " Corecursion " is an advanced programming term that refers to recursive or iterative programs which are structured around the shape of the output, rather than the shape of the input. It's connected to the theory of data vs.…
Update 12/31/2019 : I have also written a guest post on this topic for PL Perspectives, with fewer details but more applications. Update 7/23/2023 : This title is now a snowclone! See The best multicore-parallelization refactoring you’ve never heard of (video and transcript of my Compose 2019 talk, given June 25th, 2019.) Transcript Hello everyone. I'm so excited to be here at Compose, along so…
I want to make something clear: I am not, and have never been, an advocate for formal verification of production systems. Sometimes people think I am because I talk about ideas from that space, but my perspective has always been to use knowledge about how machines reason about code to better understand how humans reason about code. There’s a small core of people pushing the technology, and a…
In my day job, I work with programs that write, analyze, and transform other programs. You can't do this unless you have some special insight into how programs work. Much of my night job is finding these insights and making them accessible to non-specialist programmers. A few months ago, I spent a week in St. Louis, where I gave my first industry conference talk, at Strange Loop on this topic, as…
I’m trying to read all the good writing about software design. This is very easy because not very much has been written: it turns out that it’s much easier to write an article about how to write a Tetris AI as a containerized Kotlin microservice than it is to shed insight on how to write good code. And so, when I heard about John Ousterhout’s new book “A Philosophy of Software Design,” I ordered…
A few weeks ago, I sat down with Steve Krouse of Future of Coding . Steve is a thinker who left full-time work many moons ago to pursue his dream of making programming better. His podcast is full of interviews with people who are doing something to try to change the way we write code. I found him a pleasant character, and we dived deep into many topics related to software maintenance that I've not…
One of my coaching clients was designing a program, and came to me with a data-modeling question. The program was for making interactive stories like those Choose Your Own Adventure books. A story contained many passages. In a passage, you might encounter a monster, and then flip to page 62 to fight it, or to page 187 to run away. He had been choosing between two models. In one, the story contains…
Last night, I encountered an old post by Zach Holman where he pushes the idea that traditional school-based CS is useless; project-based learning is the way to go. I’ve heard this idea repeatedly over the last 10 years , and know at least one person who’s started an education company with that premise. I don’t want to debate the current way universities do things (I found my undergrad quite…
Programming seems to become more about memorization every day, with advocates pushing for memorizing lists of design patterns and refactorings and the difference between “parameter coupling” and “invocation coupling.” Forget all about that. There’s much more to gain by having general principles which apply to many situations. In this post, I’m going to show you one of my favorite software design…
Let’s face it, programming books suck. Those general books on distributed systems or data science or whatever can be tomes for a lifetime, but, with few exceptions, there’s something about the books on how to write code in a language/framework/database/cupcake-maker, the ones with the animal covers and the cutesy sample apps, they just tend to be so forgettable, so trite, so….uneducational. I…
Big up-front planning phases are out. Rapid iteration is in. With all this movement towards agile, it’s increasingly tempting to throw out the idea of having a separate design doc for software in favor of just getting started and having self-documenting code. And that is a fatal mistake. Last week , I explained that we speak about program behavior at one of three levels: executions, code, and…
Update 3/20/2019: Previous versions of this post used the terminology Level 1/Level 2/Level 3 and "Level 3 bug" a lot. I'm diminishing this in favor of "Runtime/Concrete Implementation/Logic level" and "Error of modular reasoning," because people started using "Level 3" to mean "Everything about the code that I don't like that can't cause an incorrect output." Have you ever stopped to consider…