|
In computer programming a naming convention is a set of rules for choosing identifiers. Wikibooks has more about this subject: Computer programming Computer programming (often simply programming) is the craft of implementing one or more interrelated abstract algorithms using a particular programming language to produce a concrete computer program. ...
Identifiers (IDs) are lexical tokens that name entities. ...
Naming conventions are commonly used for various purposes: - to embed information about the entity, such as its type and intended use, in the identifier (See: Hungarian notation);
- to work around restrictions imposed by the language on what an identifier may look like (See: CamelCase notation);
- to ensure clarity (for example by disallowing overly long names or abbreviations);
Programmers tend to be very picky about naming conventions, and choise of naming conventions can become an enormously controversial issue, with partisans of each holding theirs to be the best and others to be inferior. Hungarian notation is a naming convention in computer programming, in which the name of an object indicates its type and intended use. ...
CamelCase is a common name for the practice of writing compound words or phrases where the words are joined without spaces, and each word is capitalized within the compound. ...
Multiple-word identifiers
As most programming languages do not allow spaces in identifiers, some system must be devised when a programmer wishes to use a name containing multiple words. There are several in widespread use; each has a significant following, though sometimes one dominates amongst users of a particular programming language. There are also some programmers who eschew multiple-word names entirely, and so use none of these systems (see the section below on the amount of information in identifiers). A programming language or computer language is a standardized communication technique for expressing instructions to a computer. ...
One approach is to replace spaces with another character. The two characters commonly used for this purpose are the hyphen ('-') and the underscore ('_'), so the two-word name two words would be represented as two-words or two_words. The hyphen is arguably the easier to type and more readable of these, and is used by nearly all programmers of Lisp, Scheme, and other languages that permit hyphens in identifiers. However, many other languages reserve the hyphen for use as the subtraction operator, and so do not permit it in identifiers. Thus some programmers of these languages use underscores instead. However, underscores are somewhat harder to type due to their location on most keyboards, and so this solution has not been universally adopted; it is, however, in fairly widespread use among programmers of C, Perl, and many scripting languages. Lisp is a reflective, functional programming language family with a long history. ...
Scheme is a functional programming language and a dialect of Lisp. ...
In mathematics, subtraction is one of the four basic arithmetic operations. ...
The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a standardized imperative computer programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the...
Perl, also Practical Extraction and Report Language (a backronym, see below), is an interpreted procedural programming language designed by Larry Wall. ...
Scripting languages (commonly called scripting programming languages or script languages) are computer programming languages designed for scripting the operation of a computer. ...
An alternate approach, developed mostly as an alternative to the underscore in languages that do not permit hyphens, is to omit the space and indicate word boundaries using capitalization, thus rendering two words as either twoWords or TwoWords. This is called CamelCase, among other names. CamelCase is a common name for the practice of writing compound words or phrases where the words are joined without spaces, and each word is capitalized within the compound. ...
There are several methods of writing multi-word identifier names in computer languages that tokenize on whitespace. For example, a variable called "my favorite variable" could be written as: - myFavoriteVariable (lower camel case: Java variable and method names)
- MyFavoriteVariable (upper camel case: Java class names, C# method, variable and class names, Ruby class names)
- my_favorite_variable (underscored: Python method names, Ruby method names)
- My_Favorite_Variable (capitalization and underscores as used in Ada)
- my-favorite-variable (dashed: some Lisp functions)
- MY_FAVORITE_VARIABLE (all caps: constants in various languages)
- myfvvbl (with vowels removed: some C functions and system calls)
Java is a reflective, object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. ...
Java is a reflective, object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. ...
The title given to this article is incorrect due to technical limitations. ...
Ruby is a red gemstone, a variety of the mineral corundum (aluminium oxide) in which the color is caused mainly by chromium. ...
Python is an interpreted, interactive programming language created by Guido van Rossum in 1990. ...
Ruby is a red gemstone, a variety of the mineral corundum (aluminium oxide) in which the color is caused mainly by chromium. ...
Ada is a structured, statically typed imperative computer programming language designed by Jean Ichbiah of CII Honeywell Bull in the 1970s. ...
Lisp may mean: Lisp programming language Lisp (speech) This is a disambiguation page — a navigational aid which lists other pages that might otherwise share the same title. ...
The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a standardized imperative computer programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the...
Information in identifiers There is significant disagreement over how much information to put in identifiers. This was driven initially by technical reasons, as some early programming languages only allowed identifiers of a certain length. Thus in the standard C library (C was initially one of those languages), one finds atoi as the name of a function that converts ASCII strings to integers. In Lisp, one would be more likely to encounter the same function named as ascii-to-integer or similar. However, the use of shorter identifiers has outlived those technical restrictions, partly as heritage (it continues more commonly in those languages that once had the restrictions), and partly out of ease of use -- it's simply easier to type shorter identifiers, especially when the identifier is used frequently. Those who prefer the longer identifiers argue that the difficulty of typing the longer identifiers is outweighed by the ease of reading code that is more descriptive rather than peppered with impenetrable acronyms and abbreviations. There are 95 printable ASCII characters, numbered 32 to 126. ...
The integers consist of the positive natural numbers (1, 2, 3, â¦), their negatives (â1, â2, â3, ...) and the number zero. ...
In addition to the issue of length of identifiers in their descriptive capacity, there are also several systems for codifying specific technical aspects of a particular identifier in the name. Perhaps the most well-known is Hungarian notation, which encodes the type of a variable in its name. Several more minor conventions are widespread; one example is the convention of naming variables in C and C++ with an initial lowercase letter, and naming user-defined datatypes with an initial capital letter. Hungarian notation is a naming convention in computer programming, in which the name of an object indicates its type and intended use. ...
In computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ...
C++ (pronounced see plus plus) is a general-purpose computer programming language. ...
|