Skip to main content
Back to Tags

Programming Language

114 items tagged with "programming-language"

Filter by type:

Patterns23

Pattern

Factory Method

Defines an interface for creating an object but lets subclasses decide which concrete class to instantiate, deferring instantiation to subclasses.

Pattern

Abstract Factory

Provides an interface for creating families of related objects without specifying their concrete classes, ensuring products from one family are used together.

Pattern

Builder

Separates the construction of a complex object from its representation so the same construction process can create different representations step by step.

Pattern

Prototype

Creates new objects by cloning an existing instance (the prototype) rather than instantiating a class, useful when construction is costly or types are decided at runtime.

Pattern

Singleton

Ensures a class has only one instance and provides a global point of access to it, used for shared resources like configuration, logging, or connection pools.

Pattern

Lazy Initialization

Defers the creation or computation of an object until the first time it is actually needed, avoiding upfront cost for resources that may never be used.

Pattern

Multiton

Generalizes Singleton to manage a fixed, keyed set of named instances, ensuring exactly one instance exists per key through a registry.

Pattern

Registry

Provides a well-known central object where shared instances or services can be registered and looked up by key, giving a single point of access without scattered globals.

Pattern

Adapter

Converts the interface of a class into another interface clients expect, letting classes that could not otherwise collaborate work together.

Pattern

Bridge

Decouples an abstraction from its implementation so the two can vary independently, avoiding a combinatorial explosion of subclasses.

Pattern

Composite

Composes objects into tree structures to represent part-whole hierarchies, letting clients treat individual objects and compositions uniformly.

Pattern

Decorator

Attaches additional responsibilities to an object dynamically by wrapping it, providing a flexible alternative to subclassing for extending behavior.

Pattern

Flyweight

Minimizes memory use by sharing as much data as possible between many similar objects, separating intrinsic shared state from extrinsic context-specific state.

Pattern

Proxy

Provides a surrogate or placeholder for another object to control access to it, enabling lazy loading, access control, caching, or remote access.

Pattern

Module

Encapsulates related code into a single self-contained unit with a controlled public interface and hidden private state, organizing code and avoiding global namespace pollution.

Pattern

Marker Interface

Uses an empty interface to tag a class with metadata so other code can detect the capability at runtime via type checks, without adding any methods.

Pattern

Mixin

Composes reusable units of behavior into a class without inheritance, letting unrelated classes share functionality by mixing in shared method sets.

Pattern

Extension Object

Lets you add new interfaces and behavior to a class over time without changing it, by attaching extension objects that clients query for at runtime.

Pattern

Private Class Data

Restricts accessor-write access to class attributes by isolating data in a separate object exposed read-only after construction, enforcing immutability and encapsulation.

Pattern

Producer-Consumer

A concurrency pattern where producers place work on a shared bounded queue and consumers process it independently, decoupling rates and smoothing load.

Pattern

Thread Pool

A concurrency pattern that reuses a fixed set of worker threads to execute many tasks, avoiding per-task thread creation cost and bounding concurrency.

Pattern

Actor Model

A concurrency model where independent actors encapsulate state and communicate only by asynchronous messages, avoiding shared memory and locks.

Pattern

Reactor

An event-handling pattern that demultiplexes I/O events on one or few threads and dispatches them synchronously to registered handlers, enabling scalable non-blocking servers.

Anti-Patterns23

Anti-Pattern

Boolean Trap

Function parameters that take a bare boolean force readers to decode opaque true/false call sites, hiding intent and inviting wrong arguments.

Anti-Pattern

Stringly Typed Code

Using strings to represent data that has real structure or a fixed set of values, discarding type safety and pushing errors to runtime.

Anti-Pattern

Primitive Obsession

Modeling domain concepts with raw primitives like int and string instead of dedicated types, scattering validation and inviting invalid data.

Anti-Pattern

Magic Numbers

Unexplained numeric literals embedded in code, hiding their meaning and duplicating values that must change together.

Anti-Pattern

Magic Strings

Hardcoded string literals that act as keys, flags, or identifiers, with no central definition, inviting typos and silent failures.

Anti-Pattern

Long Method

A single function that does too much and runs for hundreds of lines, mixing many concerns and resisting comprehension, testing, and reuse.

Anti-Pattern

Long Parameter List

A function signature with too many parameters, making calls error-prone, hard to read, and a sign of poorly grouped or missing abstractions.

Anti-Pattern

Data Clumps

The same group of fields or parameters traveling together everywhere, signaling a missing abstraction that should be a single object.

Anti-Pattern

Feature Envy

A method that is more interested in another class's data than its own, repeatedly reaching into that class instead of letting it own the behavior.

Anti-Pattern

Null Checking Everywhere

Defensive null checks scattered through the codebase to guard against nulls that could be designed away, cluttering logic and still missing cases.

Anti-Pattern

Refused Bequest

A subclass that inherits methods or data it does not want or use, often overriding them to do nothing, signaling a wrong inheritance relationship.

Anti-Pattern

Yo-Yo Problem

An inheritance hierarchy so deep that understanding behavior forces constant scrolling up and down between many classes to trace a single call.

Anti-Pattern

Call Super

A framework requiring subclass overrides to call the parent method, a fragile contract that breaks silently whenever a developer forgets the call.

Anti-Pattern

Temporal Coupling

Methods that must be called in a specific hidden order, where calling them out of sequence silently breaks state with no compiler protection.

Anti-Pattern

Switch Statement Smell

Repeated switch or if-else chains branching on a type code, duplicated across the codebase, that should be replaced by polymorphism.

Anti-Pattern

Poltergeist

A short-lived, do-nothing class that only passes data or calls to other objects, adding indirection and noise without real responsibility.

Anti-Pattern

Sequential Coupling

A class designed so its methods must be invoked in a rigid sequence, with the ordering enforced only by convention rather than by the API itself.

Anti-Pattern

Busy-Waiting (Spin-Waiting)

Repeatedly polling a condition in a tight loop instead of blocking, burning CPU cycles while waiting for an event that the scheduler could deliver for free.

Anti-Pattern

Broken Double-Checked Locking

A lazy-initialization idiom that checks a field outside a lock, locks, then checks again — but without proper memory barriers it returns partially constructed objects.

Anti-Pattern

Synchronous-Over-Async (sync-over-async)

Blocking a thread to wait on an asynchronous operation's result, combining the costs of both models and risking thread-pool starvation or deadlock.

Anti-Pattern

Memory Leak

Allocating memory that is never released because references are unintentionally retained, so usage grows without bound until the process slows, thrashes, or crashes.

Anti-Pattern

False Sharing

Independent variables that happen to live on the same CPU cache line, so updates by different cores invalidate each other's caches and silently destroy multicore performance.

Anti-Pattern

Resource Leak

Acquiring file handles, sockets, connections, or threads without reliably releasing them, so a finite pool is exhausted and the application stops being able to do work.

Tutorials14

Tutorial

Migrating JavaScript to TypeScript

Gradually migrate a JavaScript codebase to TypeScript

Tutorial

Runtime Validation with Zod

Add runtime type validation to TypeScript using Zod

Tutorial

How to set up a Go project with modules and tests

Start a Go project with Go modules, structure packages, and write table-driven tests using the standard testing package.

Tutorial

How to set up a Rust project with Cargo and tests

Create a Rust project with Cargo, add dependencies from crates.io, and write unit and integration tests.

Tutorial

How to set up a Python project with Poetry and pytest

Create a reproducible Python project using Poetry for dependency management and pytest for testing.

Tutorial

How to set up a Java project with Maven and JUnit

Create a Java project with Maven, manage dependencies, and write unit tests with JUnit 5.

Tutorial

How to set up a .NET project with xUnit tests

Create a .NET solution with a class library and an xUnit test project using the dotnet CLI.

Tutorial

How to set up a Node and TypeScript project with Vitest

Create a TypeScript project on Node.js, configure the compiler, and write fast unit tests with Vitest.

Tutorial

How to set up a Kotlin project with Gradle and JUnit

Create a Kotlin project with the Gradle build tool, manage dependencies, and write tests with JUnit 5.

Tutorial

How to use concurrency in Go with goroutines and channels

Run concurrent work in Go using goroutines, coordinate with channels, and synchronize with WaitGroup and context.

Tutorial

How to write concurrent Rust with threads and channels

Use Rust's threads, channels, and shared-state primitives to write concurrent code that the compiler proves is data-race free.

Tutorial

How to write concurrent Python with asyncio

Use Python's asyncio to run I/O-bound work concurrently with coroutines, tasks, and gather, and know when to use threads instead.

Tutorial

How to use concurrency in Java with executors and virtual threads

Run concurrent tasks in Java using the ExecutorService, futures, and lightweight virtual threads for scalable I/O.

Tutorial

How to write asynchronous C# with async and await

Use C# async and await with Task to run I/O-bound work concurrently, avoid blocking, and handle cancellation.

Comparisons18

Comparison

Go vs Rust

Two modern systems-oriented languages: Go optimizes for simplicity and fast development, Rust for memory safety without a garbage collector and maximum control.

Comparison

Go vs Java

Go offers a lean runtime and fast startup for cloud services, while Java brings a mature ecosystem, the JVM, and decades of enterprise tooling.

Comparison

Rust vs C++

Both target systems-level performance, but Rust enforces memory safety at compile time while C++ offers unmatched maturity and ecosystem at the cost of manual safety.

Comparison

Python vs Go

Python prioritizes expressiveness and a vast data/AI ecosystem, while Go prioritizes raw performance, concurrency, and lean deployment for services.

Comparison

Node.js vs Python

Two leading backend runtimes: Node.js offers event-driven, non-blocking I/O with JavaScript everywhere, while Python brings readability and a vast data ecosystem.

Comparison

Java vs Kotlin

Both run on the JVM and interoperate fully, but Kotlin offers more concise, modern syntax and null safety while Java offers ubiquity and the longest track record.

Comparison

Java vs C#

Two mature, statically typed languages with managed runtimes: Java on the JVM with broad portability, C# on .NET with strong language features and tooling.

Comparison

Kotlin vs Scala

Two modern JVM languages: Kotlin emphasizes pragmatism and approachability, while Scala offers deeper functional programming power and a more expressive type system.

Comparison

TypeScript vs Flow

Two static type systems for JavaScript: TypeScript is the de facto standard with a vast ecosystem, while Flow is a lighter type checker from Meta with declining adoption.

Comparison

Python vs R

Two leading languages for data work: Python is a general-purpose language strong across the data and ML pipeline, while R is purpose-built for statistics and visualization.

Comparison

Swift vs Kotlin

The leading native mobile languages: Swift for Apple platforms and Kotlin for Android, both modern, safe, and increasingly used for cross-platform development.

Comparison

PHP vs Node.js

Two popular web backends: PHP powers a huge share of the web with mature frameworks, while Node.js offers event-driven JavaScript across the full stack.

Comparison

Ruby vs Python

Two expressive, dynamic languages: Ruby is beloved for web development with Rails, while Python dominates data, ML, and general-purpose scripting.

Comparison

V8 vs JavaScriptCore

Two major JavaScript engines: Google's V8, powering Chrome and Node.js, and Apple's JavaScriptCore, powering Safari and Bun. Different design and tuning priorities.

Comparison

CPython vs PyPy

Two Python implementations: CPython is the reference interpreter with full compatibility, while PyPy uses a JIT compiler for major speedups on long-running code.

Comparison

Rust vs Go for CLI Tools

Both produce single static binaries ideal for command-line tools: Go favors fast builds and simplicity, Rust favors performance, rich CLI libraries, and safety.

Comparison

C vs Rust for Systems Programming

C is the foundational systems language behind operating systems and embedded software, while Rust offers comparable control with compiler-enforced memory safety.

Comparison

Kotlin vs Java for Android

Kotlin is Google's preferred, modern language for Android; Java is the original, ubiquitous JVM language with the largest legacy footprint.

Glossaries11

Glossary

Concurrency

Concurrency is the ability of a system to make progress on multiple tasks during overlapping time periods, structuring work so tasks can be interleaved, regardless of whether they execute simultaneously.

Glossary

Parallelism

Parallelism is the simultaneous execution of multiple computations, typically across several CPU cores or machines, to complete work faster than sequential execution.

Glossary

Immutability

Immutability is the property of data that cannot be changed after it is created; modifications produce new values instead of altering the original, which simplifies reasoning and concurrency.

Glossary

Pure Function

A pure function always returns the same output for the same input and has no side effects, meaning it does not read or modify any state outside its own arguments.

Glossary

Garbage Collection

Garbage collection is automatic memory management in which a runtime reclaims memory occupied by objects that are no longer reachable by the program, freeing developers from manual deallocation.

Glossary

Memory Safety

Memory safety is the property of a program that prevents invalid memory access such as buffer overflows, use-after-free, and null pointer dereferences, eliminating a major source of bugs and security vulnerabilities.

Glossary

Type System

A type system is a set of rules in a programming language that assigns types to values and expressions and governs how they may be combined, catching certain classes of errors before or during execution.

Glossary

Static Typing

Static typing is a language approach in which the types of variables and expressions are known and checked at compile time, before the program runs, catching type errors early.

Glossary

Dynamic Typing

Dynamic typing is a language approach in which variable types are checked at run time rather than compile time, allowing variables to hold values of any type and offering flexibility at the cost of later error detection.

Glossary

Compilation

Compilation is the process of translating source code written in a programming language into a lower-level form, such as machine code or bytecode, that a machine or runtime can execute.

Glossary

Interpretation

Interpretation is the execution of a program by directly reading and running its source code or an intermediate representation, statement by statement, without first compiling it to native machine code.