Object references and copying
One of the fundamental differences of objects versus primitives is that objects are stored and copied “by reference”, whereas primitive values: strings, numbers, booleans, etc – are always copied “as a whole value”. That’s easy to understand if we look a bit under the hood of what happens when we copy a value. Let’s start…
![Introducing constructors](https://engineering.01cloud.com/wp-content/uploads/2023/04/programming-background-with-person-working-with-codes-computer-900x600.jpg)
Introducing constructors
If we need to create multiple object of same shape then one of the way to define the shape of is by using the function. we have to create an empty object, initialize it, and return it. A better way is to use a constructor. A constructor is just a function called using the new keyword. When…
Scheduling: setTimeout and setInterval
We may decide to execute a function not right now, but at a certain time later. That’s called “scheduling a call”. There are two methods for it: These methods are not a part of JavaScript specification. But most environments have the internal scheduler and provide these methods. In particular, they are supported in all browsers…
![Utility Types in TypeScript](https://engineering.01cloud.com/wp-content/uploads/2023/04/typescript-900x600.jpg)
Utility Types in TypeScript
What are utility Types? In TypeScript, utility types are built-in types that allow you to manipulate and transform existing types. They can be used to extract, exclude, or modify the properties of an existing type, or to create a new type based on an existing one. TypeScript provides several utility types to facilitate common type…
![Using defer inside a loop](https://engineering.01cloud.com/wp-content/uploads/2023/04/defer-1-900x600.png)
Using defer inside a loop
The defer keyword allows a function call to be postponed until the surrounding function has completed execution. This can be useful for reducing redundancy in code, such as when a resource needs to be closed after use. However, it’s important to be mindful of using defer within a loop, as it can have unintended consequences…
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](https://engineering.01cloud.com/wp-content/uploads/2023/04/javascript-1-900x600.jpg)
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](https://engineering.01cloud.com/wp-content/uploads/2023/04/golang-900x600.jpg)
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](https://engineering.01cloud.com/wp-content/uploads/2023/04/react-900x600.jpg)
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…
Not properly checking if a slice is empty
In the previous blog post we discussed about distinction between nil and empty slices. We have to clear about some notation, what is the idiomatic way to check if a slice contains elements? Not having clear answer can lead to subtle bugs. Let’s talk about the example, we call a getAmounts() function which returns a slice…
![External Logging Feature in 01Cloud](https://engineering.01cloud.com/wp-content/uploads/2023/04/icloud-900x600.jpg)
External Logging Feature in 01Cloud
An External Logging feature is a feature that is used to collect and store log data from various sources, such as servers, applications, and devices. Logging are typically designed to be deployed in a container orchestration platform such as Kubernetes and to work in concert with other tools such as log shippers, log aggregators, and…
![External Secret Feature in 01Cloud](https://engineering.01cloud.com/wp-content/uploads/2023/04/icloud-900x600.jpg)
External Secret Feature in 01Cloud
In today’s world, managing sensitive information, such as database credentials, is a critical task for any organization. In a Kubernetes-based environment, secrets are used to store and manage such sensitive information. However, in some cases, it may be desirable to store these secrets outside of the cluster, in an external secrets manager, such as AWS…