Editing 1306: Sigil Cycle
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== | ||
− | + | {{incomplete}} | |
− | + | In computer programming, a {{w|Sigil (computer programming)|sigil}} is a symbol attached to a variable name, showing the variable's datatype or scope, usually a prefix, as in $foo, where $ is the sigil. Sigils are meant to allow the reader of the code to see at a glance what type a given variable is without having to refer back to a declaration (which may be in a distant part of the code from the section you are reading) or to provide some level typing in languages that do not have explicit type delclarations. | |
− | |||
− | |||
;{{w|QBASIC}} | ;{{w|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 | + | :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 double-precision and that's OK for most numeric uses. |
;{{w|C++}} | ;{{w|C++}} | ||
− | :Pronounced "see plus plus." Variables are just words with regular letters. | + | :Pronounced "see plus plus." Variables are just words with regular letters. Ironically, it is the name of the language itself that includes symbols. |
;{{w|bash (Unix shell)|bash}} | ;{{w|bash (Unix shell)|bash}} | ||
Line 24: | Line 22: | ||
;{{w|Perl}} | ;{{w|Perl}} | ||
− | :In Perl, | + | :In Perl, variables of simple types, and references to items in arrays and hashes, start with $. Arrays start with @. Hashes start with %. |
− | |||
;{{w|Python (programming language)|Python}} | ;{{w|Python (programming language)|Python}} | ||
Line 31: | Line 28: | ||
;{{w|Google}} | ;{{w|Google}} | ||
− | : | + | :In the beginning, Google was only a search engine. However, it now includes many things, in particular a social network called Google+ (pronounced "google plus"). |
;{{w|Twitter}} | ;{{w|Twitter}} | ||
Line 37: | Line 34: | ||
;{{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== | ||
− | + | {{incomplete transcript}} | |
− | + | *Y axis: Odds that the words I type will start with some weird symbol | |
− | + | *X axis: Time | |
− | + | *Data labels: $QBASIC, C++, $BASH, @$PERL, PYTHON, +GOOGLE, @TWITTER, #HASHTAGS | |
+ | *The line alternates between high and low, with $QBASIC starting at high, moving to C++ at low. $BASH and @$PERL are high, Python is low, and +GOOGLE, @TWITTER and #HASHTAGS are the next high. | ||
{{comic discussion}} | {{comic discussion}} | ||
− | + | [[Category:Charts]] | |
− | [[Category: | ||
[[Category:Computers]] | [[Category:Computers]] | ||
+ | [[Category:Comics presenting a compromise]] | ||
[[Category:Internet]] | [[Category:Internet]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
[[Category:Social networking]] | [[Category:Social networking]] | ||
[[Category:Google Plus]] | [[Category:Google Plus]] |