Programming first principles – 5. Premise – We must understand what we’re doing
This premise says that we must understand what we’re doing at all times. We can’t program by coincidence until we stumble upon something that works.
This premise says that we must understand what we’re doing at all times. We can’t program by coincidence until we stumble upon something that works.
Why do we test software? Why do we need proof that code works? It follows from our basic requirements of software.
Our first premise is that as human beings we can only remember so much. To work effectively we need to minimize the information we need to keep in mind.
When should you learn programming principles? Beginner, intermediate, advanced? Everyone benefits, but one group of people may benefit the most.
Why do we need programming principles? Programming principles are extremely helpful. They help us write better software that works and is easy to change.
There are a few gotchas, things that can catch us out, with `this` in JavaScript. It’s important to know about them and how to handle them.
Arrow functions are a way to avoid `this` binding. In my opinion this is one of the most important features of JavaScript, it makes things much easier.
New binding is what’s used when we use the ‘new’ operator. We examine what ‘new’ does as well as its precedence compared to other binding methods.
Implicit binding in JavaScript is probably the one we use most often. Let’s see how it works.
Video version of this article: https://youtu.be/CCuZmJhi_FA Posts in this series: Default binding Implicit binding (this post) Explicit binding New binding Arrow functions Gotchas and final