Programming Leftovers
-
Redowan Delowar ☛ Dysfunctional options pattern in Go
Ever since Rob Pike published the text on the functional options pattern, there’s been no shortage of blogs, talks, or comments on how it improves or obfuscates configuration ergonomics.
While the necessity of such a pattern is quite evident in a language that lacks default arguments in functions, more often than not, it needlessly complicates things. The situation gets worse if you have to maintain a public API where multiple configurations are controlled in this manner.
However, the pattern solves a valid problem and definitely has its place. Otherwise, it wouldn’t have been picked up by pretty much every other library.
-
Bozhidar Batsov ☛ Weird Ruby: Incrementing Strings
I guess most Rubyists know that you can use the methods Integer#succ1 and its alias Integer#next to increment a number. E.g.: [...]
-
Josh Justice ☛ Simple Design: Reveals Intention | CodingItWrong.com
In the first edition of the book Extreme Programming Explained, Kent Beck introduced four rules of simple design. Martin Fowler has a succinct summary of them:
• Passes the tests
• Reveals intention
• No duplication
• Fewest elements
Let’s discuss all of them in a series of posts, skipping over “passes the tests” for the moment; we’ll look at it at the end in light of the other rules. In this first post we’ll look at “reveals intention”.
-
Buttondown ☛ How to argue for something without any scientific evidence
This is near and dear to my heart. On one hand, I think empirical software engineering (ESE) is really important and have given several talks on it. On the other, I think ESE's often a trainwreck and find most of the research flawed. And my career is based on formal specification, which hasn't been studied at all.
Thing is, software still needs to get built regardless of how much we know about it. So how do you get people to believe you when there's no science backing you up?
-
Sightline Media Group ☛ New York will send National Guard to subways in wake of violent crimes
New York Gov. Kathy Hochul announced plans Wednesday to send the National Guard to the New York City subway system to help police search passengers’ bags for weapons, following a series of high-profile crimes on city trains.
-
Steve Kemp ☛ Steve Kemp's Blog
I used to configure Emacs to run a linter when saving some specific type of files. For example I'd have a perl-utilities package to reformat perl code, and run the perl-linter on saving, then I'd have a hook to do the same thing for Dockerfiles, etc, etc.
-
Software Is Crap ☛ Surrounded By Bugs
It's taken me a while to get properly used to the idea of the Rust programming language. I still haven't actually properly learned the language, though I've been exposed to it in various ways; I've resisted doing so, in fact, I think it's fair to say, even though I've long been aware of C and C++'s propensity for Undefined Behaviour, that catch-all clause of the language specifications which, essentially, allows that a program that violates the language's rules can have any behaviour at all. I'll get to learning Rust eventually. In the meantime, I have some C++ projects going strong, and I'm happy to say that I have no great regrets about choosing C++ for these, despite its lack of memory safety and the presence of Undefined Behaviour, even though Rust shows a clear path forward that I will eventually set out upon.
-
Earthly ☛ Why You Need a Developer Platform
Developer platforms centralize the internal tools and processes that developers use to build and deliver software. These platforms improve DevOps outcomes by providing automated mechanisms for developers to achieve their tasks.
More teams and organizations are launching their own internal developer platforms (IDPs) to reduce friction in their software delivery. Establishing an IDP takes time but offers substantial benefits, including improved productivity, easier collaboration, and less risky development. This article will explore these advantages and how they apply when building or buying an IDP solution.
-
Rlang ☛ Beyond Equality: Unleashing the Power of Non-Equi Joins in {dplyr}
R, a language renowned for its data analysis capabilities, is embraced by data scientists worldwide. Within the expansive realm of R packages, the Tidyverse ecosystem stands out as a powerful and cohesive toolkit for data manipulation and visualization.
In this comprehensive exploration, we’ll dive into the capabilities of {dplyr}, a core component of the Tidyverse, and unveil the magic of non-equi joins and rolling joins within this tidy framework. These advanced functionalities not only enhance the expressiveness of your analyses but also seamlessly integrate into the philosophy of tidy data, considerably reducing the cognitive bottleneck.
-
Juha-Matti Santala ☛ Chesterton’s Fence and tech documentation
Chesterton’s Fence is a concept in public policy that states:
"The principle that reforms should not be made until the reasoning behind the existing state of affairs is understood. "
I ran into it for the first time a while back and it immediately took my thoughts to documentation of software projects.
-
Anton Zhiyanov ☛ I'm a programmer and I'm stupid
So what do I do about it?
I use the simplest mainstream language available (Go) and very basic Python. I write simple (though sometimes verbose) code that is easy to understand and maintain. I avoid deep abstractions and always choose composition over inheritance or mixins. I only use generics when absolutely necessary. I prefer flat data structures whenever possible.
-
Bill Mill ☛ How I use git worktrees
My favorite feature of git is one that not enough people know about: worktrees.
Worktrees allow you to store branches of your repository in separate directories.
This means you can switch branches by changing directory, instead of switching between branches in the same directory with git checkout or git switch.
I've never seen anybody describe using worktrees quite the way I do, so I thought I'd write out how I like to work with them.
-
Rlang ☛ Title: How to Rename Factor Levels in R (With Examples)
Before we jump into renaming factor levels, let’s quickly recap what factors are and why they’re useful. Factors are used to represent categorical data in R. They store both the values of the categorical variables and their corresponding levels. Each level represents a unique category within the variable.