stdout is only for a program's main output

30 January 2024
  • Not for any other information
  • Not for progress bars
  • Not for warnings
  • Not for errors

Only for the main output.

Continue reading →

The biggest reason I never use classes in JavaScript

11 December 2023

JavaScript methods that use this in reference to the class they belong to will break if the method is assigned to another value or passed into another function as a function object.

This is because the value of this is dependent on the object that the method is a member of at the time of calling.

Continue reading →

Writing Production Ready Code

14 October 2023

Is your code too clear and simple? Is it too obvious what it does? Did you write it in a way that is too easy to understand?

If so, you need to make it Production Ready. If you aren't using Factories, Generic Higher Order Functions, or DependencyInversionDeinverterWrapperBeanSingletonProducers, you really need to up your game.

Continue reading →

Disproportionately Satisfying Programs

7 October 2023

I find some little programs/scripts/snippets disproportionately satisfying to write/use. The best programs are ones that I never intend to share with anyone else.

The following program is one I wrote recently that falls into this category. All it does is convert lines of CSS into React inline styles, and it took only a few minutes to write.

Continue reading →

What does your FizzBuzz say about you?

24 September 2023

A classic problem

At the interview for my first job, I was asked to write a FizzBuzz. A FizzBuzz is a program that prints a series of numbers, unless a number is divisible by 3, in which case it prints Fizz, or divisible by 5, in which case it prints Buzz. For any numbers divisible by both, it should print FizzBuzz.

Continue reading →

Little Red Flags

11 June 2023

Obvious issues can betray the presence of subtler ones

Recently, I stayed in an Airbnb. At this Airbnb, the shower's hot and cold were reversed. Initially confusing, but once I realised this I could use the shower with no issues.

Continue reading →

A sh HTTP Server, using Netcat

28 May 2023

This kind of thing should not be used in any serious production application. For a start, there is a risk of shell injection attacks.

But I would bet that multiple S&P 500 companies use something like this, somewhere deep in the bowels of their systems.

Continue reading →

Adventures in Forth/Stack Languages, part 1

26 May 2023

Over the last week I have been playing with a Forth-like language that I have implemented (separately) in JavaScript and C.

I have embedded the JavaScript version below, and both versions are available on Codeberg: https://codeberg.org/DanielRHolland/forth-style-stack-lang.

Continue reading →

Throwback Thursday: Haskell Game of Life

11 May 2023

Almost two years ago now, at a Mycs company party, I was chatting with some other devs when I confessed to having never implemented a "Game of Life". To remedy this, I wrote one in Haskell (iirc I actually started this at the party itself).

Continue reading →