Note to future Lara: Read code before you write code during research & development

A lesson learned during research and development for a new project at work.

I am having an enjoyable few days this week of doing research and development in preparation for a new project. The R&D is oriented around creating a “Choose Your Own Adventure” block in Gutenberg. Chances are slim that there will be a ready-to-use block by the end of today, but I want to make a specific note about a lesson learned during this R&D process.

It is exciting to jump into a new thing and start writing code, trusting you will “just figure it out”, especially if you have a bit of prior experience with the thing. Some of that is good. I heard somewhere that our brains grow when we make mistakes, and the “just figure it out” approach definitely means making a lot of mistakes.

But…after a certain amount of mistake making and forcing new things to fit into an existing mental model, “just figure it out” is no longer enjoyable nor a good use of time.

Official note to future Lara:

Spend some time (one hour?) reading code before you write code in the context of a new project or research (obv. this would be a major time suck if I always had to read code for one hour before writing any code). Because it is IMMENSELY HELPFUL (OMG SO HELPFUL) to read the working code of others before you start writing your own code.

I know…shocking! Like, yay open source! All of the answers are out there!

This is the second time I have learned this lesson. Maybe canonicalizing* it as a public blog post will help it stick.

* 30 minutes later: I was microwaving leftovers just now and thought, “wtf does canonicalize mean and did I completely make up that word?” I did not make it up. Canonicalize is means “to convert data into a canonical form”. A canon is “a rule or law in general”. So canonical form means a form according to a rule or law, and canonicalization is actually a process in computer science that refers to standardizing data that has several representations into a single form. I didn’t use it intentionally like that, but it kinda works as a metaphor here! Words are cool.