Talk:Naming convention (programming)
Add topic| This is the talk page for discussing improvements to the Naming convention (programming) article. This is not a forum for general discussion of the subject of the article. |
Article policies
|
| Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
| Archives: 1Auto-archiving period: 3 months |
| This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Deleted
[edit]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)
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)
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)
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)
- A caveat about "the multiple languages wouldn't interact with eachother[sic]"
- While multiple modules, written in multiple languages, tend to interact through OS/Network/data encode/decode, this doesn't completely eliminate the identifiers. For example, when JSON is used to encode a Node.js/Javascript structure, the naming convention is then baked into the JSON. This then "leaks" into any other reader/writer of these structures. It's not a huge interaction but it does happen.
- Also, depending on the OS bindings presented to each language, and the limitation on the C ABI, you can find C-identifiers created in Microsoft Windows libraries that are imported into C# programs. Drjasonharrison (talk) 17:09, 24 March 2022 (UTC)
Potential Benefits
[edit]- 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? — Preceding unsigned comment added by 24.84.45.170 (talk) 07:31, 3 January 2013 (UTC)
- I can see your perspective, and at times a dry, "business like", communication style contrasts with a desire to enjoy one's work, there are too many negative possibilities for creating comical identifiers in a business environment. Sorry, not sorry. Too often, "Your joke is their insult."
- Most professional, that is business, writing tends to avoid ambiguous expressions as they lead to confusion on the part of the reader. What might seem funny to your current team could be seen as insulting to the customer or a new team member. Also if the ambiguity is in the realm of science/math/engineering then it potentially confuses the reader.
- My recommendation is to avoid the use of comical names, which require ambiguity and sharp shifts of interpretation, leave it in the comments, but please don't pollute the identifiers and your team perspective. Drjasonharrison (talk) 17:18, 24 March 2022 (UTC)
It
[edit]Self documenting language are referred to 103.171.46.27 (talk) 09:56, 27 June 2022 (UTC)
Dogma & scientific sources
[edit]The article states that different naming conventions are kind of a dogma. There is however a scientific litterature about the topic that allows to draw some conclusions, see for example https://makimo.com/blog/scientific-perspective-on-naming-in-programming/ which does a review, or single studies like https://www.researchgate.net/publication/4242245_Whats_in_a_Name_A_Study_of_Identifiers The article doesn't cite scientific studies. Its sources tend to be mostly conventions of particular languages, which are valid in the context of explaining one convention, but I think there's a lack of scientific sources or studies in the article itself. LDiCesare (talk) 06:48, 1 April 2024 (UTC)