lulupedia
Suomi 版本暂未收录,当前展示 English 内容。

Code

2982 words·24.9.2026·English
0

Code is a system of rules and symbols used to represent and transmit information, instructions, or meanings across various domains, including computing, communication, cryptography, law, and ethics.

Etymology and General Concept

The term "code" originates from the Latin codex, meaning a wooden tablet for writing, later evolving to refer to a systematic collection of laws or rules. In its broadest sense, a code transforms information from one form into another according to a predefined mapping, enabling efficient storage, transmission, or secrecy. The process of creating a code is called encoding, and its reverse, decoding.

In Computing

In computer science, a code is a set of instructions written in a programming language that a computer can execute. Source code is human-readable text written by programmers, typically in languages such as Python, C++, or Java. This code is then translated into machine code—binary instructions (0s and 1s) that the central processing unit (CPU) directly interprets—via compilers or interpreters. Machine code is the lowest-level representation of a program. Intermediate forms, such as bytecode (used by the Java Virtual Machine), are also considered codes optimized for virtual execution.

The concept of "code" extends to data representation: ASCII (American Standard Code for Information Interchange) and Unicode are character encoding standards that assign numeric codes to letters, digits, and symbols, allowing text to be stored and processed digitally. Error-detecting and error-correcting codes, such as Hamming codes and Reed–Solomon codes, are used to ensure data integrity in storage and transmission.

In Communication Theory

In information theory and telecommunications, a code is a scheme for converting a message into a signal suitable for transmission over a channel. Shannon's source coding theorem and channel coding theorem provide the mathematical foundations for efficient and reliable communication. Source codes (e.g., Huffman coding, Lempel–Ziv–Welch) compress data by removing redundancy, while channel codes (e.g., convolutional codes, turbo codes) add redundant bits to protect against noise. These codes are essential in digital television, mobile phones, and deep-space communication.

In Cryptography

In cryptology, a code is a method of transforming plaintext into ciphertext to conceal its meaning, often distinguished from a cipher by using a codebook that maps whole words or phrases to alternative symbols (e.g., "attack at dawn" becomes "Eagle flies north"). Historically, codes were used extensively in military and diplomatic communications, such as the Zimmerman Telegram. Modern cryptography relies more on mathematical ciphers, but the term "code" is still used loosely to refer to any cryptographic system, including encryption algorithms and authentication codes.

Social and Legal Codes

Beyond technical fields, "code" denotes a system of principles or rules governing behavior. Legal codes, such as the Napoleonic Code or the Uniform Commercial Code, are comprehensive collections of statutes that regulate legal rights and obligations. Ethical codes, like the Hippocratic Oath for physicians or the ACM Code of Ethics for computing professionals, establish standards of conduct. These codes serve as frameworks for decision-making and accountability in societies and organizations.

See Also

  • ASCII
  • Computer program
  • Cryptography
  • Error correction code
  • Morse code
  • Source code

Kommentit (0)

U

Ei vielä kommentteja. Ole ensimmäinen!

Saatat olla kiinnostunut

Aiheeseen liittyvät artikkelit