Discriminator (signal Processing)
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, a discriminator is a
field Field may refer to: Expanses of open ground * Field (agriculture), an area of land used for agricultural purposes * Airfield, an aerodrome that lacks the infrastructure of an airport * Battlefield * Lawn, an area of mowed grass * Meadow, a grass ...
of characters designed to separate a certain element from others of the same
identifier An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique ''class'' of objects, where the "object" or class may be an idea, person, physical countable object (or class thereof), or physical mass ...
. As an example, suppose that a program must save two unique
objects Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ai ...
to memory, both of whose identifiers happen to be . To ensure the two objects are not conflated, the program may assign ''discriminators'' to the objects in the form of numbers; thus, and distinguish both objects named . This has been adopted by
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s as well as digital platforms for
instant messaging Instant messaging (IM) technology is a type of synchronous computer-mediated communication involving the immediate ( real-time) transmission of messages between two or more parties over the Internet or another computer network. Originally involv ...
and
massively multiplayer online game A massively multiplayer online game (MMOG or more commonly MMO) is an online video game with a large number of players to interact in the same online game world. MMOs usually feature a huge, persistent world, persistent open world, although t ...
s.


In instant messaging

A discriminator is used to disambiguate a
user Ancient Egyptian roles * User (ancient Egyptian official), an ancient Egyptian nomarch (governor) of the Eighth Dynasty * Useramen, an ancient Egyptian vizier also called "User" Other uses * User (computing), a person (or software) using an ...
from other users who wish to identify under the same username.


Discord

On
Discord Discord is an instant messaging and Voice over IP, VoIP social platform which allows communication through Voice over IP, voice calls, Videotelephony, video calls, text messaging, and digital media, media. Communication can be private or take ...
, a discriminator used to be a four-digit suffix added to the end of a
username A user is a person who uses a computer or Computer network, network Service (systems architecture), service. A user often has a user account and is identified to the system by a username (or user name). Some software products provide serv ...
. This allowed for up to 10000
user account A user is a person who uses a computer or network service. A user often has a user account and is identified to the system by a username (or user name). Some software products provide services to other systems and have no direct end use ...
s to take the same name.


Transition away from discriminators

In 2023, co-founder Stanislav Vishnevskiy wrote on a company blog post about the
technical debt In software development and other information technology fields, technical debt (also known as design debt or code debt) refers to the implied cost of additional work in the future resulting from choosing an expedient solution over a more robust o ...
caused by the discriminator system, stating that the system resulted in nearly half of the company's friend requests failing to connect. The platform implemented discriminators in the early days of the service, he wrote. When the platform was initially introduced, the
software developer Software development is the process of designing and Implementation, implementing a software solution to Computer user satisfaction, satisfy a User (computing), user. The process is more encompassing than Computer programming, programming, wri ...
s' priority was to let its users take any username they want without receiving a “your desired username is taken” error. Discord had no friend system at first, thus letting people take names in different
letter case Letter case is the distinction between the letters that are in larger uppercase or capitals (more formally ''majuscule'') and smaller lowercase (more formally '' minuscule'') in the written representation of certain languages. The writing system ...
s, making usernames case-sensitive. Discord also introduced a global display name system, wherein a user may input a default nickname to be shown on top of the messages they sent in lieu of their platform-wide username, Vishnevskiy touted on
Reddit Reddit ( ) is an American Proprietary software, proprietary social news news aggregator, aggregation and Internet forum, forum Social media, social media platform. Registered users (commonly referred to as "redditors") submit content to the ...
. The platform created a transition process to a system of
pseudonym A pseudonym (; ) or alias () is a fictitious name that a person assumes for a particular purpose, which differs from their original or true meaning ( orthonym). This also differs from a new name that entirely or legally replaces an individual's o ...
s wherein all new usernames would be case-insensitive lowercase and limited to the
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
characters of A–Z, 0–9, the
full stop The full stop ( Commonwealth English), period (North American English), or full point is a punctuation mark used for several purposes, most often to mark the end of a declarative sentence (as distinguished from a question or exclamation). A ...
and the
underscore An underscore or underline is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on manuscript or typescript as an instruction to the printer. Its ...
. The transition would happen over the course of months, with the accounts that were registered the oldest, and paid subscribers, receiving the opportunity to reserve their name earlier. This change was criticized online for being a step backward, as users could be a risk of being impersonated. A notable
indie game An indie video game or indie game (short for independent video game) is a video game created by individuals or smaller development teams without the financial and technical support of a large game publisher, in contrast to most "AAA" (triple-A ...
studio noted that it could no longer claim its own name on the platform. Discord pointed to its processes for users with high visibility and longstanding business relationships with the company for reserving a username under the new system. The old discriminator-oriented system also mitigated the rush to get unique usernames for sale on the
black market A black market is a Secrecy, clandestine Market (economics), market or series of transactions that has some aspect of illegality, or is not compliant with an institutional set of rules. If the rule defines the set of goods and services who ...
, leading to
swatting Swatting is a form of criminal harassment that involves deceiving an emergency service (via such means as hoaxing an emergency services dispatcher) into sending a police or emergency response team to another person's location. This is achieved ...
and
online harassment Cyberbullying (cyberharassment or online bullying) is a form of bullying or harassment using Electronic communication network, electronic means. Since the 2000s, it has become increasingly common, especially among teenagers and Adolescence, a ...
.


In digital distribution

Battle.net implements a suffix of four-digit numbers to its usernames.


In computer data storage


Common Object Request Broker Architecture

A discriminator is a typed tag field present in the
Common Object Request Broker Architecture The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between sy ...
, the
interface description language An interface description language or interface definition language (IDL) is a generic term for a language that lets a program or object written in one language communicate with another program written in an unknown language. IDLs are usually use ...
of the
Object Management Group The Object Management Group (OMG®) is a computer industry Standards Development Organization (SDO), or Voluntary Consensus Standards Body (VCSB). OMG develops enterprise integration and modeling standards for a range of technologies. Busin ...
. It exists as type and value definitions of
tagged union In computer science, a tagged union, also called a variant, variant record, choice type, discriminated union, disjoint union, sum type, or coproduct, is a data structure used to hold a value that could take on several different, but fixed, types. ...
s that determine which union member is selected in the current union instance. This is done by introduction of the classic C switch construct as part of the classic C union. Unlike in some conventional programming languages offering support for unions, the discriminator in IDL is not identical to the selected field name. Here is an example of an IDL union type definition: union Register switch (char) ; The effective value of the ''Register'' type may contain AX as the selected field, but the discriminator value may be either 'a' or 'b' and is stored in memory separately. Therefore, IDL logically separates information about the currently selected field name and the union effective value from information about the current discriminator value. In the example above, the discriminator value may be any of the following: 'a', 'b', 'c', as well as all other characters belonging to the IDL char type, since the default branch specified in the example ''Register'' type allows the use of the remaining characters as well.


Other interface definition languages

The
Microsoft Interface Definition Language Microsoft Interface Definition Language (MIDL) is a text-based interface description language from Microsoft, based on the DCE/RPC IDL which it extends for use with the Microsoft Component Object Model. Its compiler is also called MIDL. Version ...
also supports tagged unions, allowing to choose the discriminator via an attribute in an enclosing structure or function.


In deserialization

When deserializing data from a data serialization format such as
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
in a object-oriented language, a type discriminator may be used for polymorphic deserialization. In this example the discriminator field is named "$type". A serialization of a book. A serialization of a movie. Both data serializations share a common field here named "$type" which serves as the type discriminator. The book have the book-specific field "author", while the movie have the movie-specific field "director". This facilitates the deserialization of data to different classes depending on the value of the type discriminator.


Alternatives

A
friend code Nintendo Wi-Fi Connection (sometimes shortened to Nintendo WFC) was an online multiplayer gaming service run by Nintendo that formerly provided free online play in compatible Nintendo DS and Wii games. The service included the company's W ...
is a unique twelve-digit number that could be exchanged with friends and be used to maintain individual friend lists in each
video game A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
. Friend codes were generated from an identifier unique to a copy of a game and the
universally unique identifier A Universally Unique Identifier (UUID) is a 128-bit label used to uniquely identify objects in computer systems. The term Globally Unique Identifier (GUID) is also used, mostly in Microsoft systems. When generated according to the standard methods ...
corresponding to that of a user's device.


References

Programming language topics {{prog-lang-stub