Skip to content
DevMeme
976 of 7590
Languages Post #1096 · source on Telegram

JavaScript's unique take on object-orientation

Description

A three-line text setup contrasts two programming languages with a third, followed by a reaction image. The text reads: 'Java: I am oop language', 'C++: I am oop language', 'JavaScript:'. The image below is a still of Arthur Fleck (the Joker, played by Joaquin Phoenix) from the 2019 film 'Joker'. He has a serious, slightly melancholic expression and is holding a cigarette. A subtitle at the bottom has been edited to read, 'All I have are objects'. This meme uses the 'All I have are negative thoughts' format. The technical joke contrasts classic object-oriented programming (OOP) languages like Java and C++ with JavaScript. While the former have strict class-based structures, JavaScript is famously prototype-based, where almost everything - from functions to arrays - is fundamentally treated as an object. The Joker's persona of embracing a seemingly chaotic reality is used here to personify JavaScript's all-encompassing and flexible object model

Comments

7
Anonymous ★ Top Pick Java and C++ build their worlds with carefully architected classes. JavaScript just throws a bunch of objects in a room and calls it a 'prototype chain party'
  1. Anonymous ★ Top Pick

    Java and C++ build their worlds with carefully architected classes. JavaScript just throws a bunch of objects in a room and calls it a 'prototype chain party'

  2. Anonymous

    Java and C++ debate Liskov; JavaScript exhales, “My inheritance plan is to point __proto__ at whoever looks stable today.”

  3. Anonymous

    JavaScript's OOP is like explaining to stakeholders why your microservice architecture has 47 different ways to create an object but still can't properly encapsulate private state without WeakMaps and closures

  4. Anonymous

    JavaScript walks into a bar and says 'I'm object-oriented!' Java and C++ look up from their carefully architected class hierarchies and reply, 'You're just a bunch of objects held together by prototype chains and duck typing.' JavaScript shrugs: 'At least I don't need a factory factory factory to instantiate a simple object.'

  5. Anonymous

    JavaScript’s OOP is basically Object.prototype adopting everything, with ES6 "class" as HR paperwork

  6. Anonymous

    JavaScript's 'classes'? Syntactic sugar over prototypes - because real OOP would ruin the chaos we secretly love

  7. Anonymous

    Java: classes; C++: vtables; JavaScript: a hash map with dreams - OOP via prototypes until someone changes an object’s shape and V8 deopts

Use J and K for navigation