Ned Batchelder's blog

https://nedbatchelder.com/blog

15 posts · 4 Votes

Tech 53% · Culture 13% · Life 13% · Writing 13% · History 7%

Subscribe via RSS

  1. Making git hooks visible

    Frank Wiles wrote about an attack he nearly fell victim to: a downloaded git repo had active git hooks that would have compromised his system. Seeing the risks, I wanted to make git hooks more visible on my own machine.A git hook is a script in the .git directory of a git repo on your machine. They run during various git operations. The important detail to understand about hooks is that they do not get installed locally when you clone a repo. A newly cloned repo never has active hooks. Hooks…

    0 ▲
  2. Expert asterisks

    Watching discussions happening online, I see a frequent unfortunate tic I’ll call the Expert Asterisk. A beginner is asking for help, and experts are answering. Then in the spirit of completeness, an expert throws in a fact or detail far from the learner’s abilities or needs.As an example, here was an interaction about git: a new learner was having trouble getting properly oriented. They were asking how branches relate to directories, and how to undo a change. They knew about git init but…

    0 ▲
  3. Silence is golden lightning talk

    This is a lightning talk I did at PyCon US 2026: Silence is Golden. The overall message is to leave some quiet time so that reluctant speakers have a chance to participate. I start with a jokey disclaimer because I followed Simon Willison who gave an energetic, entertaining, and loud(!) speed-run through a year of progress in LLMs:I do these talks and blog posts about how to better interact with people, but I hope they don’t come off as too preachy. I have to remind myself to keep these ideas…

    0 ▲
  4. Micro language implementation: Calcium

    I wrote a tiny language implementation: Calcium. It’s meant as a demonstration of how languages like Python are implemented. It has a tokenizer, a parser, an AST, a compiler, bytecodes, and an execution engine, all in about 300 lines of code.I did it because I often see the question: isn’t Python interpreted? Why do people say it’s compiled? (BTW, I also answered this in an earlier blog post: Is Python interpreted or compiled? Yes.) It can be hard to explain that your Python program never…

    0 ▲
  5. Caller-specific coverage

    I’ve had an idea rattling around to get more detail from coverage measurement. Can we measure the coverage in a function separately for each caller of the function?Here’s why I want it: in Acidica, my toy BASIC interpreter, I have code to implement the built-in functions that looks something like this:match func_name: case "LEN": if len(args) != 1: raise TypeError(f"Wrong arguments for LEN, got {len(args)}") return len(args[0]) case "LEFT$": if len(args) != 2: raise TypeError(f"Wrong arguments…

    0 ▲
  6. Acidica

    My latest fun project is a BASIC interpreter called Acidica. Classic BASIC is an old-school language first developed in 1964 that saw an explosion of implementations on microcomputers in the ‘70s and ‘80s. It’s much more primitive than the Visual Basic that you might be familiar with.A simple BASIC program:10 INPUT "What is your name"; U$ 20 PRINT "Hello "; U$ 30 INPUT "How many stars do you want"; N 40 S$ = "" 50 FOR I = 1 TO N 60 S$ = S$ + "*" 70 NEXT I 80

    0 ▲
  7. A place of certainty

    My mother is 86, and she is declining. Things that used to be easy for her now seem completely foreign. She was a programmer, writing software before I could read, so it is very strange to see her like this.She no longer uses a computer. If I mention some photos I found online, she asks if there’s any way she can see them, as if she has never used the internet. This is a new reality for me, but is easier than a year or two ago when she still tried to be constantly online. As things got more…

    0 ▲
  8. Dodecahedron with stars

    I saw this dodecahedron with an Islamic-inspired pattern designed by Taj Ragoo. As soon as I saw it, I knew I had to make one. I studied the pattern, wrote some Python, and made myself a PDF. I cut it out, folded it, glued it together, and now I have one of my own:I love that this elegantly combines two pure geometric forms: the Platonic dodecahedron (12 uniform pentagons), and an Islamic pattern using five-pointed stars.Looking closely, details emerge:Each face has ten small stars in a ring.…

    0 ▲
  9. Cultural factoids of the day: 64

    Perhaps because 64 is a power of two, and a square and a cube, but also for other reasons, it pops up in lots of places. Here are some of the things I’ve associated it with over the years:¶ Crayola 64-crayon box: as a kid, this box seemed like the ultimate luxury, the Rolls-Royce of crayons. So many colors, and the box had a built-in sharpener. Advanced technology!¶ A chess board has 64 squares, and is used as the setting for the age-old question about doubling: would you rather have one…

    0 ▲
  10. Franklin’s parents grave

    There are many historical artifacts and monuments in Boston. This is one of my favorites: It’s in the center of the Granary Burying Ground, the third-oldest cemetery in Boston. Casual tourists will assume the monument marks Ben Franklin’s grave, but they are wrong: it is for his parents.Ben Franklin wrote an inscription for his parents’ grave. The marker deteriorated and in 1827 was replaced with this large obelisk and a new plaque.The plaque is far from the walkway and hard to read even up…

    0 ▲
  11. Snake way for ducklings

    This is the mascot for Boston Python. It’s called Snake Way for Ducklings:My son Ben drew it, which makes me very happy. He also drew Sleepy Snake. Wearing this image on a shirt around PyCon, I had to explain it a number of times. People in Boston understand it almost immediately, but others need more background.In 1941, Robert McCloskey wrote a children’s book called Make Way for Ducklings. It’s a classic, selling millions of copies and never going out of print. We read it to our own children…

    0 ▲
  12. PyCon US 2026

    Last week was PyCon US in Long Beach California. As always, it was a jam-packed intense time. I’ll try to report on my experience. The videos aren’t uploaded yet, but I’ll link to them later when they are.This recap is longer than I’ve done in the past. I don’t know why, it’s just how it came out. I want to convey a sense of what I get out of PyCon and what you can get out of PyCon.ThursdayOpening receptionI came with five of my colleagues from Netflix. I got to the Thursday night reception…

    0 ▲
  13. School is artificial

    One of the hard parts of moving from school to “the real world” is adjusting to all the ways that school is artificial. It’s different from the real world.I’ve been thinking about this because of questions I see young learners commonly asking. Too often the questions are meaningless in the real world, and even if you could get answers, the answers would use useless.How long does it take to learn Python? In school, learning is divided into discrete labelled chunks. A class called “Beginning…

    2 ▲
  14. Linklint

    I wrote a Sphinx extension to eliminate excessive links: linklint. It started as a linter to check and modify .rst files, but it grew into a Sphinx extension that works without changing the source files.It all started with a topic in the discussion forums: Should not underline links, which argued that the underlining was distracting from the text. Of course we did not remove underlines, they are important for accessibility and for seeing that there are links at all.But I agreed that there we...

    1 ▲
  15. Human.json

    Human.json is a new idea for asserting that a site is authored by a person, and for vouching for other sites’ authorship. I’ve added one to this site.It’s a fun idea, and I’ve joined in, but to be honest, I have some concerns. When I made my human.json file, I looked through my browser history, and saw a number of sites that were clearly personal sites that I liked. But if I list one, am I claiming to know that there is no AI content on that site? I can’t know that for sure.I haven’t let this...

    1 ▲