• Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    I think that in many languages, semicolons are more of a formality. Javascript has a few weird edge cases that cause very silly bugs when you omit semicolons, but it works fine without them in most cases. Kotlin is mostly semicolonless and I find Kotlin code a lot more readable than equivalent Java code.

    It would not be that hard to parse semicolonless code in a language designed for it. The parser knows when a statement or expression is over, even if you split it among multiple lines. Debugging mismatched parentheses would become hell without an intelligent compiler, though.

    Language designers just like the explicit end-of-statement character. I’ve seen languages that use a full stop to separate statements and expressions and I honestly don’t understand why we don’t do that in more languages; it makes semantic sense.

    However, in the end, it’s not exactly hard to use semicolons, so I don’t see the problem with keeping them around either. Some people get real uppity about semicolons, either in favour or against them, though.

    • toastal@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      The best languages about really embracing punctuation as you would in English is Prolog & Erlang with their periods, semicolons, & commas.