Poll: Do you capitalize the start of your variables/functions?

Started by
24 comments, last by Brain 13 years, 6 months ago
Can't break the habit of UpperCamelCase-ing everything (actually, that's not called camel case, is it?).

I even do:

for(int A=1;A<2;++A){ }


but then again I've never worked on code in a group. I guess you just go with the flow. At least I stopped doing TClassName (Borland Builder has a lot to answer for) after some time spent on these forums.
Advertisement
Over the years of my C/C++/Java/C#/Perl/Python programming endeavours I realize that my coding style has been drawn towards the D style, something I find to be just fine as I am currently in the process of replacing C/C++ with D.
So, I guess my answer is No
In Lisps you can name them with almost whatever characters you want, so you can used names like "not=", "int->string", "the-last-element" and "+" (yes, "+" can be a variable name). I love Lisp...
Quote:Original post by tufflax
In Lisps you can name them with almost whatever characters you want, so you can used names like "not=", "int->string", "the-last-element" and "+" (yes, "+" can be a variable name). I love Lisp...


Honestly, the only moment I'd name a variable "+" is after smokin crack.

That said, Lisps is for junkies.

EDIT: 2 minutes after posting this I forgot I've had posted it. That, for some, might mean that Lisps rules.
[size="2"]I like the Walrus best.
lowerCamelCase for variables (members prefixed with m_ because _ on it's own looks silly and makes code unreadable) and functions
UpperCamelCase for Classes
UPPERCASE for macros
lowercase for namespaces

And no hungarian code, encode a type in a variable name is wrong the name itself should be sufficient enough to guess it's type.

When stuff gets confusing an what something is change your highlighting setup so it's clear what everything is in one glance. E.g. color functions differenct from classes and variables.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Yes, CamelCase for everything, no java like lowerStartingLetter. :-) Personal preference for most C-like syntax languages for C#, C++, etc.
I also use CAPITAL_WITH_UNDERSCORE for all enum values and the majority of constants, plus #defines.
I never use 'warts' such as 'i' for 'integer' because you can end up in a hungarian notation mess in the same way as the win32 API, for example 'lpszName' :-)

This topic is closed to new replies.

Advertisement