• lurch (he/him)@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    5
    ·
    2 days ago

    It’s nice and clean, but it’s not OO.

    One big difference is: You have to pass the “object” as parameter for everything that modifies it. You could use globals, but then you can only have one “object”.

    Still better than undescriptive naming.

    • Wolfizen@pawb.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      I disagree. I believe this is object oriented and the object is Point.

      You’re right that the syntax looks different. But whether the object is before the function name: obj.fn(p) or after the function name: fn(obj, p) does not change its status as a parameter. It is still required to be present in the invocation in both cases.

      Object oriented isn’t about where the parameters go, it is about how the program is organised and designed.