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

Elvis

feddit.it

message-square
23
fedilink
65

Elvis

feddit.it

Sleepzy@feddit.it to Programmer Humor@lemmy.ml · 7 months ago
message-square
23
fedilink
  • 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

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.

  • 723 users / day
  • 744 users / week
  • 939 users / month
  • 3.62K users / 6 months
  • 2 local subscribers
  • 36.2K subscribers
  • 1.73K Posts
  • 35.8K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org