Tag Code

9 posts found

Lessons from Refactoring an Old Project

JULY 15, 2020  ·  1014 WORDS

About four years ago, I started working on a simple project — a Messenger bot that 'recommends' movies. I called it 'moviebot'. It was written in JavaScript (node) and hosted on Heroku. At the time, Messenger bots seemed like an interesting avenue to explore and I was simply following a [...]

PersonalRefactorCode

Caching API with Redis and Node

FEBRUARY 28, 2020  ·  745 WORDS

More often than not, your backend server needs to talk to downstream services, third party APIs and the database. These calls are expensive both in terms of time and money. Consider for example, your API fetches popular movies from a movie API which charges you based on each call you [...]

TutorialCode

Defining Functions in Javascript

SEPTEMBER 03, 2019  ·  1013 WORDS

Generally, a function is a sequence of instructions or a 'subprogram' that can be invoked by the code that is external (or internal) to that function. In essence, functions 'encapsulate' a particular task. Functions are one of the fundamental building blocks in JavaScript and really understanding functions can help tackle [...]

FrontendJavascriptCode

Dark Mode in React using SCSS

MAY 20, 2019  ·  312 WORDS

In this article I have tried to explain my method of adding dark mode to a react app created using and SCSS. This is my method and by no means do I claim it to be the best possible way of adding dark-mode to your react app. The end goal is to [...]

TutorialCode

How to use the Javascript Console

APRIL 17, 2019  ·  515 WORDS

One of the easiest ways to debug anything in JavaScript is by logging stuff using . But there are a lot of other methods provided by the console that can help you debug better. Let’s get started. The very basic use case is to log a string or a bunch of JavaScript [...]

FrontendDebugCode

Parameters & Arguments in Javascript

AUGUST 23, 2017  ·  552 WORDS

Javascript is a functional language meaning that functions are the primary modular units of execution. Functions are obviously very important in Javascript. When talking about functions, the terms parameters and arguments are often interchangeably used as if it were one and the same thing but there is a very subtle difference. Parameters a [...]

FrontendCodeJavascript

Generators in Javascript

AUGUST 16, 2017  ·  828 WORDS

Generators are a cutting edge addition to ES6 JavaScript. Async code is harder to manage with JavaScript’s single threaded execution model and Generators and Promises are welcome inclusions in the JS arsenal. Let’s explore Generators in detail in this article. Generators Generators are special types of functions in the sense that unlike [...]

FrontendCodeJavascript

Declaring Variables in ES6 Javascript

AUGUST 06, 2017  ·  532 WORDS

Before ES6, was the only keyword used to declare variables in JavaScript. Unlike other languages like C, variables do not need to use different keywords based on their type. For example in C, integers undergo a different treatment as compared to strings but in JS we don’t need to specify the type [...]

FrontendJavascriptCode

Hoisting in Javascript

AUGUST 01, 2017  ·  850 WORDS

The term Hoisting is used in a lot of JavaScript blogs to explain identifier resolution. Using the literal meaning of the word as a metaphor, hoisting is employed to explain how Variables and Function declarations are ‘lifted’ to the top of a function or a global scope. While this does provide a basic [...]

FrontendJavascriptCode