the blog.

TDD VS BDD ….. Which one is better?

Comparison between Test-Driven Development and Behavior-Driven Development You must have heard a lot about these two, TDD and BDD. But which software development process is the best? and how is it better than the other? The answer might surprise you, but do read on. What is TDD? Test Driven Development (TDD) is a process by which tests…

Read More

What Are Public, Protected and Private Methods in Ruby?

A public method is a method that is available to anyone who knows either the class name or the object’s name. In other words, a public method can be accessed from both inside and outside the class. Meanwhile, private and protected methods are not accessible from outside the class. The only way to access them is through a public…

Read More

ES6 – Class, Constructor, Super, Inheritance & Get/Set Stuffs!

ES6 is awesome. Why? It brings a new approach to code in Javascript. It has class and constructor so we can mimic OOP better. class Dog { constructor(name) { this._name = name; } get name() { return this._name; // returning a private variable _name } set name(newName) { let regex = new RegExp(‘^[a-zA-Z0-9.]*$’); if (regex.test(newName))…

Read More

What is “this” in Javascript?

What is “this” in Javascript – especially, when you use bind( ), arrow function and regular function?   this refers to its closest object. Maya, you’re not making any sense! Wait, let me explain.  If this is called in a global scope, then this refers to “window” object in a browser or “global” object in Node. function…

Read More

Functions in Javascript (Declaration, Expression, Arrow)

There are three ways of using functions and each has its own name, one is called “Function Declarations” and another is “Function Expressions”. The last one to be discussed is “Arrow Function”, which has the shortest syntax for a function. The Syntactical differences between them are like so : Function Declaration declared as a separate…

Read More

How To Use @font-face

Step #1 : Download the font Find the custom font that you want to add to your website and download it. The file extension should be either .ttf or .svg or .otf. Find fonts you can download for free at: fonts2u, fontpro Step #2 : Generate formats for cross-browsing Different browsers support different font formats, to…

Read More

How To Use Reduce( ) in Javascript

[10,1000].reduce( (finalValue, whatToAddToFinalValue) => finalValue + whatToAddToFinalValue ); The array has 2 items [10, 1000], which means we run 2 iterations. On each iteration, reduces() takes 1 item ONLY! For the FIRST iteration, since we did not declare the finalValue starting value, so it will always be 0 : We have whatToAddToFinalValue variable, which will…

Read More

For VS While Loop in Javascript

When we need to perform similar actions for certain number of times, that is when we get to “Looping”. For example, when we need to output goods from a list one after another. Or just run the same code for each number from 1 to 10. Loops are a way to repeat the same part…

Read More

Semicolons in Javascript – Where and when?

Semicolon ; is placed at the end of an object declaration, assignment and a return statement. Without a semicolon, the code will be considered “undone”. So a statement will not be a statement, an assignment will not assign anything, a declaration will not declare anything. but wait, read this and this too. What? You are still gonna…

Read More

Javascript (Var vs Let vs Const)

VAR Var is functioned-scoped and variables defined in the function CAN NOT be accessed from its outer function. But variables can be accessed from its inner function. Children-scoped variables can USE its parents variables. Parents can not use its children variables – because … well, yeah, children like to keep secrets 😀 Var is hoisted…

Read More

Deploying Your Vue + Express App on Heroku

This is the Heroku configuration I did for my Vue + ExpressJS app.   1.  First and foremost, make sure you have installed your Node, initialized NPM and Git in your project. 2. Create Heroku account. Afterwards, go to your Terminal and run : heroku login 3. Run the following command to create your Heroku app :…

Read More