Editing 1306: Sigil Cycle

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
==Explanation==
 
==Explanation==
In {{w|computer programming}}, a variable is a way of storing information temporarily, for use later in the program. There are different types of variables, called {{w|Data type|data types}}, such as integers, strings, characters, and booleans, all of them holding different types of information. Integers hold whole numbers, strings hold text, and so on. Variables traditionally have names that identify their purpose, and a programmer should usually be able to infer from this variable name what type of variable it is. For example, if you want to store the name of the customer in a catalogue service, you might store the text in a string variable called "NameOfCustomer". Because it is fairly clear that names are made up of text, it is logical that this variable would be a string variable - if you didn't have any other information about it.
+
 
 +
In {{w|computer programming}}, a variable is a way of storing information temporarily, for use later in the program. There are different types of variables, called {{w|Data type|data types}}, such as integers, strings, characters, and booleans, all of them holding different types of information. Integers hold whole numbers, strings hold text, and so on. Variables traditionally have names that identify their purpose, and a programmer should usually be able to infer from this variable name what type of variable it is. For example, if you want to store the name of the customer in a catalogue service, you might store the text in a string variable called "NameOfCustomer". Because it is fairly clear that names are made up of text, it is logical that this variable would be a string variable - if you didn't have any other information about it.  
  
 
A {{w|Sigil (computer programming)|sigil}} in computer programming is a symbol that appears before the variable name. It is an alternative method of telling someone who is reading the program code what data type the variable is. Rather than relying on logic, then, to know that NameOfCustomer is a string, you might use a sigil "$" before the variable name, as in $NameOfCustomer, which would specify that the variable can hold text. Sigils can also specify the {{w|Scope (computer science)|scope}} of a variable, which refers to where the variable can be used in a program, and which parts of the program can access that variable. Sigils are useful in some ways because you don't have to refer to previous program code or find where the variable is declared (created) to know what data type it is. They also provide some level typing in languages that do not explicitly declare the type of the variable.
 
A {{w|Sigil (computer programming)|sigil}} in computer programming is a symbol that appears before the variable name. It is an alternative method of telling someone who is reading the program code what data type the variable is. Rather than relying on logic, then, to know that NameOfCustomer is a string, you might use a sigil "$" before the variable name, as in $NameOfCustomer, which would specify that the variable can hold text. Sigils can also specify the {{w|Scope (computer science)|scope}} of a variable, which refers to where the variable can be used in a program, and which parts of the program can access that variable. Sigils are useful in some ways because you don't have to refer to previous program code or find where the variable is declared (created) to know what data type it is. They also provide some level typing in languages that do not explicitly declare the type of the variable.
Line 37: Line 38:
  
 
;{{w|Hashtag}}s
 
;{{w|Hashtag}}s
:In 2007 Twitter users began a convention that a # sign (whose {{w|Number sign|many names}} include the "hash") can be prepended to words to mark them as keywords. Twitter could then be searched for those words. In 2009 Twitter recognized the existence of hashtags and began hyperlinking them. Some other microblogging services followed suit.  Google+ eventually added hashtag support as did Facebook.
+
:In 2007 Twitter users began a convention that a # sign (whose {{w|Number sign|many names}} include the "hash") can be prepended to words to mark them as keywords. Twitter could then be searched for those words. In 2009 Twitter recognized the existence of hashtags and began hyperlinking them. Some other microblogging services followed suit.  Google+ eventually added hashtag support as did Facebook.
  
As is noted by the comic, the use of sigils to indicate types of variables varies between programming languages, from strict enforcement in languages like Perl, to their complete absence in languages like C++ (but see {{w|Hungarian Notation}}). The comic notes that the use of sigils seems to be cyclic, especially if you count things like hashtags as extensions of the pattern.
+
As is noted by the comic, the use of sigils to indicate types of variables varies between programming languages, from strict enforcement in languages like Perl, to their complete absence in languages like C++ (but see {{w|Hungarian Notation}}). The comic notes that the use of sigils seems to be cyclic, especially if you count things like hashtags as extensions of the pattern.
  
The title text describes the two competing influences responsible for the cycle: The first impulse finds sigils useful to elucidate the type of the variable, especially when variable names are not very descriptive, while the latter impulse notes that descriptive variable names are much more useful for that purpose, especially in extensible languages where the built-in types form only a small part of the type system.
+
The title text describes the two competing influences responsible for the cycle: The first impulse finds sigils useful to elucidate the type of the variable, especially when variable names are not very descriptive, while the latter impulse notes that descriptive variable names are much more useful for that purpose, especially in extensible languages where the built-in types form only a small part of the type system.
  
 
==Transcript==
 
==Transcript==

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)