The Poetry of JavaScript

Despite our social media presence, a sizeable chunk of our Hotchpotch open-mic members still rely on our email bulletin. Almost exactly a year ago, I started the task of building up a new distribution list after the collapse of the old system. Here’s the story of what’s happened since.

After emailing everyone on the list individually, many people wanted to stay on it, a lot wished to stop receiving bulletins, and several never responded at all. The initial technical hiccups have long been ironed out and the number of subscribers almost doubled from 34 to 63 over the past 12 months.

The old list was not compliant with GDPR regulations, so it was important to ensure the new one was up to scratch, and that includes the ability to unsubscribe at any time. The easiest way is to have a public Web page with this functionality.

As we now had a basic website, there was an opportunity to publish more information there, such as our meeting times and standards of behaviour.

When I started this endeavour, I would copy open-source templates and simply strip out any unnecessary sections. One principle I like to follow is what YouTube creator Tom Scott calls the art of the bodge: cobbling together just enough code to do what you need it to, making refinements as you go along.

After a while of doing this, I slowly began to refresh and update my knowledge of HTML. Alongside that, I learned when and how to deploy CSS and JavaScript. The last time I dabbled in coding was many years ago before such elements were commonplace.

Perhaps I’ve been influenced by writing verse for so many years, but I can see a correlation between writing poetry and writing computer code. Every word has to be precisely the right one, each section is demarcated by curly brackets into its own ‘stanza’, and a detail as small as an incorrect line break can change how it’s interpreted.

But unless something in this current system breaks and has to be recoded, I”m leaving it alone, however poetic it reads.

CSI for CSS

Until September of last year, my open-mic event would circulate bulletins using a manually-maintained Gmail list. This is not designed to send 50-plus messages at once and the system eventually refused to send certain ones. So it was time to set up a more modern self-service system, and here’s the entry about what happened at the time.

For GDPR compliance, we also needed to set up a basic website to allow members to join and leave. Our Web server would then deal with the request automatically. I found an open-source template online and stripped it down to suit our needs. Everything else on the website was initially a secondary concern, but we’ve slowly expanded the content to include event times, standards of behaviour and the latest bulletin.

While running a link check, I spotted six broken ones. They weren’t important, merely referring to fonts that weren’t in use on the site, but I wanted to understand the errors and fix them.

It transpired that our site was referencing two separate Cascading Style Sheet (CSS) documents. These are used to define the visual appearance and layout of a Web page, including the colours, fonts, spacing and positioning of elements. Worse, the two documents contained some contradictory information, so the functionality of the website could change or break depending on the order in which the instructions were executed.

Combined with a little sloppy HTML syntax, the browser was doing some heavy lifting to correct the errors silently behind the scenes. Remembering the experience of the distribution list, I didn’t want this to collapse as well.

I used to be a lot more interested in computing than I am now, so much of my coding knowledge has left me. But I spent the weekend combining the two sheets and figuring out what could and should be removed. I relied heavily on user questions from Stack Overflow, the output from code validation websites and even ChatGPT to write snippets of code or check what I’d written.

Ultimately, a total of 7,800 lines of CSS code were reduced to less than 160 lines by Sunday night. The resulting Hotchpotch website is still incredibly static and basic, but it fits the bill precisely.

I then had the impetus to revamp an existing website for a small writing class I’ve been running. This time, I used authoring software for the general look and feel, then made small revisions to the code by hand with my newfound knowledge. The Placing Your Mark website is much more dynamic than its Hotchpotch cousin, although I might one day harmonise their respective designs.

Meanwhile, with the bank holiday weekend over, I’m excited to get back to writing words and sentences rather than syntax and semicolons.

Sailing By

Four weeks ago, I wrote a blog entry about warming up for Fun a Day Dundee in 2020.

I’m pleased to report that a version of that entry has been posted on the official website. Be sure to click around the menu at the top to read more stories and information about the project.

Note that the post is under my legal name of Gavin Cruickshank, which I don’t normally use for writing since few people can spell it correctly.

I haven’t had a great deal of time this week, so I’ll be back next week with a fuller entry.