Jump to content

Talk:Naming convention (programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 24.84.45.170 (talk) at 07:31, 3 January 2013 (Additional section: Potential benefits : question about sources.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputer science Start‑class
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Things you can help WikiProject Computer science with:

WikiProject iconComputing Start‑class
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.

Deleted

I deleted, "Identifiers representing macros in C and C++ are, by convention, written using only upper case letters."

Because this is not true. "__cplusplus" for example is an all lower-case, standard macro. The all-caps macros are found primarily in Microsoft code, and have been adopted by some C++ programmers. C++ has very loose style guides; for the most part, everyone's is a little bit different.--RITZ 16:31, 10 October 2006 (UTC)[reply]

This use of uppercase (actually it no lowercase) for macro names predates the creation of Microsoft as a company. If you look at Table 787.5 of these measurements, second to last row, you will see that in general macro names do not include any lower case letters. Derek farn 16:44, 10 October 2006 (UTC)[reply]


The comment on Underscore being harder to access sounds pretty bull. On most keyboards, shift+- is the access key, and itM's certainly not that inaccessible (compared to ctrl+Shift or AltCar...)Circeus 18:55, 31 January 2006 (UTC)[reply]


The comment about programmers being lazy for typing long identifiers is subjetive. 11:31, 2 March 2006 (GMT -5)

I agree, and have changed it to something more objective and sensible. In fact, the whole section needed revision. Claiming that most business applications are written in several languages, even if this was true, the multiple languages wouldn't interact with eachother, they would share data through a seperate medium such as the OS. --RITZ 16:41, 10 October 2006 (UTC)[reply]

C/C++

"In C, abbreviated names are the most common (e.g. isalnum for a name of a function testing whether a character is alphanumeric), while C++ often uses an underscore as a word separator (e.g. out_of_range). Template parameters are usually CamelCased."

I don't see why this was deleted as POV. It isn't about programming in C/C++ in general, only about the conventions used in the corresponding ISO standard documents, which are rather consistent and clear in this matter. Tigrisek 23:39, 7 September 2007 (UTC)[reply]

The discussion reads as if it is about C/C++ in general (I think this would be the most appropriate subject to discuss; the conventions used in one document are is a somewhat specialised). You can read about some measurements of C naming usage in [1]. I am not aware of any measurements that back up the naming claims made about C++ and would not say that template parameters follow conventions that are any different from other names. Derek farn 12:33, 8 September 2007 (UTC)[reply]
As to the template parameters – just take a look at the C++ Standard draft ([2]) or Dinkumware Standard Library reference ([3]). The guidelines are presented in the Boost C++ Libraries conventions guide ([4]). There is no normative document defining the conventions used in the Standard, which does not mean the Standard does not use any consistently. I think this information qualifies to be listed in the article on naming conventions (perhaps with emphasis on the fact that this applies to the language and its Standard Library, and not necessarily to habits used by many programmers).Tigrisek 12:38, 20 September 2007 (UTC)[reply]

Merging Programming style and Coding and Naming Conventions articles

Please see following talk page and provide me with some feedback if you like Talk:Coding_conventions#Refactoring_coding_conventions_and_programming_style_articles. Several bigger but straigtforward merges re. following articles are proposed: Programming style , Coding conventions , Naming convention (programming) . Thanks, Ptrb (talk) 12:45, 13 November 2010 (UTC).[reply]

Are variables constant in Java?

Except for variables, all instance, class, and class constants are also in in "CamelCase", with the first letter lower case. ...

All constants except for variables?! Is this a thinko, or a quirk of Java? —Tamfang (talk) 22:15, 8 December 2010 (UTC)[reply]

rewrote that section a bit , I think it is correct now. Ptrb (talk) 08:10, 9 December 2010 (UTC)[reply]

Variable naming convention in .NET

Microsoft did not mention anything about whether use Pascal or camal for variables (only parameters). It should be removed from the article. Jim Liu (talk) 06:50, 24 July 2011 (UTC)[reply]

Potential Benefits

"to enhance the aesthetic and professional appearance of work product (for example, by disallowing overly long names, comical or "cute" names, or abbreviations);"

What evidence is there that disallowing comedic names is beneficial? I could see possible negative effects but I can also see the positives of having an informative and humorous identifier. Why is it polarized as negative?