Learning New Languages and/or Libraries

When I started to work on some Ruby on Rails projects almost 8 years ago, I knew zero about it. Instead of jumping head-first into learning the language (Ruby) and the framework (Rails), I started by learning how to write unit tests for it. That was the tiniest thing I could do to get my feet wet (passing tests give me that instant gratification we all crave for).

Learning how to write unit tests in whatever language should be relatively easy; if it’s not, I probably would not consider working in such language to begin with!

After learning the basics of writing tests, I can implement simple things in the language however I can, which back then, it meant I was “speaking Ruby with a C# accent”. That’s ok, because once I see my tests passing, I can poke someone who knows a lot more about the language than I do to teach me the better ways to both write the implementation, as well as the test.

I’ve documented my experiences back then on a two-part article (part 1 and part 2). While those posts are already over 7 years old, most of the ideas and approach I covered there still apply today.

More recently, as I started getting my feet wet on ReactJS, one of my first questions was: “how do I write tests for this thing?”.

I like to first learn how to write my tests using Given-When-Then. So, I’ve learned that if I use Jest to test React code (or even plain old Javascript, for that matter), this is how I can get started:

That gets the ball rolling for me…

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: