Improve Your JavaScript Learning with Fun Experiments

This will show you how small experiments can be a fun and effective way to learn new things, and to ensure that learning and keeping up-to-date stays fun.

Keeping Experiments Fun

More from this author

Do you do side projects? If you do, I’m sure you did a project once that was a lot of fun at first, but quickly turned into a tangled mess. Getting bogged down in something isn’t a lot of fun and can really damage motivation for both side projects, as well as your job. Major causes of this are often scope creep or pressure, while you should be relaxing in your spare time. By enforcing some rules, we can make sure we don’t bump into unpleasant surprises:

  1. Prepare your work. Make sure you know exactly how big an experiment is and what it encompasses. If it is too much, split it up into manageable chunks that each have a beginning and end, or pull the plug.
  2. Schedule tasks. Don’t stay up late every night. Just schedule an hour or two, once or twice a week.
  3. No deadlines. Everyone, you included, needs to relax. Setting targets is okay, and missing them should be too.
  4. Allow yourself some fun time. Although you shouldn’t procrastinate, life is more than a bunch of checks on a to-do list. Take time to enjoy the fruits of your labors.

Having small experiments doesn’t mean they can’t be part of something bigger. Take a data visualization project, for example. It can take up some time, but is easy to split up into smaller tasks:

I use a Trello board to keep track of all my experiments. It’s where I list and plan them, and add relevant information until the time comes to start an experiment. For larger projects, I tend to create a new board specifically for that project and add cards for each task. Any alternative will suffice. Documenting things keeps the noise out of my head!

Reviewing the Experiment

Besides learning by actually doing new stuff, experiments are also a great opportunity to improve yourself. Look back at your experiment and ask yourself the following questions:

  1. Could problems during execution have been avoided with better preparation? If yes, how?
  2. What was the quality of the executed work, and what can I do to improve?
  3. Could I have prepared my experiment more effectively?

Reviewing and improving what we do gives us experience — something which is very valuable in our industry. Communication and documenting is, too. Many experiment reviews make great blog posts.

Although not very JavaScript related, one particularly fun experiment of mine was creating Vector Graphics in Sass, where I converted a map of coordinates into a path and rasterized it into a single-pixel box-shadow. Not only did I learn Sass functionality I wasn’t too familiar with before, I also had to research some algorithms.

Finding Inspiration

If you’re not sure what to learn next, it’s always good to have a few resources at hand for inspiration.

If you enjoy visuals and art, CodePen is a great place to start. The picks are often full of amazing pens worth pulling apart to see how they work. If you’re feeling more adventurous, try Dribbble or Behance.

SitePoint is powered by many authors from diverse backgrounds. Because of that, the JavaScript Channel is full of all kinds of JavaScript goodness.

Runtime Environments

You probably already knew that JavaScript works in browsers, but did you know you can run JavaScript outside of browsers too?

Browser APIs

Over the past few years, many new APIs have been introduced to the browser allowing you to do all sorts of fun things.

Some APIs allows us to use device hardware, to do things like reading out sensors or making the device do things (such as vibrate).

Libraries and Frameworks

The purpose of most libraries to get things done easily, so it never hurts to have some experience using them. The more popular libraries and frameworks (such as Angular and React) can even be required for a job. An experiment or two can also be a great way to prepare yourself for an interview.

Know that libraries and frameworks only last so long. Although they are helpful, you should be able to understand the problems they solve and be able to solve those problems without them.

Architecture

Visual

The Physical World

Personally, I get really excited when I can write software to do something in the physical world. If you do too, consider purchasing a set of any the following:

All of the above can be programmed with, or is capable of running JavaScript.

Conclusion

Small experiments are a great hands-on approach to learn new things. Another benefit is that they can help you improve the way you work, something that is most valuable in our industry. By enforcing a few rules we can keep experiments fun, motivating yourself to learn more and become better.

For those of you stuck in a rut, I hope this article has provided you with some motivation to start a new, fun experiment. For those of you unsure what to tackle next, I hope this article has provided you with some inspiration. Or maybe you have some great ideas for experiments? Or maybe I missed something out? Either way, I’d really love to hear from you in the comments below.