You are reading a single comment by @ehren_fried_chicken and its replies. Click here to read the full conversation.
  • I'm useless with formatting but I am trying to tidy up my programming style.

    Is there a standardised formatting / good practice for local vs global variable naming i.e something simple like this:

    Local

    rider_weightL = 120

    Global

    mirror_angleG = pi/3

    or is it best just to presume people will work out the scope and not bother with this, am I getting anal?

    What language do you program in?

    In JavaScript I use ALL_CAPS for global variables (I only have one, though), although in C++ and Java convention that is a constant.

    To be honest, global variables open the door to a ton of bugs and if you're serious about improving your style, try to avoid them wherever possible. I know it sounds like a pain in the arse, but it's much better to pass variables around through function calls.

About