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 (also: prototypes, OLOO).
  • Functional programming (also: closures, first class functions, lambdas).

Red flags:

  • No clue what a paradigm is, no mention of prototypal oo or functional programming.

What is functional programming?

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. 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.

Good to hear:

  • Pure functions / function purity.
  • Avoid side-effects.
  • Simple function composition.
  • Examples of functional languages: Lisp, ML, Haskell, Erlang, Clojure, Elm, F Sharp, OCaml, etc…
  • Mention of features that support FP: first-class functions, higher order functions, functions as arguments/values.

Red flags:

  • No mention of pure functions / avoiding side-effects.
  • Unable to provide examples of functional programming languages.
  • Unable to identify the features of JavaScript that enable FP.

Author of content
Edit this page

Made by Michael Sakhniuk

Twitter