Functional Teams with Executive Dysfunction

The open source project I've been working with has been struggling with project management recently. In a project with such a broad scope, how can we encourage a team to stay focused on one thing long enough to complete a feature? How much can we direct the work when the work is contributed by volunteers?

In order to discuss how to focus work in group volunteer projects, I think it's important to consider how attention functions in the volunteers as individuals.

I originally wanted to do this as a video essay. Partly because of how useful the neurodivergent community on TikTok has been to helping me understand my own patterns of thought and behavior. Mostly because I thought having a face and a voice to go with the message would help reduce misunderstandings and stigma about the topic.

I managed to get about thirty seconds in, using jwz's Cascade of Attention-Deficit Teenagers as a preface:

An interest-based system, with examples of documentation and debugging. …

What's Lost in the Squash

There have been countless posts written over the past decade about git workflow and the merits and pitfalls of rebase operations. I don't expect this page adds anything new to the discourse at large, but I find myself wanting documentation of the ways that GitHub's Squash and Merge button complicates my workflow.

My goal in writing this instead of referencing one of its many predecessors is to restrain myself to the pain points that have come up in practice in recent work, as opposed to the many hypothetical “what if?” scenarios we imagine when ask ourselves what we want from a version control system.

Downstream work-in-progress and being told “this commit does not belong.” …

git add .idea/

Sharing the .idea Directory in Version Control

Many projects keep the .idea/ in the ignore list, but it's just as valuable to share the settings here as it is for any other configurations for code quality tools, formatters, or build configuration. It is supported and encouraged by IntelliJ.

That said, the reasons why many projects have historically ignored it are real, and it will take a little attention from you and reviewers to decide what to do when a change in this directory shows up in your git status.

Questions to ask are:

  • Does this change provide something all the project's contributors will want?
  • Does this change contain anything specific to my installation?
  • Is this diff flipping the order of some lines, but not changing their values?

…yes, dictionaries too …

Weeks 5 – 250: Notes from Five Years of Python Web-Dev

Dear blog,

It has been a while since I last wrote.

I had that job writing Django for a while, and then went right from that one into a job at a spin-off company. Different product, different industry, still working on Django code from the same predecessors, but with more coworkers.

I worked on a bunch of things! Here's a list of some of them. If any of them sound interesting, let me know and maybe I can write about it in more depth or you can invite me to give a presentation on it.

APIs with Django, several databases (including Neo4j), and stuff. …

Week 3: Stale Copy: Object Identity in Related Models and Reloading Out-of-Sync Instances

The Task model in our application has a tree structure where tasks may have sub-tasks as children. We do this with a recursive relationship like this:

class Task(Model):
    parent = ForeignKey('self', related_name='children', null=True)
    finished = BooleanField(default=False)

I was testing a function that modifies a task and all its descendants, so my test looked a little like this:

def test_finish_all():
    task_1 = Task.objects.create()
    task_2 = Task.objects.create(parent=task_1)

    finish_all(task_1)

    assert task_1.finished
    assert task_2.finished

The second assert fails. Is the problem with the test or the implementation? …

Week 3: Searching for Definition of a Model Attribute

One of the things I really appreciate about Python is how easy it is to navigate from a line of code that mentions some class or function to the source where that name is defined. For example, given

headers = SortedDict()

You may ask What's a SortedDict? Searching that source file for SortedDict, you find it's defined by

from django.utils.datastructures import SortedDict

But the definition of this model attribute is nowhere to be found. …

Week 1: Tests, Transactions, and Tear Down

With our migrations fixed, we could now get on with the business of writing tests. Django uses Python's standard unittest package, which I'm well familiar with.1

We did a straightforward sort of TestCase, creating a User object and other instances of models needed by the code under test,2 we put that in a setUp method, and after we'd written a few of these, I asked shouldn't we write a tearDown method to clean up all these objects we've been creating?

My partner looked at me like I'd just suggested we put ice cubes on the pizza. Why would we do that?

Why, or why not, involves transactions. (Continued…) …