News for hackers. Stuff that matters.
Re:The world's smallest and fastest classical JavaScript inh... by jashkenas on Saturday February 15, 2014 @10:31AM (#7244044)

    > I code a lot of web stuff but the only time 
    > I've used OOP in JS is when I make games
That's very doubtful. Ever used a String in JavaScript? Ever used an Array? Ever used a regular expression? How about a function? All of those things are objects in JavaScript — and are used and useful as such.

The notion that OOP === single-inheritance needs to be put out of its misery. An object is anything that binds together data and code in a single value, and you use them all the time.

Re:The world's smallest and fastest classical JavaScript inh... by dustingetz on Saturday February 15, 2014 @11:37AM (#7244241)
Your first paragraph is true of functional languages too, which are decidedly not OO by any modern definition. OOP is about inheritance and encapsulating mutable state.
Re:The world's smallest and fastest classical JavaScript inh... by e12e on Sunday February 16, 2014 @01:33AM (#7246854)
An object is by definition data with associated functions to operate on that data. One might say that functional programming couples functions(methods) with data, while object oriented programs couple data with methods(functions).

In an object oriented paradigm, you send messages between objects, in a functional paradigm you pass data to functions. But, functions can normally take functions as arguments as well -- and all in all you can do one thing in the other -- but I think the big difference is on whether you model "smart data" or operations/functions.

Classes comes in when you have many objects that share behaviour. That can be modelled as traits/interfaces or as classes (grouping methods, and possibly singleton state). These things can be inherited, or assigned (as in javascript/self).

Re:The world's smallest and fastest classical JavaScript inh... by scotty79 on Saturday February 15, 2014 @11:03AM (#7244127)
I think he meant implementing at least two of his own objects where one inherits from the other.