DELAPARRA
Index
Color
NL
Category: Programming paradigms

Prototype-Based Programming

Explained by Updated

What is Prototype-Based Programming?

Prototype-Based Programming: There is no separate 'blueprint' concept — every object can serve as a prototype for new objects. A new object either copies its prototype's properties or delegates lookups to it when a property is missing. Prototype-based programming has no separate class blueprints. Any object can serve as the model for new objects, which either copy its properties or delegate missing lookups to it.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Prototype-Based Programming

How is Prototype-Based Programming used in practice?

JavaScript is the best-known prototype-based language, along with Self and Lua. It is flexible: you can add a method to a single object, or to a prototype shared by many, at runtime.

What should you keep in mind with Prototype-Based Programming?

Most JavaScript developers now use class syntax, which hides the prototypes underneath while keeping the same behaviour. Understanding prototypes still helps with debugging, especially with this, inheritance and library code that changes objects at runtime. For your own code, the class syntax with TypeScript types is usually clearer for other developers than hand-built prototype chains.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with P

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.