Removing left-pad one PR at a time

This is something that's been irking me for a while now, why is left-pad still getting millions of weekly downloads? And why is the download count on the rise?

Don't get me wrong, it was a hugely useful package when it was released. It performed a specific task in a reliable fashion, stuck to the KISS principles beautifully, and, for a few years, it quietly exploded in popularity.

That was of course until the fiasco that a lot of us will remember, when the maintainer pulled left-pad from NPM along with 272 other packages that they were maintaining, temporarily flooring a huge portion of the JavaScript ecosystem in one swift movement.

Given the slightly tainted reputation of left-pad, and that a native alternative has been available since mid 2017, I think it's time we put aside a few minutes or so to remove the package from our projects wherever possible.

I've started doing this myself, on a casual basis, for packages I come across that happen to still depend on left-pad. After all, the fewer packages a consumer has to download, the better!

A Game of a Hundred Lives — Day 9

I have to start by saying that this was one of the best implementations so far. Racket is a pleasure to write! I have a soft spot for languages that look good on the screen, and Racket looks great.

I've not used any fancy macros or features from the many extensions of Racket (or are they different schemes entirely?), so I like to think that this is a relatively vanilla approach. I'd appreciate feedback if anybody has any!

Before I sign off, I came across this wonderful website full of tips and tricks on how to write tip-top Racket.

A Game of a Hundred Lives — Day 8

Today's implementation of Conway's Game of Life is written using Rust. I like Rust, a lot, I like the idea of it, I love the tooling behind it, and for a modern competetor to C/C++, it's hit the nail on the head in my opinion.

I've read mixed reviews about Rust from diehard C programmers, they sometimes ring little alarm bells in my head, but you've got to take these with a pinch of salt.

People shouldn't brush over the fact that the ongoing development of Rust is pushing forward not one, but two fronts, with system level programing and WASM benefitting from the efforts of the team behind it.

A Game of a Hundred Lives — Day 7

The first week is complete! I chose to go with Groovy today, not a language that I often use (outside of Jenkins of course), but the language shares a lot of semantic similarities with JavaScript, so it sits well under my fingers.

I went for a semi-functional approach, not something Groovy is normally used for, but seeing that I'd not normally be allowed to write "functional" Groovy, I thought I'd go ahead a treat myself.

A Game of a Hundred Lives — Day 6

Another day, another implementation. I decided to Go with Go today (best pun I could think up, sorry) as per a suggestion from someone on Twitter. I'm not hugely happy with the look of the code at the moment, but I'm glad that it's working for now!

I'd never realised just how much Go looks like JavaScript, I'm not sure if this was a conscious design choice or not? I'm not complaining, I love good'ol JavaScript, any similarities are welcome from my perspective.

I will say this, although Go isn't a functional language, I'm pretty surprised that it lacks basic instance methods for iterating over arrays, aside from for/while loops of course. I'm not sure if I've missed something from the documentation perhaps?

A Game of a Hundred Lives — Day 5

A very entertaining implementation today using just vanilla POSIX shell! This meant no access to arrays or Bashisms, and therefore a much more challenging task in general.

A Game of a Hundred Lives — Day 4

Today was pretty tough, I choose to go with Haskell, and oh my, was it a steep learning curve.

A few years ago I read a great introductory book on Haskell (that I couldn't recommend more) called "Learn You a Haskel for Great Good". At the time I felt as though I was getting a grasp on the syntax and language structure in general, but I failed to put those learnings into practice, and between then and now, it looks as though I'd managed to forget everything.

A Game of a Hundred Lives — Day 3

Another smooth run today, one more implementation down! Today's implementation is written in Ruby, and it's a looker.

I feel that Ruby is a bit laborious to write, what with all of its end statements, but aside from that it's a pleasure to use. It feels very much like Python, and shares a some great syntax bonuses such as and/or; and ranges are another hugely useful feature that my go to language JavaScript doesn't have, so they're always welcome.

A Game of a Hundred Lives — Day 2

A much more productive session today. I used Python for this implementation, and although the finished product isn't nearly as elegant as a more experienced Pythonista would produce, I can definitely see why so many people love to work with the language!

I rarely use Python myself, so this turned out to be a nice little challenge.

A Game of a Hundred Lives — Day 1

After a lot of procrastinating with Blink, another side to this project, I finally moved on and decided to implement the first iteration of Conway's Game of Life in JavaScript.

It didn't take long, which was a relief seeing that I'd already frittered away a large part of the day!

© 2020 — Built by Iain J. Reid