Basically, would you rather want everything in a class/module/struct/whatever to be inaccessible by anything else unless you give a keyword saying it’s public (like Rust) or have everything accessible unless you make it private (like Ruby and Crystal)? Why?

Also, what do you think of languages that make you write public or private for every member, or ones that inherit the default state from whatever the parent member is?

  • sacredbirdman
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    I’m a bit confused… I thought you just said that your second example involved more typing. Anyway, I don’t care much for that characters typed argument either… but I do care about readability and “noisy” syntax or repetition tends to make reading/skimming harder.

    • ttmrichter
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Oh, that’s because I saw other responses that were already talking the typing shibboleth. I should have made that clearer. My bad.