Engineering Blog

                            

PROGRAMMING

Ignoring how defer arguments are evaluated

In order to understand how arguments are processed using the defer keyword, let’s consider a specific example. Suppose we have a function that needs to execute two other functions, called foo and bar. Additionally, this function needs to handle some status information related to its execution. We can use the defer keyword to ensure that…

Misunderstanding variable scope in JavaScript

Misunderstanding variable scope in JavaScript

In this post, we are going to understand variable scope and difference between var, let and const keywords in javascript. Variable scope is tricky concept for new developers., especially in javascript. Most of beginner developers make common mistake like defining the variable inside the function and expecting it to access outside the function. Understanding var,…

Using index as a key in React (anti-pattern)

What are lists in React ? Lists are used to display data which are similar in ordered format . Often they have same type i.e an array of similar kind of data rendered into a list tag using some version of for loop. How does react render lists? DOM Before we learn how react renders lists…

Being confused about nil vs. empty slice

Being confused about nil vs. empty slice

Go developers fairly frequently mix nil and empty slices. In this blog post discusses how they are differ and when to use each one. Slices are one of the most widely used data types in Go. It provides a way for to work with ad manage collections of data, and can be appended to or…

Mixing up concurrency and parallelism

Even after years of concurrent programming, developers may not clearly understand the differences Developers who have been working with concurrent programming for a long time may still not fully grasp the distinctions between concurrency and parallelism. Therefore, before discussing specific topics related to Go programming, it is important to first understand these concepts and establish…

Thinking concurrency is always faster

Many developers mistakenly believe that a concurrent solution will always be faster than a sequential one, but this is not always the case. The performance of a solution depends on various factors, such as the efficiency of the concurrency structure, the parts that can be processed in parallel, and the level of contention among the…

Function in JavaScript

Function in JavaScript

A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output. We can separate function in…

Stripe Payment with Golang

Stripe Payment with Golang

In this blog post, I will discussed on the topic of stripe payment integration with Golang. Before that i will give brief introduction about this and move head to simple implementation. It is a famous payment gateway that helps in financial transaction between merchants and customers. It accepts 133+ countries currency. It is a powerful…

Common Anti-patterns with React

Common Anti-patterns with React

Nested components When a component is defined inside another component, it creates a tight coupling between the two components, meaning that they are highly dependent on one another. This can make it difficult to reuse or re purpose the inner component. Also when the parent component re-renders , the inner component will be defined again…

Being puzzled about when to use channels or mutexes

Given a concurrency problem, it may not always be clear whether we can implement a solution using channels or mutexes. Because Go promotes sharing memory by communication, one mistake could be to always force the use of channels, regardless of the use case. However, we should see the two options as complementary. This section clarifies…