CppCon 2018: Stoyan Nikolov “OOP Is Dead, Long Live Data-oriented Design”
Why Hacker News recommends it
HN cites it as a concrete, worked example of data-oriented design and as an alternative to OOP in performance-sensitive code.
What it is
A CppCon 2018 talk arguing that OOP has failed to deliver on reuse and performance, and presenting data-oriented design for C++ with practical worked examples from real systems.
Recommended by 3 HN commenters across 3 different months, 2018 to 2021.
What Hacker News said
Recommends phaedrus · 2018-10 · on “C++17 constexpr Compile-time Ray Tracer (2017)”
That's a very good point. It might be question of high versus low level. From a video I watched today (the rest of the video is worth watching, too, but the following stand-alone quote is apropos): "Polymorphism and interfaces have to be kept under control. I don't believe that their role is in a very low level system like interpolating a couple of numbers in the animations, but they have their place in high level systems, in client facing APIs. They are amazing if you do a type of plug in and you really need some type of dynamic polymorphism." [this video]
Recommends michael_j_ward · 2019-12 · on “Practical Examples in Data Oriented Design”
Just adding a more recent video on it from CppCon 2018 where the presenter goes over a specific worked example. [this video]
Recommends nikki93 · 2020-08 · on “Unity Software Inc S-1”
Glad to see some agreement there. I'm interested in building an ECS-based approach for a UI system at some point. The Yoga layout engine (implements flexbox -- [LINK] ) seems to actually be pretty amenable to just incorporating as a `Layout` or `Flex` component, then you could have components for platform-specific renderings (eg. `iOSTextInput`, `AndroidTextInput`, `DOMTextInput` in wasm, ...) that could read from cross-platform common components (`TextInput`). A core aspect would also be a `Hierarchy` component that just has a parent entity id and a list of child entity ids (that it keeps in sync properly). Then bind things to JS and allow you to code it from React, while still being able t
Cites leni536 · 2019-05 · on “Compress objects, not cache lines: an object-based compressed memory hierarchy”
In the article they mention that most programs are not dominated by arrays but objects. An other cure for that is to use arrays of primitives a lot more: [this video]
Cites DeathArrow · 2019-06 · on “Classes vs. Data Structures”
People are starting to use data oriented design instead of OOP. Data oriented design doesn't hide state, is generally faster and easier to comprehend as it doesn't abstract too much. [LINK] [this video] [LINK]
Cites drainyard · 2019-07 · on “Data-Oriented Design (2018)”
There's plenty of good talks and literature on the subject and why it is applicable to game development, but also more generally. This talk by Mike Acton (Formerly Insomniac now Unity): [LINK] I recommend this talk all the time, since it is the one that got me convinced to look into DoD seriously. Also: More Mike Acton (now at Unity): [LINK] Stoyan Nikolov “OOP Is Dead, Long Live Data-oriented Design”: [this video] Overwatch Gameplay Architecture and Netcode (More specifically about ECS): [LINK] The main argument is that you work with data so you should care about data. All a program does is take some input, do something with it, and give you an output. If you structure your program around this m
Cites valand · 2019-12 · on “Ask HN: How to improve code quality while maintaining decent velocity?”
Having your PR rejected in a healthy environment means that your PR is radically far from the reviewer's expectation. Having your PR rejected in a toxic environment can mean a lot of things, and a company sought after doesn't mean that it MUST be not toxic. First, you have to make sure if both of YOU and YOU ENVIRONMENT is healthy. If both are healthy, proceed reading. > The challenge here is to deliver good quality code, while maintaining a decent speed of delivery. You made it sound like producing good quality code = slowness. FALSE. Seeming slow, good quality code boosts your team's velocity. BUT keep in mind: "quality" is "the standard of something as measured against other things of a s
Cites valand · 2020-01 · on “Ask HN: What change in your programming technique has been most transformative?”
Static typings + type inference Parse, don't validate [LINK] All libs/products should be pure functions, with input output documented, making libs/products predictable Use in-app event sourcing to reduce the need for global states states DoD [this video] In non bare-metal languages, this will be useful for readability For errors, return instead of throw