Ask HN: What's your simple but favourite coding trick?
When I started programming, 5-6 months into it, I was introduced to a very interesting trick/pattern by one of my mentors.func(){ if() { } else { } }can be beautifully converted tofunc(){ if() { return; } // Write the else code here. }The reduced indentation gave a weird sense of relaxation. It was such a neat little trick.What about you guys. Any...