Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming style, uppercase

Name: Anonymous 2010-05-10 15:26

I heard that writing variable names in upper case is bad. Is there a real motivation or is just a convention?

Name: Anonymous 2010-05-11 1:47

>>5
The point is that I don't like writing, say, "leftArm" since I don't get why "left" should be lowercase. Why not "LeftArm" instead?
No reason, it's just a convention. Gosling went all about shitCase with Java and it kinda stuck. Haskell does the same thing.

You really don't need to use it though. If it makes you feel better, Google doesn't use shitCase at all; they use CamelCase for types and functions/methods, and underscore_names for variables and fields (reserving UPPER_CASE and kConstantCase for constants/macros). I actually don't use shitCase either; I use CamelCase for types only, and underscore_names for everything else, including most macros. If your macros are well-behaved (i.e. exactly one evaluation of each argument), there's no reason the caller should need to know whether it's a macro or a regular function.

Most library C code typically does everything with underscore_names and doesn't use uppercase characters at all except for preprocessor constants/macros. The C++ standard library is the same. And the Lisp family essentially never use uppercase characters, instead hyphen-casing everything (since the hyphen is not special in Lisp.)

Bottom line, pick a style you like and apply it consistently. That's all.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List