• sajran@lemmy.ml
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    1 year ago

    Genuine question: why? What makes, say a semicolon, so superior to the the newline or tab characters?

    To be clear: I don’t think whitespace as a part of syntax is an awesome idea which should be more popular. It’s definitely a bit more error prone in some ways. It’s not perfect. But it’s okay.

    I’ve written a lot of Python and I don’t think I have ever seen a syntax error caused by incorrect whitespace. I’m not exaggerating. I regularly forget semicolons in other languages but I never type out incorrectly indented code. Maybe that’s just me though…

    • Reptorian@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      From some one who used Python as it was the easiest solution to few of my problems, and having to experience languages with brackets and/or endif/fi/done as ways to limit scope, I find that having things like brackets and/or scope terminators easier to parse and less error-prone. I’m thinking about moving on to Ruby whenever I had a need where Python would be a good choice, but the time it takes for me to understand a new language is blocking me from that.

    • UnfortunateShort@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I honestly think the scripting languages like fish have got it right.

      Newline by default completes a line and can optionally be escaped. Saves you most of the semicolons and even implicitly highlights multi-line statements.

      Whitespace doesn’t matter except for separating names.

      Blocks are explicitely ended without braces you can confuse with brackets or parentheses, no matter the coding style.

      If Rust and fish had a baby, I think it would be the best language to have ever been created.