When is prototypal inheritance an appropriate choice? - Deepstash
How To Become A Digital Nomad

Learn more about career with this collection

How to build a network while working remotely

How to work remotely

How to manage finances while working remotely

How To Become A Digital Nomad

Discover 92 similar ideas in

It takes just

15 mins to read

When is prototypal inheritance an appropriate choice?

Good to hear:

  • In situations where modules or functional programming don’t provide an obvious solution.
  • When you need to compose objects from multiple sources.
  • Any time you need inheritance.

Red flags:

  • No knowledge of when to use prototypes.
  • No awareness of mixins or `Object.assign()`.

96

175 reads

MORE IDEAS ON THIS

What is the difference between classical inheritance and prototypal inheritance?

In JavaScript, prototypal inheritance is simpler & more flexible than class inheritance.

  • Good to hear: Classes: create tight coupling or hierarchies/taxonomies; Prototypes: mentions of concatenative inheritance, prototype delegation, functional inherit...

103

405 reads

When is classical inheritance an appropriate choice?

The answer is never, or almost never. Certainly never more than one level.

Good to hear:

  • Rarely, almost never, or never.
  • A single level is sometimes OK, from a framework base-class such as React.Component.
  • “Favor obje...

97

239 reads

What is functional programming?

It produces programs by composing mathematical functions and avoids shared state & mutable data.

  • Good to hear: Pure functions/function purity; Avoid side-effects; Simple function composition; Examples of functional languages: Lisp, ML, Haskell, Erlang,...

107

575 reads

What is asynchronous programming, and why is it important in JavaScript?

Good to hear:  

  • An understanding of what blocking means, and the performance implications. 
  • An understanding of event handling, and why its important for UI code. 

101

647 reads

What are the pros and cons of functional programming vs object-oriented programming?

  • Good to hear: Mentions of trouble with shared state, different things competing for the same resources, etc.; Awareness of FP’s capability to radically simplify many applications; Awareness of the differences in learning curves; Articulation of side-effects and how they impa...

102

241 reads

What are two-way data binding and one-way data flow, and how are they different?

Good to hear:  

  • React is the new Canonical example of one-way data flow. Cycle.js is another popular implementation of uni-directional data flow.
  • Angular is a popular framework which uses two-way binding. 

98

196 reads

What does “favor object composition over class inheritance” mean?

Good to hear:  

  • Avoid class hierarchies. 
  • Avoid brittle base class problem. 
  • Avoid tight coupling. 
  • Avoid rigid taxonomy. 
  • Avoid the gorilla banana problem. 
  • Make code more flexible. 

97

206 reads

What are the pros and cons of monolithic vs microservice architectures?

Good to hear:  

  • Positive attitudes toward Microservices, despite higher initial cost vs Monolthic Apps. Despite higher initial cost, Microservices tend to perform and scale better.
  • Structure the App so that services are independent from each other. But easy to ...

98

186 reads

Can you name two programming paradigms important for JavaScript app developers?

JavaScript is a multi-paradigm language, supporting imperative/procedural programming along with OOP (Object-Oriented Programming) and functional programming. JavaScript supports OOP with prototypal inheritance.

  • Good to hear: Prototypal inheritance (al...

103

631 reads

Marcus Lemonis

“People, Process, Product”

MARCUS LEMONIS

108

850 reads

CURATED FROM

CURATED BY

dustinspe

Secretary at a company

Related collections

More like this

What is the difference between classical inheritance and prototypal inheritance?

In JavaScript, prototypal inheritance is simpler & more flexible than class inheritance.

  • Good to hear: Classes: create tight coupling or hierarchies/taxonomies; Prototypes: mentions of concatenative inheritance, prototype delegation, functional inherit...

What is functional programming?

It produces programs by composing mathematical functions and avoids shared state & mutable data.

  • Good to hear: Pure functions/function purity; Avoid side-effects; Simple function composition; Examples of functional languages: Lisp, ML, Haskell, Erlang,...

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates