r/programming

Reddit Programming is one of the Reddits that I read almost every day (the others: Vancouver, TIL, and Shower Thoughts). I really like this post from today:

Software Essays

Two of these resonated:

1. How screwed would I be if my house were to burn to the ground with everything I own in it? This is about things like passwords and MFA's, not dogs and kids. I would be 100% OK with passwords because I have those backed up to the cloud (with client-side encryption, duh), but my only MFA backup is my iPad, which presumably I also lost.

I am pretty sure I could get access to my bank accounts without MFA by going to a branch, but, if all my ID had been torched, that would be a process, for sure.

I might have big trouble with things like AWS and Github, though.

2. This is nerdy but the second essay in there is, basically, saying that you should use purpose-specific types for everything. This is assuming a statically typed language which, IMO, only a sane person would not use, at least in the context of large systems with multiple people working on them.

The essence of the idea is: instead of passing around Strings and int's, pass around things like UserId's and OrderQuantities. By doing so, and crafting constructors properly, you can statically guarantee that a UserId is always a valid user, or an OrderQuantity is a positive number, or whatever. Thus the compiler will catch a whole class of errors that it otherwise would not.

This sounds like a great idea to me.

Comments

Popular posts from this blog

Change of Venue

Arrived

Haida Gwaii Part 2