Sigil Cycle
Sigil Cycle
A sinusoidal curve is shown. Y axis: Odds that the words I type will start with some weird symbol X axis: Time Data labels: [at first peak] $QBASIC, [at first trough] C++, [at second peak] $BASH, @$PERL, [at second trough] PYTHON, [at third peak] +GOOGLE, @TWITTER, #HASHTAGS

In computer programming , a variable is a way of storing information temporarily, for use later in the program. There are different types of variables, called 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 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 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.
Most programming languages have a different method for storing variables, although some languages may use the same variable types under different names. The following are the programming languages referenced in the comic and how they use variables.
QBASIC Variables of type string end with the $ symbol. Other symbols are used (% for integers, ! for single-precision, # for double-precision and, in some versions of BASIC, & for long integers), however the usual QBASIC program will use only the $ symbol and not any of the others, as the default type if no symbol is used is single-precision and that's OK for most numeric uses.
C++ Pronounced "see plus plus." Variables are just words with regular letters. It is the name of the language itself that includes symbols.
bash This is not typically thought of as a full-featured programming language, but a Unix shell. However, the shell command syntax is rich enough to be able to write simple (and sometimes really complex) programs called shell-scripts. In this language, all variable dereferences start with the symbol $.
Perl In Perl, the initial character provides the context of the variable. Scalars (text, numeric and also to references to data) start with the $ character. An @ is for an array. With %, it is a hash (a loose non-sequential array, or 'dictionary' lookup). Functions can be given a preceding &, but rarely need this in straightforward use. You can use the variables $temp, @temp, %temp and &temp simultaneously and independently. There is also the * (not in a mathematical sense) which identifies a 'glob', a way to fuse or use all those types (and more!) in 'interesting' ways if you have a yen to. A block, with {} surrounding some other suitable statement(s), can potentially be typed to (re)interpret the context within. If you have a $reference which currently points to an @array, @{$reference} will let you use it as a direct array. But in simple cases, like that, this can often be shortened to @$reference, as alluded to by the "@$PERL" of the comic. (Just as $$reference would be a valid way to dereference the $reference when it points to $scalar... or even to $anotherReference that itself points to a %hash, in which case you could even use %$$reference for 'direct' access to that. Perl can be complicated, if you let it!)
Python Variables are just words with regular letters.
Google In the beginning, Google was only a search engine. However, it now includes many apps (such as YouTube, Gmail, Microsoft products but Google [e.g. Google docs], etc.), which included a social network called Google+ (now defunct, pronounced "google plus"). Google+ accounts were referenced with a + prefix.
Twitter Twitter account IDs are identified by the leading symbol @. When an account is "mentioned" in a tweet using @, it triggers smart behavior. For example, account owners can configure Twitter to forward tweets that mention them. This feature was not present in the early days of Twitter.
Hashtags In 2007 Twitter users began a convention that a # sign (whose 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 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.
A sinusoidal curve is shown. Y axis: Odds that the words I type will start with some weird symbol X axis: Time Data labels: [at first peak] $QBASIC, [at first trough] C++, [at second peak] $BASH, @$PERL, [at second trough] PYTHON, [at third peak] +GOOGLE, @TWITTER, #HASHTAGS
