Closed DmitrySharabin closed 5 months ago
I would also avoid the indirection of separate functions for code that is only called once.
My rule of thumb for separating code into a function is:
- Does it get called multiple times?
- Is it long and convoluted to the point that if inlined it's making it harder to understand the code?
- Is it more generally useful, and could be used in other places in the future?
If the answer to all three is "no", then usually a separate function reduces readability instead of improving it.
That makes perfect sense. Thank you for sharing your techniques with me! 🙏 I fixed that part of the code.
I would also avoid the indirection of separate functions for code that is only called once. My rule of thumb for separating code into a function is:
- Does it get called multiple times?
- Is it long and convoluted to the point that if inlined it's making it harder to understand the code?
- Is it more generally useful, and could be used in other places in the future?
If the answer to all three is "no", then usually a separate function reduces readability instead of improving it.
That makes perfect sense. Thank you for sharing your techniques with me! 🙏 I fixed that part of the code.
fromSelects()
is still there.
fromSelects()
is still there.
I'm an idiot. 🤦♂️ I'm sorry. Fixed.
✅ Deploy Preview for color-elements ready!
Toggle QR Code...
Use your smartphone camera to open QR code link.
To edit notification comments on pull requests, go to your Netlify site configuration.