• Frozzie@lemmy.world
    link
    fedilink
    arrow-up
    56
    ·
    7 months ago

    So you’re saying I can use the semicolon in a different context other than ending an instruction in my Java code ?

      • Flying Squid@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        7 months ago

        What about Applesoft BASIC? Because I was pretty good at that on my Apple II, but I don’t think there were semicolons.

        Also, I don’t know how to code, so I don’t know what semicolons are for in code.

        • SpaceNoodle@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          7 months ago

          BASIC statements end on new lines. The language does use a semicolon at the end of PRINT statements in order to omit printing a newline character at the end, but I believe that’s the only use. (It’s been about 20 years since I’ve done anything in BASIC.)

          The meaning of a semicolon depends completely on the language. C and C-like languages (like Java and Rust) tend to use them to delimit the end of a statement.

  • Gnome Kat@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    26
    ·
    edit-2
    7 months ago

    My 2c is that if the majority of people are confused about the purpose of a punctuation mark or language feature in general, then that feature is not actually fulfilling a useful function. If it was actually useful then people wouldn’t be confused, they would just be using it. People would learn it organically and not need it to be explained.

    That example sentence would function exactly the same if it was separated by a period, nothing is gained by using a semicolon. No new information is added, you are just going to make people wonder why there is a semicolon there making the sentence less comprehensible.

    Its sorta related to the prescriptivism vs descriptivism distinction.

    • LogarithmicCamel@feddit.uk
      link
      fedilink
      arrow-up
      27
      ·
      7 months ago

      That example sentence would function exactly the same if it was separated by a period; nothing is gained by using a semicolon. No new information is added; you are just going to make people wonder why there is a semicolon there making the sentence less comprehensible.

      FTFY. You aren’t supposed to separate two independent clauses with a comma.

      • They separate different clauses that don’t necessarily have to be two separate sentences. It can be used in place of a comma where you would follow with but, and, or, nor, for, so and yet.

        I have a shirt, but it is itchy.

        I have a shirt; it is itchy.

    • AnUnusualRelic@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      7 months ago

      OTOH, a lot people are also confused by vowels that sound vaguely similarly.

      People get confused pretty easily.

  • Malle_Yeno@pawb.social
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    7 months ago

    They’re also useful for separating multiple lists when using a comma would make it look like an item is an extended list.

    So let’s say I want to express:

    "My contacts are:

    • Jessica, Cook (as in a job title, not a name)

    • James, MD (as in the professional certification, not the name ‘MD’)

    • Doug, ABC (maybe to show that Doug works at ABC)"

    If I said:

    “My contacts are Jessica, Cook, James, MD, Doug, ABC.”

    There’s no clear indication of what is a list member and what is a new list. But this:

    “My contacts are Jessica, Cook; James, MD; Doug, ABC.”

    is a bit clearer. (There are probably better examples but I’m shooting from the hip here lol)

  • Dettweiler@lemm.ee
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    7 months ago

    They can also be used as a super comma; because sometime you make a longer sentence, or a sentence with complex clauses.

    • Cagi@lemmy.ca
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      7 months ago

      It’s more of a weak period than a strong comma; both sides of it need to be complete sentences.

    • Coolishguy@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      ·
      7 months ago

      I’m sorry, but the example in your comment is nonstandard usage. The part after the semicolon would typically be an independent clause, whereas the “because” marks yours as a dependent clause.

      There are still comma-like uses though. The major one I can think of is as a separator in a list where each element is long, possibly containing commas of its own.

  • dQw4w9WgXcQ@lemm.ee
    link
    fedilink
    arrow-up
    11
    ·
    7 months ago

    They are also a great tool to use in place of tabs or spaces to make java developers lose their minds.

  • Solinus 🌿@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    7 months ago

    em dash supremacy—my friend introduced me to this and i haven’t looked back since.

    alt+0151 on PC, ctrl+alt+minus for word if I remember right. On mobile you go to more symbols, hold down the minus, and slide to the longest one.

    Both require numeric keypad though- but using a minus and a space after can work as a substitute--as well as 2 minus signs (plus Lemmy happens to convert that to an em dash) - but like THAT? treason. absolutely not.

    You can even join more than 2 independent clauses together as shown above.

    • Sheridan@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      7 months ago

      On Mac and iPad it’s option-shift-hyphen.

      Also there’s the en-dash (option-hypen on Mac/iPad), which is slightly shorter: –

      The en-dash is meant for ranges of numbers, e.g., 1990–2023, although some use it like an em-dash.

    • yukijoou@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      on fr-oss, it’s shift+altgr+4 or 5, i believe… also don’t forget the non-breaking spaces around it when typing french!

    • dave@feddit.uk
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

      Also en-dash for separating two numbers when indicating a range. I have AHK shortcuts for them both :).

    • Zachariah@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      7 months ago

      (in standardized English) No, you can’t make them into a star with the semicolon in the center. Sentences are linear, so you can only connect two clauses at a time with one semicolon between them. However, you can chain clauses together, each time using a semicolon to join two independent clauses.

      Except language changes over time, so if the star usage of the semicolon catches on and introduces nonlinear sentences, then have at it.

  • Smorty [she/her]@lemmy.blahaj.zone
    cake
    link
    fedilink
    arrow-up
    4
    ·
    7 months ago

    You people don’t use semicolons; I am very surprised. For real though, I like to use the in German class, as it makes me seem fancy and knowledgeable.

  • johnyrocket@feddit.ch
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    7 months ago

    DELIMITER //

    SELECT name, definition

    FROM definitions

    WHERE name like ‘;’//

    DELIMITER ;

  • abbiistabbii@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    I have been reading a lot of News Articles from the 1920s (project I’m working on) and it’s really noticeable that they use “;” a lot more.