3rd week of 2021

Highlights of the week.

Table of contents

👨‍💼 Work

Q1 planning

Participated in our team's Q1 planning session and other lengthy meetings. O'boy how exhausted I now am.

I'm now an Agile Master*

Got assigned to Agile Master's role in our team. (Agile Master is like Scrum Master but cooler.) It happened so fast that I didn't have much time to think about it, but I'm actually looking forward to it.

*) Yeah, I'm immediately a master. No learning needed, right? 😇

👨‍🚀 Personal projects

Plausible Analytics

Signed up for a free 30-day trial of Plausible Analytics and added it to my site.

Plausible is simple, which is nice because I wouldn't utilize complex metrics anyway. Plausible is also lightweight (< 1 KB) and privacy-friendly. I really appreciate these qualities.

Now we'll just have to wait and see if I become too addicted to the metrics. (Haha, like anybody would accidentally find my site.)

Stack Overflow addiction

Wrote 14 new answers on Stack Overflow. Someone please explain why I become addicted to Stack Overflow when I'm very tired. (14 answers per week is a lot for me. Last year I wrote a total of 15 answers.)

👨‍🎓 Learnings

JavaScript: "Illegal invocation" errors

"Illegal invocation" errors in JavaScript are thrown when the context of a function is lost, i.e. when the function's this keyword isn't referring to where it should.

Some context (pun intended): I tried to destructure the abort method from an AbortController, but all I got was the error:

const abortController = new AbortController()
const { abort } = abortController

// In another file:

//=> TypeError: Illegal invocation

// Now `this` refers to `abortController` again,
// so everything's ok

This seems like a basic concept, but somehow the error message didn't ring any bells when I encountered it this week.

Firefox seems to produce a much more descriptive error:

TypeError: 'abort' called on an object that does not implement interface AbortController.

So does iOS Safari:

TypeError: Can only call AbortController.abort on instances of AbortController

JavaScript: Date() is bad at parsing date strings

From Date() constructor on MDN:

Parsing of date strings with the Date constructor (and Date.parse(), which works the same way) is strongly discouraged due to browser differences and inconsistencies.

I thought that one could be quite lax about what they provide for the Date() constructor, but that's not the case. When writing an answer to a date-related question on Stack Overflow, I noticed that the date string "2021-01-10 12:47:29 UTC" results in "Invalid Date" on Firefox and iOS Safari:

new Date('2021-01-10 12:47:29 UTC')
//=> Chrome: Sun Jan 10 2021 14:47:29 GMT+0200 (Eastern European Standard Time)
// Firefox: Invalid Date
// iOS Safari: Invalid Date

Compare with the standard string representation of a date time string:

new Date('2021-01-10T12:47:29.000Z') // Z = UTC
//=> Chrome: Sun Jan 10 2021 14:47:29 GMT+0200 (Eastern European Standard Time)
// Firefox: Sun Jan 10 2021 14:47:29 GMT+0200 (Eastern European Standard Time)
// iOS Safari: Sun Jan 10 2021 14:47:29 GMT+0200 (EET)

Pug: dynamic tag names

You can use interpolations in Pug to have dynamic tag names:

- const tag = 'article'


// Output:
<article class="foo"></article>
<article class="foo bar"></article>
<article class="bar"></article>

🕵️‍♂️ Cool stuff

Two types of skills and two types of learning

Mike Crittenden has written about two types of skills and two types of learning in his blog post Learning a technology you don't need right now is a waste of time. TL;DR:

  • Two types of skills:
    • Expiring skills: hard skills, e.g. TypeScript, React, Kubernetes
    • Permanent skills: soft skills, e.g. attitude, discipline, charisma
  • Two types of learning:
    • Just-in-time: learn when you need the skill/knowledge
    • Just-in-case: learn in case you need the skill/knowledge in the future
  • Hard skills expire, so learning them just-in-case is a waste of time
  • Soft skills are permanent and compound over time, so learning them just-in-case is wise

Riot.js: Looks like Vue.js, but simpler

Riot.js looks like a nice alternative to Vue. I like that it's more minimal, more vanilla and more lightweight than Vue.

For a quick comparison of the two, I can recommend the article Vue vs. Riot: Both are Winners! by Jordan Brennan.

Speaking of Jordan Brennan, he's the author of my all-time favorite React-related quote:

React's ecosystem is not a benefit. It's a dumb necessity grown from the need to create more stuff, much of it being React-only versions of existing stuff, because React is so incompatible and fussy.

Yes, I'm tired. But I also agree!

💁‍♂️ More Weekly log entries

Next week: 4th week of 2021

Previous week: 2nd week of 2021