3 ms·
When you grow older, and become lazier, you only create function/methods when they need to be called more than once. Some languages, like C# and JavaScript, als
by fjfaase 3y ago
When you grow older, and become lazier, you only create function/methods when they need to be called more than once. Some languages, like C# and JavaScript, also allow you to define them local (inside a method). When these are used to perform some checks, I usually just place them before they are used, and when the perform some operation, I usually place them just below where they are called. The latter usually involves async of parallel execution. I just realize that this helps to keep the code more linear. So, I think I have a strong preference for linear code.