Skip to content

Instantly share code, notes, and snippets.

View nolros's full-sized avatar

Nolan nolros

View GitHub Profile
@simonexmachina
simonexmachina / post.md
Created May 8, 2014 23:17
JavaScript and Object Models

JavaScript and Object Models

A "choose your own adventure" story

JavaScript is has both object-oriented and functional heritage, thanks to its two parents: Scheme and Self.

It provides first class functions and makes it simple to compose these function objects into bundles of awesome. Even though I'm an OO "true believer" at heart, I find myself composing my code using functional concepts, and use the OO approach where there's a clear benefit or where I feel that it's the best way to communicate the interface.

Object-oriented software design is by no means the only way to do software design, but it's been an immensely successful model for a very long time now, and provides a clear and well-understood mental model for thinking and communicating about software. Lots of good ideas like encapsulation, delegation, traits and composition fit well into OO design.