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 27/01/20

Good day/evening! 👋

Here are this week's three coding tips:

Tip #1 - Prevent bad commits 🈵

Husky is a nice package that can prevent bad git commit, git push, and more 🐶 woof!

How it looks like 👇🏽
We would recommend running tests & linters on commit/push.

Tip #2 - Services at your service

Working on a frontend that follows a component-based architecture? You will run into the following scenario:

"I need to re-use some functions across many components."

Depending on the framework/library used there will be ways to handle this. Here is one way we found helpful when working with React. The idea is to group related functions together in a "services" file. 

Services are regular files with functions that can share functionality across many components.

P.S: Services are not the only way to share code across components. There are other options such as hooks. As always, check your specific case before sticking to a solution.

Example 👇🏽
Here is a service to share pizza-related functions across components.
And the architecture would look like this

Tip #3 - Empathetic documentation

To make sure everyone benefits from your documentation. Try not to make too many assumptions.

Here are some questions that we found helpful when asking documentation:
  • Am I assuming a certain seniority level?
  • Am I using much technical jargon?
  • Am I assuming how easy/difficult is something? e.g. Simply deploy the app
  • Am I assuming a specific gender/race?
  • Am I using a spell-checker?
Writing documentation is in many ways like writing normal articles/posts/books.

Documentation here refers to any technical documentation. It can be anything from code-level comments to high-level technical guides.

Share your tips

Have a tip that you would like to share with our community? Tweet it to @nordschool and we will include it in one of the future newsletter issues! 👌🏽

Freelancing in Finland?

Sam wrote an amazing open-source guide about how to start freelancing in Finland. For an intro check out the twitter thread.
If you know someone who might find this useful, sharing is appreciated! 👍🏼

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


If you have been forwarded this email, you are welcome to subscribe here and you will receive next week's tips. 👌
Copyright © 2020 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