Programming Leftovers
-
Rlang ☛ Is CRAN Holding R Back?
Today the R package acs was recently “archived” from CRAN. This led to the choroplethr package (which I maintain) also being “archived”. I write “archived” in quotes because CRAN stands for “Comprehensive R Archive Network”: everything on it is part of an archive and it appears that nothing is ever deleted.
-
Karl Seguin ☛ Switching on Strings in Zig
I've seen two explanations for why this isn't supported. The first is that there's ambiguity around string identity. Are two strings only considered equal if they point to the same address? Is a null-terminated string the same as its non-null-terminated counterpart? The other reason is that users of switch [apparently] expect certain optimizations which are not possible with strings (although, presumably, these same users would know that such optimizations aren't possible with string).
Instead, in Zig, there are two common methods for comparing strings.
-
James Koppel ☛ The 11 Aspects of Good Code
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.
-
James G ☛ Learning from prior art in technology design
One of the pieces of advice about design that has stuck in my head over the last year is to build a habit of noting interesting designs. When I am using technology, I often think oh, I like this! Then, I start asking more questions. What do I like about this? What behaviours does it encourage, positive and negative? What other examples have I seen of this pattern?
-
Rlang ☛ Lazy introduction to laziness in R
In the programming world, laziness can often be a good thing: it is both a human quality that can motivate automation efforts, and a programming concept that avoids wasting resources such as memory. Now, when reading code or documentation, seeing the word “lazy” can be confusing, because of its polisemy: it carries several meanings. In this post, we will enumerate the different possible definitions of “lazy” in R code.
-
Python
-
Simon Willison ☛ URL-addressable Pyodide Python environments
Datasette Lite is a version of Datasette that runs entirely in your browser. It runs on Pyodide, which I think is still the most underappreciated project in the Python ecosystem.
I built Datasette Lite almost three years ago as a weekend hack project to try and see if I could get Datasette—a server-side Python web application—to run entirely in the browser.
-
-
Shell/Bash/Zsh/Ksh
-
Julia Evans ☛ How to add a directory to your PATH
I was talking to a friend about how to add a directory to your PATH today. It’s something that feels “obvious” to me since I’ve been using the terminal for a long time, but when I searched for instructions for how to do it, I actually couldn’t find something that explained all of the steps – a lot of them just said “add this to ~/.bashrc”, but what if you’re not using bash? What if your bash config is actually in a different file? And how are you supposed to figure out which directory to add anyway?
-
[Old] Piya Gehi ☛ Making sense of zsh history shell options
I was refactoring my .zshrc recently, and found these existing options for managing the command history: [...]
-