Practice Makes Perfect!

Practice Makes Perfect: Streamline Your JavaScript Learning Experience

Whether you are an experienced software developer or complete beginner looking to enter the coding world, planned, deliberate practice can greatly strengthen your skill set. Through consistent practice we can deepen our understanding of a language, develop new techniques and patterns, and explore new frameworks or libraries. So what exactly defines practice when it comes to coding?

Practice?

As a sports fan, I liken coding practice to that of it’s athletic counterpart. When an athlete practices they generally have two goals in mind; gain consistency through repetition and break current limitations by pushing previous boundaries. Likewise, when practicing coding you should both reinforce good habits and test the boundaries of your knowledge through language and framework exploration. While you learn plenty on the job and pick up reliable techniques through large projects, it is important to hone your skills beforehand and enter each ‘for pay’ project prepared for the task at hand. To keep with the athletic theme, I would break down the software development learning process into three distinct categories:

1.) Practice – Explorative Hacking, Coding Katas, Koans
2.) Scrimmage – Pet & Side Projects
3.) Game Time – Paid Development or Consulting

This trio makes up an incredibly strong criterion for skill advancement. For the remainder of this article, let’s focus on optimizing your time spent praticing, specifically the ‘explorative hacking’ aspect of the practice process.

Configure Your Practice Arena!
*This example will use WebStorm but most popular IDE’s can be configured in a similar manner.
When I am practicing I like to construct a quick test/feedback loop. This allows me to quickly iterate over concepts, knowing with certainty when I have grasped the task at hand. To do this, I lean on the JavaScript test-runner Karma and testing framework Jasmine. Through this method you are not only expanding your knowledge of the language or framework, you are also becoming more comfortable writing tests against your code. This will prove extremely useful when moving on to side or paid projects. To configure your WebStorm environment follow the steps below:

1.) Ensure Node.js is installed on your machine.
2.) Open WebStorm and create a new project.
3.) Install the Karma command line interface using NPM (Node Package Manager).

4.) Install Karma locally in your project.

5.) Generate a Karma initiation file in the root of your project.

6.) Define dependencies via the karma.conf.js file.

7.) Right click on your karma.conf.js file and select ‘Run karma.conf.js’.
Karma Run
8.) Start hacking and enjoy immediate feedback!
Karma results

An Example
Now that you have your IDE configured for practice, it’s time to start writing some code. The goal is to explore any gaps in your knowledge, whether small or big, and confirm your level of expertise through tests. Below is a basic example of how you might write and test your code for immediate feedback. Obviously, in larger scenarios you may want to move your practice code into separate files. Just make sure when doing so you remember to alter your Karma configuration to include these files.

Conclusion
A planned practice cycle can benefit even the most experienced developers. No matter how skilled or talented you are, there is always room to improve by positive habit reinforcement and pushing the fringes of our expertise. I hope my workflow can help inspire you to take your programming knowledge to the next level. Until next time, happy coding!

Next ArticleBuild a Hybrid Application with the Ionic Framework and Azure Mobile Services, Part 1: Configuring the Project