Slice

Noun · Development

Definitions

  1. A lightweight view into a contiguous region of an array or buffer, typically represented as a pointer, a length, and optionally a capacity — without copying the underlying data. In Go, slices are the primary dynamically-sized sequence type; in Rust and Python, they provide borrowed views into existing collections.

    In plain English: A window into part of a list or array that lets you work with a portion of the data without making a separate copy.

    Example: "Don't copy the whole array — just pass a slice of the first 100 elements so we avoid the allocation."

Related Terms