Hacktoberfest 2020: Code, Repo and T-shirt

Less than a month ago I started my path to the Hacktoberfest 2020! I was desperate to impress my friends. I wanted my first T-shirt as a developer! But first a step back before…

What is Hacktoberfest?
Hacktoberfest is a monthlong celebration of open source software run by DigitalOcean. It’s open to everyone.

What if I want to get my annual T-shirt?
You need to complete four requests via GitHub: when completing four pull requests, you will have the option to choose either a Hacktoberfest shirt in white or blue, OR the option to donate a tree. You will not have the option to choose both swag options.

What is Open Source?
Open source refers to source code that is publicly accessible and allows anyone to inspect, modify or learn from it. Open source projects encourage collaboration and the freedom to use the software for any purpose you wish.

Well, this year I took part in that journey (too late i think, my first pull request: 25 October 🤦‍♂️) and today I received an update:

Continue reading “Hacktoberfest 2020: Code, Repo and T-shirt”

Pass Props to Children in React

Anyone who is learning know that components are the main characters in React. It’s also true that thinking in components is a remarkable skill, maybe, sooner or later, i’ll try to write an article about that.

Let’s start from the beginning: what is a Component? A component is a special type in React (but also in Angular, Vue.js, …), a mix between JavaScript and HTML ‘n’ DOM. Imagine it as an atom, “the smallest matter in the universe” (but also not). If we combine more atoms we’ll get a molecule, an so on. Components let us split our app or website into reusable pieces. Conceptually they’re like JavaScript function, they’ll return a value and accept parameters, the latter are Props (propositions).

Continue reading “Pass Props to Children in React”

Regular Expression in Javascript

/^[A-Z]{6}\d{2}\D\d{2}\D\d{3}\D$/

1. What the hell is that?

Regular Expressions are as usefull as dangerous. If you are a programmer necessarily you will meet them. Over time, you’ll get better at it but they will remain too dangerous!

Sometimes the RegEx (or RE, technical term) may come in handy. But that doesn’t mean that we’ll use it at any time. Understand these and you will level up as programmer. As you undoubtedly realize, RegEx are not exclusive to the hottest language right now: Javascript.

But before figuring out RegEx, we must first understand why we need RegEx …

Continue reading “Regular Expression in Javascript”

Higher Order Functions in Javascript

const powerOf = (exponent) => {
   return num => num ** exponent;
}

1. If you can read this, then you’re able to understand the rest

Higher-order functions are functions that operate on other functions, for example, one of these can take functions as arguments or return another function. We can have three different types of these:

  1. Functions inside functions
  2. Functions that change functions
  3. Function that manage the control flow

Lucky for me, we have here an inner function example inside a mainly function (give a reading to closure). In this example, powerOf requires an ‘exponent‘ parameter and returns an anonymous function. The latter, accept a ‘num‘ parameter which will be multiplied by itself for ‘exponent‘ times (the ** operator was introduced by ECMAScript7).

Take a deep breath …

Continue reading “Higher Order Functions in Javascript”

Welcome!

hello world!
Hello world!

Ladies and gentlemen… it’s with great pleasure I welcome you all on this, the first post in the blog.

HowToReadCode.com, what is it?

It’s my journal as a developer. I put here some stuff about my milestones. With “how to read code”, I mean, how to read JavaScript , (included libraries!) and other web developer’s strange things.


the price of the knowlegde
Price of the knowledge …

I’m Italian and this is my first attempt to writing in English. It’s my attempt to growth in every way.

If you do not understand something, please, write me or use the comments below every post.

Thank you for being here. So, Stay Tuned and happy coding!