Elf M. Sternberg

Full Stack Web Developer

Where one teaches, two learn.

Blog

A quarter-century of code experience

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

Programming

STILL GOT IT

Yesterday, after a long day of my day job, in which I spend all of my time either hacking in Typescript and React or doing a lot of dev-ops, I decided that I was finally gonna sit down and write a little Rust. I picked a project off my stack: "Rewrite the Unix locate program in Rust." The last time I had tried this, my brain didn't work at all.

Continue Reading

Web development

HTML TEMPLATES: NOT A NEW IDEA, DEFINITELY FASTER THAN ROLLING YOUR OWN

About fifteen years ago at a startup, I built a very data-heavy single page app for biologists to manage a map/reduce version of a gene sequencing engine, and because it was data heavy, it made use of templates to render much of the HTML. If you've ever been in this situation, you reach for a library.

With HTML Templates, you might not need a library. But I suspect you're going to want one.

Continue Reading

Programming

YOUR COMPANY NEEDS ONLY FIVE PROGRAMMING LANGUAGES, NO MORE, NO LESS

If you've worked in this business for a long time, you've definitely encountered that mid-size company where every team has their own favorite language. And while this might work for awhile, it's a long-term disaster waiting to happen within your company. Eventually, every company that grows to a certain size and survives realizes that you need to clamp down and have at most four computer languages allowed inside your build process.

Here are the four languages:

Continue Reading

Personal

MY PROCESS: NEVER USE PIDGIN IN TO-DOS.

Like most people, you probably write your to-dos in a shorthand way. I do, and most people do it as well. You know, this sort of thing, a one-day list I made for my latest project (which, ironically, includes a To-Do list manager). And along the way, I've discovered that I should never used shorthand or pidgin in my to-dos.

Continue Reading