Elf M. Sternberg

Full Stack Web Developer

Where one teaches, two learn.

Blog

A quarter-century of code experience

Career

THE KINKY USER STORY PATTERN

A user story is a pattern of communication commonplace in software development teams. The idea of a user story is simple: nobody cares about your software and your job isn't to write code, it's to solve user's problems, and the pattern is often a way of articulating a user's problem and the proposed solution. The most common pattern, as explained the software management company Atlassian, is:

As a [user persona], I [want to be able to do this task], so that I can [achieve this goal].

I find this pattern a little passive-aggressive, since it never identifies who is going to be providing the solution.

Continue Reading

Web development

THE WEB ASSEMBLY COMPONENT MODEL: WYVERN 2.0, OR A BRIGHT NEW FUTURE?

Many years ago, there was a programming language experiment named Wyvern that promised the polyglot developer he could, in the same file, write each function in a different language, and it would all work. It was a crazy idea at the time, but now? Now we write this way all the time. The Web Assembly Component Model is only going to make that all the more true.

Continue Reading

Web development

STATIC SITE GENERATION IS NOT A 'REACTION' TO CLIENT-SIDE RENDERING

JavaScript developer Katharine Angelopoulos recently wrote an article titled Emerging Paradigms for Delivering Content Faster, and while there's much good in her article there was a line in there that stopped me in my tracks. She wrote:

Static Site Generation came about as a solution to the maladies of SSR and CSR.

As someone who's website literally reads, Created: October 14, 1994 by Elf M. Sternberg, that line made me blink three times. I write stories, and there's no way I was going to convert them all to HTML by hand. From 1994 through to today, a total of 29 years, the story site has been statically generated from something resembling Markdown (for a while it was a format called Muse, which almost nobody remembers, and before that it was just called "Usenet emphasis style"), so static site generation can hardly be called "a reaction to server-side or client-side rendering."

It was literally the first thing we did. But the Eternal Amnesia means most people don't know that.

Continue Reading

Web development

THEY LIED. THEY LIED TO US.

As I mentioned in my last post, I really wanted to find a Web Component library that builds, you know, Web Components. Each component should be a standalone, loadable file ending in .js that instantiated the constructor of a fully-realized web component. I wanted a few bells and whistles, like HTML and CSS auto-templating, Typescript is a must but Sass is a nice-to-have.

Stencil promised that. It's promise reads "Stencil is a library for generating small, blazing fast Web Components that run everywhere." I'm took them at their word.

They lied.

Continue Reading

Web development

LIT IS TAKING HOSTAGES

I dislike "magical thinking" in software development and React has become too magical.

I've been a React developer since 2015 so I went through the "class-based to function-based" revolution in React Development. I've gone through the iterations of learning about Hooks, and Memos, and Callbacks, and I have to say that modern React requires a daunting amount of experience to write with any competence as well as a deeper understanding of JavaScript's call-by-value vs call-by-reference nature to avoid re-renders.

So it was with the typical glee of confirmation bias that I read Nudge's React is Holding Me Hostage in which he outlines the problems with modern React, including the illusion that state in React is a part of the component when, in fact, it is an input to the component.

Unfortunately it looks like the Lit team is making the same mistake.

Continue Reading

Web development

ADDING SEARCH TO MY STORIES

One of the things I've always wanted for my website is a search engine that wasn't beholden to Google. I've considered using Solr or one of those, but I really wanted something local. Something that ran on my laptop. Something that wasn't "in the cloud."

I had helped developed a library science application back at university, but that was over 30 years ago, and while I actually still have that textbook the techniques in it are outdated. I thought about using Tantivvy or something along those lines, but each was a complicated mess.

Then I discovered Meilisearch, and I fell immediately in love. It's a typo-friendly, incredibly fast, and (for searches) lightweight search engine that you can run locally.

Here's how I built it:

Continue Reading

Professionalism

STARTUPS: THE SECRET SAUCE, THE SCHLEP, AND EVERYTHING ELSE

Since I'm looking for work, let me tell you what I look for in a project. I don't look too hard at the languages, platform, or libraries being used; I know the most important ones and can learn their relatives and competitors without too much effort.

What I want to know about a start-up is this: do you have a secret sauce, and do you know how long the schlep will be?

Continue Reading

Web development

VERTICAL ROTATION WITH CSS

Recently I've been restoring an ancient website, one I first created in 1994, 29 years ago: The alt.sex FAQ.

alt.sex was the very first question-and-answer forum for sex-related questions on Usenet, even before there was an Internet, and somehow, when I was 28 years old myself, I wound up in charge of the editing team putting together the FAQ for that wild place. It's been 25 years, I wondered what it would be like to rebuild the site in a modern setting. It was fun.

Continue Reading

Programming

USING GIT SECRETS

In my Using PDM posts, I mentioned that I was rebuilding the backup tools for my blog. Using such tools requires that I keep a couple of my passwords, the ones I use for databases, in plain text, which is clearly not ideal, especially not if I want to use GIT to manage them. I decided to try using git secret to store my credentials. Here's how it works.

Continue Reading

Programming

USING PDM: THE PYTHON DEPENDENCY MANAGER

Since it looks as if Twitter's days are numbered, I've been looking at what it would take to move most of my on-line presence into my personal blog space and off of the various sites where I make various comments and such. One thing I haven't been doing well is backing up this site right here; my last backup was over two years ago. That's... not good.

Continue Reading

Project

PROJECT RETROSPECTIVE: STORYSITE 2022

I have a number of "static" microsites, in the sense that they're just plain old HTML with a minimum of Javascript supporting their operations. The oldest one is the Journal Entries site, which has been a Markdown archive of my vast and adult space opera since 1995 or so... which is quite a long time! It's had a number of generations since then; the first version had a simple perl-to-html converter, the output of which I would hand-edit, along with the index page. Recently, I got it into my head to revise them, and the change has amazing.

Continue Reading

Zola

USING ZOLA SHORTCODES & MACROS FOR NESTED LISTS

Zola is a static site generator that I've been using for my story sites and a couple of other documentation sites. It specializes in converting trees of markdown into stylish websites through a template library. As I've been getting better at, I've really started to enjoy it. Since my scattershot brain depends on lists and lookups, I have a lot of "definition files" that are nothing but a syntax example and some explanation of what it means. I'd like to be able to organize those sensibly, and Zola's shortcodes let me do that.

Continue Reading

Web development

PREVENTING DRAGGABILITY ON BOTH FIREFOX AND CHROME

Every image on a webpage is, unless you take measures to prevent it, draggable and droppable. Even on Linux, which isn't the world's most user-friendly operating system, you can pick any image on the page and drag it off, drop it onto your file manager of choice (Caja, Nautilus, KFM), and you'll be prompted for a filename under which it should be saved.

Sometimes you have complex forms that people click through very quickly. Your controls include card interfaces with a picture and a checkbox or radio button, and sometimes a sloppy click on one of those won't register as a click because it'll register as a drag on the photo instead, annoying the customer. Here's how to prevent that:

Continue Reading

Professionalism

AGILE IS DESIGNED TO CAUSE BURNOUT

In software development, Agile is the most popular form of project organization and Jira by Atlassian is the most common tool used to keep track of that organization. But two different ideas from two very different places and times have convinced me that Agile is the primary cause of developer burnout.

Continue Reading

Professionalism

YOU'RE NOT MISSING ANYTHING BY NOT WORKING AT A FAANG.

I make it a habit to never respond directly on The Orange Site, but a recent post there caught my attention and I wanted to respond to the poor guy. He said that he was on his third startup since getting out of university, but he'd never worked at "a big company" and feared that he'd somehow made it to 30 (OMG!) without ever learning "the right way to do something."

There is no right way.

Continue Reading

Programming

TYPESCRIPT OR BE DAMNED

I recently had a chance to finish up a major refactor of the codebase for BFDLang (Bureaucratic Form Design Language), a hefty (and now Turing-complete) language for describing, well, bureacratic forms to web documents. I work at an insurance company, and BFDLang gives the administrative staff the power to describe a form in a spreadsheet and immediately see what it would look like as a web document; it's a powerful, in-house no-code solution for them backed by a ton of code, mostly written by myself and two junior developers. The refactor was huge, and complicated, and I couldn't have done it with JavaScript. TypeScript saved me weeks of work.

Continue Reading

User-hostile software

APPLE IS A CREEP

Psychologists know what makes someone a creep. A "creep" is a person who makes you feel uncomfortable or vaguely threatened, but who you are obliged to be near for professional or social reasons. You don't like being around him or her, but you can't leave the room because your professional or social situation require that you be there.

By this definition, Apple is a creep.

Continue Reading