Good Programming Practices talk

inspired by this thread ( and especially by @Markus Winter comment , i propose you to write here best programming practices. then, based on this conversation, we could make a wiki page, a github page or something else with a summary of the material here exposed. the final wiki page could have categories, like “UI design”, “speed”, “security” or something else
maybe is a bad idea, I would like to hear your thoughts

I thought of something like this myself, so I’m glad you come up with it. And while I see myself more as a beginner in this matter (so I cannot contribute much), I’m even more interested in what experienced programmers will share…

in this forum you can find a lot of experienced programmers. every month i learn a lot just reading this forum threads. in fact, i think this is one of the best forum about programming on internet

here is a good practice about dates–> written by @Geoff Perlman

best practice about working environment at home–> written by @Alyssa Foley

RaiseEvent best practice–> by @Norman Palardy

app localization–> by @Dana Brown
also this post–> by @Paul Lefebvre

doing a password loggin the right way–> by @Paul Lefebvre
good practice to reset password --> by @Albin Kiland

working with files: FolderItem --> by @Javier Menéndez
recursively delete a folder --> by @William Yu

avoid sql injection --> by @Paul Lefebvre

helps or tools to speed up and/or encourage good practices on database development by @Phillip Zedalis

coding guidelines --> by @Paul Lefebvre

bear in mind, that all the links you shared, and any links or information others may share in the future…
illustrate ONE way to do a particular thing… They may or may not be “Best Practices” and you should never assume as much.

Take the information you gather from this forum, and do what works for you…

Ask 10 developers what the best way to do something is, and you will get 13 answers

Don’t forget Goto :stuck_out_tongue:

I second what Dave said. A company/team will use coding standards just to keep it all working together and not let every programmer do it his way. But when you get to decide - make it what works best for YOU.

Thought I would add an example. The Xojo coding guidelines says you should Dim variables close to where they are used. I won’t debate the ‘correctness’ of this but I always but ALL the Dims at the top of the method or module or what ever. If they are all at the top then I know where they are if need to look at the dim.

And by the way, I mostly like the guidelines listed in the above link.

I too DIM variable as Bill described… partly for the reason he specified… but also because when I started programming that was how you HAD to do it… but while compilers may have changed THEIR ways, I haven’t :slight_smile:

Part of that is the variable naming conventions:

website cannot be reached

the link work from UK.

from here now as well…

That being said… variable names (my opinion) should indicate intent over datatype… often datatype can be inferred from the intent, or in a modern GUI, by moving the mouse over it :slight_smile:

However I do have specific variables that are ALWAYS the same type
I,J,K are ALWAYS Integer (Fortran anyone?)
s,t as ALWAYS String