from Hacker News

What's the Point of OOP? (2008)

by reqo on 7/23/24, 8:37 PM with 2 comments

  • by BobbyTables2 on 7/24/24, 3:52 AM

    I feel associating methods to data is very good in terms of reducing scope (avoids every function being global) and developer convenience.

    But when people glorify OOP, they are usually focused on highlighting polymorphism — and that is when the “king has no clothes”.

    Outside somewhat narrow usecases, polymorphism is often overrated. Even when functionally possible in OOP, there could be huge performance impacts of a simple change like changing an array to linked list.

    The “traits” approach used in Rust (and others) is much more practical.

  • by pipeline_peak on 7/23/24, 8:58 PM

    Reusability kind of sucks when it’s hard to test.

    With my team, any code we touch, the parent callers need to be regression tested.

    It gets to a point where simply copying and pasting code then refactoring is the better way.