<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Zach Drake's Blog</title><link href="https://zachdrake.com/" rel="alternate"/><link href="https://zachdrake.com/feeds/all.atom.xml" rel="self"/><id>https://zachdrake.com/</id><updated>2026-10-01T09:00:00-04:00</updated><entry><title>Peanut Butter and Jelly: Why Python and JavaScript Belong Together</title><link href="https://zachdrake.com/peanut-butter-and-jelly/" rel="alternate"/><published>2026-10-01T09:00:00-04:00</published><updated>2026-10-01T09:00:00-04:00</updated><author><name>Zach Drake</name></author><id>tag:zachdrake.com,2026-10-01:/peanut-butter-and-jelly/</id><summary type="html">&lt;p&gt;A self-contained Pelican post that keeps its Markdown and images in a single directory, using &lt;code&gt;{attach}&lt;/code&gt; to co-locate assets with the rendered article.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Peanut butter is the dependable one. It shows up in the pantry, it does not
need to be refrigerated, and it will hold a sandwich together on a long hike.
Python is peanut butter: batteries included, readable, and quietly everywhere —
from data science notebooks to the glue scripts that keep a server farm alive.&lt;/p&gt;
&lt;p&gt;Jelly is the flashy one. It is bright, it is sweet, and on its own it is a
little too much. JavaScript is jelly: it runs in the one runtime nobody can
avoid — the browser — and it turns a dry piece of toast into something you
actually want to eat.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A jar of peanut butter labelled Python" src="https://zachdrake.com/peanut-butter-and-jelly/images/peanut-butter.svg"&gt;&lt;/p&gt;
&lt;p&gt;Neither one is a complete lunch. A jar of peanut butter with no jelly is a
sad, sticky mouthful. A spoonful of jelly with no peanut butter is a sugar
rush followed by regret.&lt;/p&gt;
&lt;h2&gt;The sandwich is the stack&lt;/h2&gt;
&lt;p&gt;The reason the PB&amp;amp;J works is that the two spreads are complementary. The
peanut butter gives structure and protein; the jelly gives sweetness and
acid. In software terms, Python is where the durable logic lives and
JavaScript is where the user actually touches it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A jar of grape jelly labelled JavaScript" src="https://zachdrake.com/peanut-butter-and-jelly/images/jelly.svg"&gt;&lt;/p&gt;
&lt;p&gt;Most real projects end up doing exactly this. A Python service behind an
HTTP API, and a JavaScript front end that renders it. The two of them are
not rivals — they are two halves of the same sandwich.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A peanut butter and jelly sandwich labelled Python and JavaScript" src="https://zachdrake.com/peanut-butter-and-jelly/images/pbj.svg"&gt;&lt;/p&gt;
&lt;h2&gt;Keeping the sandwich in one place&lt;/h2&gt;
&lt;p&gt;The important part is that all of the ingredients for this post — the
Markdown and the images — live together in a single directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;content/
└── blog/
    └── peanut-butter-and-jelly/
        ├── index.md
        └── images/
            ├── peanut-butter.svg
            ├── jelly.svg
            └── pbj.svg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;{attach}&lt;/code&gt; links are what make this work. When Pelican builds the
article, each &lt;code&gt;{attach}images/...&lt;/code&gt; reference is rewritten and the linked
file is copied into the article's output directory, preserving the
&lt;code&gt;images/&lt;/code&gt; relationship. The post is a self-contained bundle: move the
folder, and everything it needs comes with it.&lt;/p&gt;
&lt;p&gt;So the next time someone tries to start a language war, point out that
nobody argues about whether a PB&amp;amp;J should have peanut butter &lt;em&gt;or&lt;/em&gt; jelly.
You put them together, and you get lunch.&lt;/p&gt;</content><category term="Programming"/><category term="python"/><category term="javascript"/><category term="tooling"/></entry></feed>