• @[email protected]
    link
    fedilink
    -16 months ago

    Folks acting like Python is the only language without semicolons. 😏

    I got tripped up so many time in the last 3 weeks using PHP after years in ML family languages. I am already newlining & it’d be poor style to put more than one statement on a line so what is the point of these semicolons?

    • palordrolap
      link
      fedilink
      176 months ago

      In some languages
      a newline does not
      necessarily indicate
      the end of a statement.

      In others, sometimes it could, but would leave things ambiguous
      as to whether the statement was ended or not.

      And so, punctuation is necessary.

      • @[email protected]
        link
        fedilink
        26 months ago

        But newlines + indentation are supported by a lot of languages & when it is, it’s easier to read since the prevailing convention is already to newline, then in indent. When you follow the usual coding styles or autoformatted & removed the semicolons, you’ve gained nothing for readability & added noise. I much prefer the languages that take this convention & bake it in so you don’t have to have that that visual noise—and in these languages, I never felt the parsing rules were ambiguous.

    • @[email protected]
      link
      fedilink
      English
      76 months ago

      it’d be poor style to put more than one statement on a line

      Unlike Python, most languages do not endorse a specific concept of style. You’re free to dabble in all the bad style choices you like, on the off chance that once in a blue moon they prove to be situationally useful.

      • @[email protected]
        link
        fedilink
        36 months ago

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