chambrick Posted January 12, 2006 Share Posted January 12, 2006 When naming variables I (being from the Microsoft programming world) adopted the title case pattern. Multiple words are connected without spaces and the first letter is capitolized. (i.e. FireplaceTimer, SprinklerOnOff, etc.)What do others like? Link to comment Share on other sites More sharing options...
slemay Posted January 12, 2006 Share Posted January 12, 2006 I speak and read English best - so I ID things correctly with one word - simular to your thinking. Link to comment Share on other sites More sharing options...
Samer Shami Posted January 12, 2006 Share Posted January 12, 2006 I grew up on C programming were common syntax dictated all lowercase with underscore seperations. So far it seems a little easier for me to distinguish between these variables when reading my scripts because they stand out amoungst the proper English sentences.One thing I always do with boolean variables is give it a true condition name in past tense. For example, you said SprinklerOnOff. I would always name it "sprinkler_on". Therefore if true, then the sprinkler is on. If false, then I know the sprinkler is off. Another example is "all_lights_on" or "special_condition_reached". When you give a variable a name like SprinklerOnOff it causes me to stop reading code and actually take a moment to think about what true and false will represent in this case. It may seem trivial in this example, but other situations are likely to occur to make this a valuable naming convention.This is the only one that springs to mind ATM. Link to comment Share on other sites More sharing options...
chambrick Posted January 13, 2006 Author Share Posted January 13, 2006 You're right Shami, I noticed that later in another post I was doing and changed it to FireplaceOn rather than OnOff. Good point.I hate underscores but I see your point with them standing out. Link to comment Share on other sites More sharing options...
hgrace Posted January 14, 2006 Share Posted January 14, 2006 ThisIsMoreUniversiallyCalledHungarianNotationInProgrammingCommunities. Sometimes_A_Different_Concoctination_Device_Is_Used. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.