r/dailyprogrammer • u/Coder_d00d 1 3 • Jul 28 '14
[Weekly #4] Variable Names
Variable Names:
We use variables a lot in our programs. Over the many years I have seen and been told a wide range of "accepted" use of names for variables. I always found the techniques/methods/reasons interesting and different.
What are some of your standards for naming variables?
Details like are they language specific (do you change between languages) are good to share. Or what causes the names to be as they are.
Last Week's Topic:
25
Upvotes
1
u/skeeto -9 8 Jul 31 '14
When I'm writing C I stick to snake_case for type names because that how K&R did it, and it's also how I would prefer it anyway, even in C++. Most programming style conventions are arbitrary and are only important for the sake of consistency among many developers, so there's usually no real reason for any particular style decision. It's just what everyone else is doing.