Category: Golang
-
[Go] How to deal with sort and heap (2)
1. Quick Recap In the previous post, we explored the concept of interfaces and how the sort package utilizes them. Understanding the abstract role that interfaces play, independent of specific implementations, was crucial. This abstraction allowed us to work with various types by tying them to the same interface, enabling them to be passed as…
-
[Go] How to deal with sort and heap (1)
1. Understanding Interface 1-a. What is an interface Before we take a look at sort and heap packages, we have to understand what Interface is and how it works. We use Interface to maintain flexible code. Instead of relying on concrete implementations, interfaces allow you to work with abstract method sets, enabling you to apply…
-
[Go] what is a time in go
Time is an agreement We often take time for granted, considering it as omnipresent and essential as air. Yet, when it comes to programming, handling time can be surprisingly complex. The Go programming language provides a robust time package to manage these complexities efficiently. Let’s take a simple look at the ‘Time’ struct. The wall…
-
[Javascript] Closure
What is a Closure? In simple terms, an inner function captures the context of the outer function. But, what is a context? The context refers to the environment in which a function is declared. This environment includes any variables, parameters, and functions that are within the scope of the function when it is defined. When…