thepracticaldev.com thepracticaldev.com

2 JavaScript memory concerns for React developers

React provides a superb developer experience: you define states and props, combine components in a way you want — and everything magically updates yet stays consistent. But... What memory effects hide beneath this nice-looking code? Let's see! 1. Class members: functions vs arrow functions Here are two very similar classes. What's the difference? class A { x() { console.log('Hi!') } } class B { y = () =>...

codingnest.com codingnest.com

The Little Things: everyday efficiencies

At some point, we have all heard a quote attributed to Donald Knuth, saying that: Premature optimization is the root of all evil There have been many fights over whether this applies, when is an optimization premature, and so on. This post is not meant to participate in these fights[1], but I do want to quote Donald Knuth in full before continuing: Programmers waste enormous amounts of time thinking about, or worrying about, the...