• stetech@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      C# is basically Java and from what I can tell, this looks approximately valid.

      Variables can always* be named freely to your liking.

      *You used to have to stick to the Latin alphabet, but that’s increasingly not the case anymore. Emoji-named variables FTW!

      • jaybone@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        No it’s not “basically Java”

        Aside from how Microsoft stole it, fucked the standard library, fucked the naming conventions, etc. You would never just “throw” without specifying what you were throwing.

        • CodexArcanum@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          This is incorrect. The C# is valid. Throw in a catch statement simply rethrows the caught exception. Source: I’ve been writing C# for 20 years, also the docs.

          I won’t act like MS absolutely didn’t steal core concepts and syntax from Java, but I’ve always thought C# was much more thoughtfully designed. Anders Hejlsberg is a good language designer, TypeScript is also a really excellent language.

          • jaybone@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            4 months ago

            In Java you would say “throw e;” (to rethrow the same exception you just caught.)

            You wouldn’t just say “throw”

            Or you could also throw some other exception. But the syntax requires you specify what it is you are throwing. (And sane in C++, where you could throw any object, even a primitive.)

            So that was my question.

            • CodexArcanum@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              0
              ·
              4 months ago

              Wildly, in C# you can do either and it has different results. I believe a bare throw doesn’t append to the stack trace, it keeps the original trace intact, while throw e updates the stack trace (stored on the exception object) with the catch and rethrow.

              In C#, you can only throw objects whose class derives from Exception.

            • dependencyinjection@discuss.tchncs.de
              link
              fedilink
              arrow-up
              0
              ·
              4 months ago

              To be honest I’m just playing into the meme of Java.

              My understanding is it’s academically great, but a pain in practice.

              For reference we use C# .Net, Entity Framework with GraphQL and React TypeScript for our enterprise applications and I really like C# now, but when I first started I’d only really used Node.js and some Java.

    • cobysev@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      For some reason, this just sparked an ancient memory of the Geek Code, which was a sort of signature block you could append to your emails and online bios to show off how much of a geek you were in the geekiest fashion possible.

      Goddamn I’m old.

      • AnUnusualRelic@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        Wow, hadn’t thought of that thing in ages. Now all we need is for B1FF to bring back ASCII sword signatures.

      • Rob Bos@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        Remember it spawning a bunch of copycats? For a while every community had their own code block. I wrote one for a usenet group i was in at the time.

        alt.sysadmin and alt.sysadmin.recovery both had em iirc…

    • Demigodrick@lemmy.zip
      cake
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago
      HAI 1.2
      CAN HAS STDIO?
      IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN 10
          VISIBLE SUM OF VAR AN 1
      IM OUTTA YR LOOP
      KTHXBYE
      

      A perfectly reasonable language. None of this Gen Z rubbish.

      Something something better times. Shakes stick at sky.

        • agentshags@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          4 months ago

          My 21 year old is pretty into rust and html. Does that count?

          I’m pretty ignorant on most of it. In my youth, I just dabbled trying to lean basic on a c64 and AMOS on the Amiga though, so maybe not lol

          e: I think I missed the joke, probably because I’m old lol

    • rtxn@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      4 months ago

      It’s a method definition. C#'s standard formatting puts the left bracket brace of the method body on a new line. It’s equivalent to:

      private bool IsSus(){
          ...
      }
      
  • MystikIncarnate@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Well. I think I’m officially out of touch with the newest generations slang terms. I only understood about half of that.

    • Clay_pidgin@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      I have many gray hairs, but here’s what I know.

      • Highkey and lowkey - obvious and subtle.

      • fax is “facts” - true. Often in the sense of agreement.

      • Fuck around and find out - do something risky and reap the consequences

      • It’s giving - how it makes you feel, or what it reminds you of.

      • Cap and no cap - lying and telling the truth.

      • Big yikes - bad, especially cringey.

      • Tea - (n) gossip. (v) “spill the tea”

      • Shoutout - give credit to someone. I don’t think this one makes much sense here.

      • Yap - talk, especially too much or unnecessarily.

      • Yeet - throw, often without careful aim. (Unlike “Kobe”, which is a throw with aim)

      • dependencyinjection@discuss.tchncs.de
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        4 months ago

        You missed

        • Rizz = charisma
        • vibe check = Vibe is kinda like someone’s aura or energy. So to check their vibe is to call them out on it.

        Also got many grey hairs but I like to know what people mean and language evolves. Our generation did it too you get me blud.

            • Clay_pidgin@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              0
              ·
              4 months ago

              It’s recognized by the yoots as the worst state, so being Ohio is bad!

              It’s worse than “mid”, which is meh.

            • introvertcatto@lemmy.blahaj.zone
              link
              fedilink
              arrow-up
              0
              ·
              4 months ago

              There was meme on titkok, someone says “only in Ohio” when something weird, impossible, unbelievable or some stupid bizarre shit happens.

                • cecilkorik@lemmy.ca
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  4 months ago

                  Florida is basically the unofficial US Capitol now, so it would be confusing and ambiguous to have it associated with the traditional forms of unexpected insanity. Now it’s going to be an entirely new kind of unexpected insanity, so Ohio has been selected to represent the old kind of unexpected insanity that Florida used to represent.

  • Destide@feddit.uk
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    4 months ago

    Just needs a rap about the fun in functions performed by 60-year-old seniors