Skip to main content
generic

generic

1 8.1
A programming feature that lets the same code work with different data types
  • noun
  • /dʒəˈnɛrɪk/
  • Specialized
translation icon : genérico
  • In programming, a generic allows us to create functions that can handle data of various types safely.

But there was no there was no syntax for defining generics directly syntactically in the language.

Examples

  • Using a generic in our class means we can implement the same logic for both integers and strings.

  • The generic we defined can work with multiple data types, improving the flexibility of our code.

  • In fact, this step function here is just a generic step function.

  • So let's write out a generic form of this type.

  • But you don't have to write a generic script.

  • So we'll use that generic variable to denote any of those.

  • And so if this here is some generic fatty acyl COA.

  • O let's just go ahead and sketch a generic set of XY axes.

Compounds

generic drug
  • Specialized
9 3.7

A medicine that has the same dose and effect as a brand-name medicine but costs less

generic noun
  • Specialized
7.3

A word that refers to people without saying male or female

generic wine
  • Specialized
6.3

A wine not allowed to show its place or grape and sold under a simple name such as red

How General

reusable
18 3.2
generic
  • Specialized
1 8.1
parametric
  • Specialized
1 8.2
concrete
206 3.9

Surface Forms

generic singular
generics plural

Etymology

Generic (in programming) comes from the Latin genus, meaning 'kind' or 'type', so a generic class or function is made to work with many types or kinds of data. That's why one generic piece of code can handle different kinds of items.