I don’t talk about it often, but I really enjoy teaching.
A few kind words on an article I’ve written or a video I’ve made will sit with me for long after the comment was posted. Once a week, I volunteer as an English teacher and it warms my heart whenever a student uses a new word they had been taught the previous week.
2020 was a tough year and 2021 — so far — appears to be no different. To try and add some positivity into the world, I wanted to figure out what I could do to help more people in 2021. …
As Editor of one of the most popular tech publications in the world, some of the questions I get asked a lot are: “what should I write about”, and “how can I write something that people will like?” Well, whether you’re here because you want answers to those questions, or you’re simply here to read some interesting things, here are the most popular articles on JavaScript In Plain English for 2020.
The following articles have been listed in order of number of claps received. This means that there may be a different order based on number of views, although claps generally are a good barometer of how popular an article is/how well it has performed. …
One of the easiest ways to debug anything in JavaScript is by logging stuff using console.log
. But there are a lot of other methods provided by the console that can help you debug better and smarter.
Let’s get started!
Let’s imagine we have a variable called name
and we want to log it in the console. Often we find ourselves writing this:
console.log('name', name)
Since ES2015, we can use object shorthand notation whenever we want to log out things like this. That means we can write the following:
console.log({name})
And this will output the same thing.
Imagine a scenario when you have a bunch of objects you need to log into the console. …
Understanding how objects and arrays work through the lens of Big O is an important thing to know, as it should influence the choices you make when structuring data in your apps.
Along with this, is it just as useful to know when you should be using an Object and when you should be using an Array.
Searching is O(N) because here we are searching for a value in the object, rather than searching for a key. …
For programmers — especially self-taught programmers — our first introduction to the world of ‘recursion’ is often in the form of something math-related. It’s not uncommon for programmers to intrinsically call upon some of our favourite F words when we think of recursion — no not that F word, these ones:
Fibonacci
function fibonacci(position) {
if (position < 3) return 1;
return fibonacci(position - 1) + fibonacci(position - 2);
}
Factorial
function factorial(num) {
if (num === 1) return num;
return num * factorial(num - 1);
}
Recursive versions of the fibonacci and factorial functions are some of the more beautiful pieces of code you can expect to see. These concise slices of code rely on little more than themselves to get the job done. They embody the very definition of recursion — a function that calls itself (the calling of itself is the part that is recursive). It’s really no wonder that just like when a tutorial incorporates a new topic by demonstrating how it interacts with something trivial, like a counter or a ‘to do’ list, fibonacci and factorial functions encapsulate the topic of recursion with little to zero interference from the external complexities you might find as soon as you start introducing other bits of code to interact with. Just like the counter and the ‘to do’ list, fibonacci and factorial are trivial. …
Starter Pack unifies all the other CLI tools. Forget having to install/remember/google lots of different commands, access them all through Starter Pack!
This also means you don’t have to worry about always keeping the various CLI tools you use up to date because Starter Pack will take care of it for you. Keep Starter Pack up to date and all your other CLI tools will be as well!
Everyone! We have created a tool that is (hopefully) accessible to developers of all skill levels.
This is an understandable concern. …
Fun Fun Function: Now defunct. Its creator, MPJ, took his excellent Quora question-answering abilities and translated that into a YouTube channel that currently has around 250k subscribers. Don’t let its defunct-ness stop you from checking this channel out, as there’s about 5 years worth of content on there for you to trawl through.
When he explains a concept, he explains it deeply. For example, MPJ has a video series on the concept of Testing, which is about 100 minutes long, spread across 7 videos. He doesn’t just show people how to write tests (which is what most tutorials miss the point of explaining such concepts by doing), but rather explains why we should write tests, what methodologies we can use, the pros and cons of each, along with writing the most basic of tests and then adding in complexity, step-by-step. …
The process of collecting information from a website (or websites) is often referred to as either web scraping or web crawling. Web scraping is the process of scanning a webpage/website and extracting information out of it, whereas web crawling is the process of iteratively finding and fetching web links starting from a URL or list of URLs.
While there are differences between the two, you might have heard the two words used interchangeably. Although this article will be a guide on how to scrape information, the lessons learned here can very easily be used for the purposes of ‘crawling’.
Hopefully I don’t need to spend much time talking about why we would look to scrape data from an online resource, but quite simply, if there is data you want to collect from an online resource, scraping is how we would go about it. And if you would prefer to avoid the rigour of going through each page of a website manually, we now have tools that can automate the process. …
Besides being a great tool for maintaining code, GitHub can also be a tool for learning and growth. As a Software Developer, I am always on the lookout for useful GitHub repos that I can learn and find inspiration from. Here are 10 of my favourite.
GitHub stars: 80.2k
This is a fantastic resource for anyone who is looking to build something and is after some guidance on exactly how to approach it. You can also just find lots of really interesting stuff by browsing through the list.
GitHub stars 79.8k
One of the differences between a Software Engineer and a Software Developer is that the Engineer is more likely to have a good grasp of algorithms and data structures. But whatever your background, this repo provides a thorough list of many different algorithms, data structures and answers to many typical questions you might expect to come across in a Software Engineering interview. …
A few years ago, I decided to try and build a fairly standard To Do App in React and Vue. Both apps were built using the default CLIs (create-react-app for React, and vue-cli for Vue). My aim was to write something that was unbiased and simply provided a snapshot of how you would perform certain tasks with both technologies.
When React Hooks were released, I followed up the original article with a ‘2019 Edition’ which replaced the use of Class Components with Functional Hooks. …