SINGLETON VARIABLE
\sˈɪŋɡə͡ltən vˈe͡əɹɪəbə͡l], \sˈɪŋɡəltən vˈeəɹɪəbəl], \s_ˈɪ_ŋ_ɡ_əl_t_ə_n v_ˈeə_ɹ_ɪ__ə_b_əl]\
Sort: Oldest first
-
A variable which is only referred to once in apiece of code, probably because of a programming mistake. Tobe useful, a variable must be set and read from, in thatorder. If it is only referred to once then it cannot be bothset and read.There are various exceptions. C-like assignmentoperators, e.g. "x += y", read and set x and return its newvalue (they are abbreviations for "x = x+y", etc). Afunction argument may be passed only for the sake ofuniformity or to support future enhancements. A goodcompiler or a syntax checker like lint should reportsingleton variables but also allow specific instances to bemarked as deliberate by the programmer.
By Denis Howe
Word of the day
basidiomycota
- comprises fungi bearing the spores on basidium: Gasteromycetes (puffballs); Tiliomycetes (comprising orders Ustilaginales (smuts) and Uredinales (rusts)); Hymenomycetes (mushrooms; toadstools; agarics; bracket fungi); in some classification systems considered a division of kingdom comprises fungi bearing spores on a basidium; includes Gasteromycetes (puffballs) Tiliomycetes comprising the orders Ustilaginales (smuts) and Uredinales (rusts) Hymenomycetes (mushrooms, toadstools, agarics bracket fungi).