Posts for James John

Fullstack web developer: Javascript, php, python.

Laravel Livewire – An Introduction

Ever thought of the possibility of writing reactive components in your application that has the capability of managing state, re-rendering as required and doing all the other interesting stuff, without writing any line of Javascript??Say hello to Laravel Livewire. Livewire, as described on https://laravel-livewire.com/, is a full-stack framework for Laravel that makes building dynamic front-ends […]

February 18, 2020 in Laravel & Tutorials

An Introduction to JavaScript Closures

Javascript provides the functionality of nested functions, returning a function, etc. These nested functions have access to the scope of its parent function.Consider the snippet below: function counter() { let value = 0; return function(incrementer) { value += incrementer; console.log(value) } } let myCount = counter(); myCount(4); // 4 myCount(4); // 8 In the above […]

January 28, 2020 in Code examples & Javascript

Learn SOLID Principles of Object-Oriented Design – Course

What you will learn In this series, we are going to understand what is known as SOLID principles of object-oriented design.  By the end of this series, you will be able to understand what the SOLID principles are. Why they are important.  How they will help you write good and maintainable code. Understanding the SOLID […]

December 24, 2019 in Courses

Applying SOLID principles to an existing application

This is the last part of the SOLID Series. We are going to refactor the CLI application built in the first part. To follow on with this part, you must have read the previous tutorials: Building a CLI application in Javascript. Understanding SOLID principles. Discovering Defects To refactor the CLI application, we need to first […]

December 24, 2019 in Javascript

SOLID Principles of Object-Oriented Design

There’s a bunch of principles in object-oriented programming. One of them and probably the most popular is SOLID. SOLID is an acronym for:Single Responsibility PrincipleOpen/Closed PrincipleLiskov Substitution PrincipleInterface Segregation PrincipleDependency Inversion Principle The SOLID principles were coined by Robert C Martin (Uncle Bob). Single Responsibility Principle This is a principle that attempts to provide a […]

December 24, 2019 in Javascript

An in-depth view of Higher-Order functions

Introduction As complex as it may seem, higher-order functions are functions that either accepts a function as an argument or returns a function or does both. This is possible because, in JavaScript, functions are first-class citizens — they are treated as variables and can be passed as arguments to other functions and returned by other […]

December 5, 2019 in Javascript & Tutorials

Operator (&& ||) short-circuiting in JavaScript

One handy feature of JavaScript and some other programming languages like Java is the concept of operator short-circuiting.So, what does the operator short-circuiting in JavaScript mean? To understand what operator short-circuiting mean, let’s see it in action: let online = true; let active = true; if(online) { if (active) { console.log(‘James’) } } Short-circuiting the […]

November 20, 2019 in Javascript & Tutorials

Different methods of copying objects in Javascript

In this article, you will learn different methods to copy an object in Javascript. It is no news that JavaScript —which happens to be my favorite programming language possesses some weirdness. One of which is the way objects are copied. Take a look the following code snippet: let name = ‘james’ let secondName = name; […]

November 7, 2019 in Javascript & Tutorials

Using Firebase Authentication in a Vue Application

In this tutorial, we are going to build a simple Vue application using Vue CLI and firebase authentication.But first, let’s get our system set up for Vue development. Install Vue CLI Vue CLI requires node.js version 8.9 and above. So ensure you have the right version of node.js installed. You can check your node.js version […]

October 29, 2019 in Tutorials & Vue