minigubben's lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sleepzy@feddit.it to Programmer Humor@lemmy.ml · 8 months ago

Elvis

feddit.it

message-square
23
fedilink
65

Elvis

feddit.it

Sleepzy@feddit.it to Programmer Humor@lemmy.ml · 8 months ago
message-square
23
fedilink
  • bl4kers@lemmy.ml
    link
    fedilink
    English
    arrow-up
    12
    ·
    7 months ago

    I don’t understand this. Small brained users rise up

    • QuazarOmega@lemy.lol
      link
      fedilink
      arrow-up
      12
      ·
      7 months ago

      On the left you have Elvis Presley, while on the right there’s the so-called Elvis operator

      • The Cuuuuube@beehaw.org
        link
        fedilink
        English
        arrow-up
        15
        ·
        7 months ago

        been programming since 2008. the fuck is an elvis operator?

        • Jerkface (any/all)@lemmy.ca
          link
          fedilink
          English
          arrow-up
          8
          ·
          7 months ago

          Been programming since the 80s, ditto.

        • luciferofastora@lemmy.zip
          link
          fedilink
          arrow-up
          4
          ·
          7 months ago

          Ternary if?then:else

          • The Cuuuuube@beehaw.org
            link
            fedilink
            English
            arrow-up
            4
            ·
            7 months ago

            gotacha. i’ve only ever heard them called ternaries. maybe i’m old. maybe i’m too young. definitely one of the two

            • QuazarOmega@lemy.lol
              link
              fedilink
              arrow-up
              7
              ·
              7 months ago

              It specifically refers to this shorthand ?: that works like this:

              $value = $thing_that_could_be_truthy ?: 'fallback value';
              
              # same as
              
              $value = $thing_that_could_be_truthy ? $thing_that_could_be_truthy : 'fallback value';
              

              The condition is also the value if it is truthy

      • AVincentInSpace@pawb.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        why would you call it anything other than the ternary operator

        • QuazarOmega@lemy.lol
          link
          fedilink
          arrow-up
          2
          ·
          7 months ago

          Read further down on my other comment to understand, it’s just how the operator looks

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 257 users / day
  • 188 users / week
  • 2.45K users / month
  • 4.01K users / 6 months
  • 2 local subscribers
  • 36.4K subscribers
  • 1.75K Posts
  • 36.2K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org