• IngeniousRocks (They/She) @lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    4 days ago

    I think of it like polymorphism in programming.

    If I have an integer “1”, that is equivalent to the float “1.0” or the string “1” or the list [1]. Depending if I ask “1” a float question, an integer question, a list question or a string question it will respond as it should for each type of question, defaulting to integer because that’s the “most correct” datatype for it.

    • sugar_in_your_tea@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      4 days ago

      As a proponent of strongly typed languages, don’t do that.

      Instead, I think of it as one type implementing multiple interfaces, but we’re still working on understanding the underlying type and what other interfaces it implements. Yes, you could implement a “compare” interface that does what you describe, but I don’t think that’s a good way to think about what’s going on. Instead, I think of it as Go interfaces (Rust traits are close enough) where we define a bunch of interfaces, and the particle/wave happens to implement all of them.

      We’ve provided a definition for waves and particles, but electrons seem to be something a little different, so it’s very possible neither waves or particles actually exist and are merely manifestations of some other type that can exhibit both types of behavior. Once we figure out what that underlying type is, we can make more inferences as to other behaviors it could have.