Javascript

Why I Stopped Learning Python, Ruby and PHP and Went All In on TypeScript

Around 2020 I made a deliberate decision to stop language tourism — spreading effort across Python, Ruby, and PHP — and consolidate around TypeScript. I haven't looked back.

The Context Switch Cost

For several years I was maintaining professional fluency across multiple languages simultaneously. Python for data pipelines and NLP work, Ruby on Rails for server-side applications, PHP surfacing in legacy projects, and JavaScript on the frontend. Each language has its own idioms, standard library conventions, ecosystem tooling, testing patterns, and community norms. I felt more marketable in the hiring game if I could claim expertise across all touchpoints.

Read more →

npm Commands You're Probably Not Using

Most developers know npm install, npm run, and npm publish. The rest of the CLI tends to be discovered only when something breaks — which is the worst possible time to learn a debugging tool.

These are the commands I’ve found myself reaching for repeatedly, in rough order of how often they actually come up.


npm explain

This one earns its place every time a dependency audit or lockfile conflict appears. npm explain traces why a package is in your node_modules — which package required it, and what required that.

Read more →

Array handling in JS with functional purity

Functional programming has influenced JavaScript style significantly over the last decade. Pure functions — those that produce no side effects and return the same output for the same input — are now a widely adopted convention. But JavaScript is not a pure functional language, and the path to purity with composite types like arrays and objects has some real nuance worth understanding before you reach for a pattern wholesale.

TLDR

Clone before mutating when your function receives an array or object and side effects would be a problem. Prefer shallow clones for flat structures; reach for deep clones only when you have nested data you genuinely need to isolate. Don’t clone for read-only operations — it’s unnecessary cost with no defensive benefit.

Read more →

Toxic bias in the Javascript community

Having been in the Javascript community for a while I’ve witnessed the building momentum towards a Functional Programming (FP) style. I think Javascript and FP are great but there is perhaps a misguided favor or emphasis put on FP as something superior. The React community help perpetuate this with the introduction of hooks, moving away from class based components (favoring functions) and libraries like Redux all employing bits of FP.

Read more →

SVG Path Functions

SVG paths are written as a single d attribute — a mini-language of commands and coordinates that describes shapes. Each command is a letter; uppercase means absolute coordinates, lowercase means relative to the current position. This is a reference for all path commands with examples, followed by a worked pie chart that puts the arc command through its paces.

The full MDN reference lives at developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths.


Move and Line Commands

M — Move To

M x y

Lifts the pen and moves to (x, y) without drawing. Every path starts with an M. On its own it’s invisible — it’s a positioning command.

Read more →

Joomla 1.5 Component with Jquery and Mootools

I’ve been building a component for Joomla 1.5 and I really wanted to use Jquery in the admin over Mootools. Unfortunately Googling for this answer is tricky as so many people are posting examples how to remove Joomla js from their frontend template. The following is very ‘hacky’ but if you’re feed up with the Joomla API and want to throw together a component, without mootools, it’s useful. It stops the need to export jQuery into a different name space, therefore breaking 3rd party jQuery plugins.

Read more →

Javascript Date & Time Utilities

JavaScript’s built-in Date API is famously awkward. For most production work, Day.js is the right answer — it’s a 2kb drop-in that gives you immutable date objects, a chainable API, and a plugin ecosystem that covers almost every edge case. But if you’re keeping dependencies lean, or you just want to understand what’s happening under the hood, native Date gets you further than most people realise.

What follows is a comprehensive reference for the patterns you’ll reach for repeatedly.

Read more →