You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see the benefit of using arrow functions is lost when using it in a longer function. Arrow functions are a better fit for short and anonymous functions.
1508
1508
1509
-
#1. Can you name two programming paradigms important for JavaScript app developers?
1509
+
#1. Can you name two programming paradigms important for JavaScript app developers?
1510
1510
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.
1511
1511
1512
1512
Good to hear:
@@ -1521,7 +1521,7 @@ Learn More:
1521
1521
The Two Pillars of JavaScript Part 1 — Prototypal OO.
1522
1522
The Two Pillars of JavaScript Part 2 — Functional Programming.
1523
1523
1524
-
#2. What is functional programming?
1524
+
#2. What is functional programming?
1525
1525
Functional programming produces programs by composing mathematical functions and avoids shared state & mutable data. Lisp (specified in 1958) was among the first languages to support functional programming, and was heavily inspired by lambda calculus. Lisp and many Lisp family languages are still in common use today.
1526
1526
1527
1527
Functional programming is an essential concept in JavaScript (one of the two pillars of JavaScript). Several common functional utilities were added to JavaScript in ES5.
@@ -1545,7 +1545,7 @@ The Dao of Immutability.
1545
1545
Composing Software.
1546
1546
The Haskell School of Music.
1547
1547
1548
-
#3. What is the difference between classical inheritance and prototypal inheritance?
1548
+
#3. What is the difference between classical inheritance and prototypal inheritance?
1549
1549
Class Inheritance: instances inherit from classes (like a blueprint — a description of the class), and create sub-class relationships: hierarchical class taxonomies. Instances are typically instantiated via constructor functions with the `new` keyword. Class inheritance may or may not use the `class` keyword from ES6.
1550
1550
1551
1551
Prototypal Inheritance: instances inherit directly from other objects. Instances are typically instantiated via factory functions or `Object.create()`. Instances may be composed from many different objects, allowing for easy selective inheritance.
@@ -1598,7 +1598,7 @@ Learn More:
1598
1598
The Two Pillars of JavaScript Part 1 — Prototypal OO.
1599
1599
The Two Pillars of JavaScript Part 2 — Functional Programming.
1600
1600
1601
-
#5. When is classical inheritance an appropriate choice?
1601
+
#5. When is classical inheritance an appropriate choice?
1602
1602
The answer is never, or almost never. Certainly never more than one level. Multi-level class hierarchies are an anti-pattern. I’ve been issuing this challenge for years, and the only answers I’ve ever heard fall into one of several common misconceptions. More frequently, the challenge is met with silence.
1603
1603
1604
1604
“If a feature is sometimes useful
@@ -1616,7 +1616,7 @@ Learn More:
1616
1616
The Two Pillars of JavaScript Part 1 — Prototypal OO.
1617
1617
JS Objects — Inherited a Mess.
1618
1618
1619
-
#6. When is prototypal inheritance an appropriate choice?
1619
+
#6. When is prototypal inheritance an appropriate choice?
1620
1620
There is more than one type of prototypal inheritance:
#7. What does “favor object composition over class inheritance” mean?
1640
+
#7. What does “favor object composition over class inheritance” mean?
1641
1641
This is a quote from “Design Patterns: Elements of Reusable Object-Oriented Software”. It means that code reuse should be achieved by assembling smaller units of functionality into new objects instead of inheriting from classes and creating object taxonomies.
1642
1642
1643
1643
In other words, use can-do, has-a, or uses-a relationships instead of is-a relationships.
@@ -1664,7 +1664,7 @@ Move Over, `class`:
1664
1664
Composable Factory Functions Are Here
1665
1665
medium.com
1666
1666
1667
-
#8. What are two-way data binding and one-way data flow, and how are they different?
1667
+
#8. What are two-way data binding and one-way data flow, and how are they different?
1668
1668
Two way data binding means that UI fields are bound to model data dynamically such that when a UI field changes, the model data changes with it and vice-versa.
1669
1669
1670
1670
One way data flow means that the model is the single source of truth. Changes in the UI trigger messages that signal user intent to the model (or “store” in React). Only the model has the access to change the app’s state. The effect is that data always flows in a single direction, which makes it easier to understand.
@@ -1681,7 +1681,7 @@ No understanding of what either one means. Unable to articulate the difference.
1681
1681
Learn more:
1682
1682
1683
1683
1684
-
#9. What are the pros and cons of monolithic vs microservice architectures?
1684
+
#9. What are the pros and cons of monolithic vs microservice architectures?
1685
1685
A monolithic architecture means that your app is written as one cohesive unit of code whose components are designed to work together, sharing the same memory space and resources.
1686
1686
1687
1687
A microservice architecture means that your app is made up of lots of smaller, independent applications capable of running in their own memory space and scaling independently from each other across potentially many separate machines.
@@ -1720,7 +1720,7 @@ Unaware of the additional performance overhead caused by IPC and network communi
1720
1720
Too negative about the drawbacks of microservices. Unable to articulate ways in which to decouple monolithic apps such that they’re easy to split into microservices when the time comes.
1721
1721
Underestimates the advantage of independently scalable microservices.
1722
1722
1723
-
#10. What is asynchronous programming, and why is it important in JavaScript?
1723
+
#10. What is asynchronous programming, and why is it important in JavaScript?
1724
1724
Synchronous programming means that, barring conditionals and function calls, code is executed sequentially from top-to-bottom, blocking on long-running tasks such as network requests and disk I/O.
1725
1725
1726
1726
Asynchronous programming means that the engine runs in an event loop. When a blocking operation is needed, the request is started, and the code keeps running without blocking for the result. When the response is ready, an interrupt is fired, which causes an event handler to be run, where the control flow continues. In this way, a single program thread can handle many concurrent operations.
0 commit comments