2nd week of 2021

Highlights of the week.

Table of contents

πŸ‘¨β€πŸ’Ό Work

New microphone

I bought a new microphone: RØDE Procaster + a bunch of accessories.

I have previously used Jabra Evolve 65 headset. I always thought it has quite good audio quality – and it kind of has; everything is relative.

But then I compared my voice recorded with the Jabra to my brother's voice recorded with a decent condenser microphone. The difference in audio quality was immense. No way I'm going back to the Jabra (unless I need portability).

I have worked mostly remotely for the past few years and plan to continue working remotely, so having high quality audio equipment benefits my colleagues as well.

Refactoring React code

Had fun refactoring a React component to use useReducer() instead of multiple useState()s, and then refactoring it back to use multiple useState()s. Sometimes it takes a few iterations until a good solution is found, right?

πŸ‘¨β€πŸš€ Personal projects

Advent of Code 2015

Published a couple of solutions to Advent of Code 2015 puzzles that I had done in December but hadn't published yet. More to come next week.

Content calendar

Created a quick and dirty content calendar for myself to better keep track of my scheduled blog posts and cookbook recipes. I'll see how this works out and will probably write a blog post about this some day.

πŸ‘¨β€πŸŽ“ Learnings

Different kinds of microphones

When deciding what microphone to buy, I watched some videos.

XLR vs USB

From Podcastage's video XLR vs USB Microphones, Which Should You Buy?, I learned that:

  • USB microphones are easy to use
  • XLR microphones offer better audio quality and more choices.

Thus, I opted for an XLR microphone. There's no such thing as overkill when it comes to audio stuff, right?

Dynamic vs condenser

From Podcastage's video Dynamic vs Condenser Microphones, What's the Difference?, I learned that:

  • condenser microphones are more sensitive so they pick up more background noises, like the sound of the keyboard, air conditioner etc.
  • dynamic microphones are better at suppressing background noises at the cost of reduced audio quality.

In my case, I'm sure no one (including me) would notice the difference in audio quality between a dynamic and a condenser microphone. But background noises are always annoying, so I opted for a dynamic microphone.

Calculating week numbers is complex

Calculating the week number of a date in JavaScript is surprisingly complex. Though that might be because week numbering itself seems complicated, and JavaScript doesn't provide a native way to get the week number of a date.

In the end, I ended up using the getWeek() function from date-fns. This piece from its implementation on GitHub is amusing:

// Round the number of days to the nearest integer
// because the number of milliseconds in a week is not constant
// (e.g. it's different in the week of the daylight saving time clock shift)
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1

I'm glad I haven't had to deal with date stuff much in the past.

πŸ•΅οΈβ€β™‚οΈ Cool stuff

Lefthook: "The fastest polyglot Git hooks manager out there"

Lefthook seems like a better alternative to Husky or Husky + lint-staged.

I found this via Stefan Judis's web dev newsletter.

The Locality of Behavior principle

Locality of Behavior (LoB) is a nice name for a nice principle. It states that the behavior of code should be obvious on inspection. Check the linked article for a good example – it's a great article.

I think that the LoB principle explains, at least partly, why I feel productive and happy when using Tailwind. For example, when using it with React, a single component file can contain everything relevant about the component: the HTML structure (JSX), logic (hooks etc.) and stylings (Tailwind classes among the JSX). There's no need to jump between HTML, JS and CSS files. I have heard that e.g. Vue provides a similarly pleasant experience.

πŸ’β€β™‚οΈ More Weekly log entries

Next week: 3rd week of 2021

Previous week: 1st week of 2021