Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Zach.Stauffer
in reply to: JelteDeJong

I'd go with Snippet 3, because I personally prefer a more verbose style than something like Snippet 2. I like to have each "task" have it's own section in code. The main benefit is when I come back to it 6 months later, it's easier for me to tell what the code does.

 

Snippet 4 is good for beginners but as a general rule code should be understandable without comments, and I think #2 and #3 are fairly easy to understand. If I do put in comments I tend to put them at the end of a line of code, not before a block. That way I can avoid them if I don't need them, but they are there if I do.