💻 Tech
It’s always better to use available functions like Equal()
to make comparisons as it’s more readable and less error-prone. This is because some data types, like Decimal in Go, can have different representations of the same value. For example, 1.0 and 1.00 are the same value but have different representations. Equal()
takes this into account while ==
doesn’t.
💪 Productivity
Whenever you’re stuck on a problem, it’s helpful to let it go for a moment, do some mundane tasks (or even your day-to-day tasks), and come back to it later. I don’t know what is this phenomenon called, but it works. I think that giving the brain some time helps make neural connections that help solve the problem.