Copy
Note: You are receiving this because you have signed up for Nordschool's weekly newsletter. Every Monday, we send out our "Better Code Monday" with 3 frontend coding tips from experienced developers.

Better Code Monday 09/12/19

Good day! 👋

Here are this week's three coding tips:

Tip #1 - Pure functions


Consider using pure functions when possible. A pure function is great because:
  • It doesn't change things outside of its scope.
  • Focus only on its scope, hence reduces the complexity.
  • More testable as it only depends on its inputs.
Example 👇🏽
Other examples of pure array functions:

Tip #2 - More productive peer-reviews 👩🏽‍💻


When working in a team. You should discuss the coding standards you would like to follow. Once the rules are defined, these must be followed & automated by linters, formatters, and tests.

Recommendation: Run the linters & tests before every commit. If something fails, the commit is aborted.This way, you ensure no rules are forgotten.

For this purpose, I found the npm package husky to be a useful tool. 

This way before the code is submitted for peer-review. All the common issues are already taken care of and you can have a productive peer-review session.

Tip #3 - In case you didn't know


In Javascript, besides the spread operator, you also have the "rest" operator. Here is how it looks like! 👇🏽
Note: Rest operators have to be at the last argument.

Testimonials


Have you found this newsletter any useful? Share your testimonial! 😊
If you know someone who might find this useful, sharing is appreciated! 👍🏼

That is it folks, wish you a good week & until next time! 👋

Ahmed

If you have been forwarded this email, you are welcome to subscribe here and you will receive next week's tips. 👌
Twitter
Website
Copyright © 2019 Nordschool, All rights reserved.


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Email Marketing Powered by Mailchimp