halubilo.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@JPDev@programming.dev to Programmer Humor@programming.dev • 1 year ago

ifn't

programming.dev

message-square
125
fedilink
763

ifn't

programming.dev

@JPDev@programming.dev to Programmer Humor@programming.dev • 1 year ago
message-square
125
fedilink
  • Caveman
    link
    fedilink
    26•1 year ago

    I’d take a not or “if not” operator tbh.

    • @Lmaydev@programming.dev
      link
      fedilink
      9•
      edit-2
      1 year ago

      It has a not keyword it’s used for pattern matching.

      if (x is not null)
      
      • Caveman
        link
        fedilink
        3•1 year ago

        It also has a !=.

        • @Lmaydev@programming.dev
          link
          fedilink
          2•1 year ago

          Pattern matching is different.

          • Caveman
            link
            fedilink
            2•1 year ago

            Yeah, I just said it since you used it with null. I used it a lot for enums

            • @Lmaydev@programming.dev
              link
              fedilink
              1•
              edit-2
              1 year ago

              The type matching is the most common thing I use it with. Combined with inline variables.

              if (x is string { Length: 5} s)
              {
                  // do stuff with s
              }
              

              And switch expressions.

              As a side note inline variables are amazing haha

      • @Patches@sh.itjust.works
        link
        fedilink
        2•1 year ago

        Stuff can be two things

    • @Appoxo@lemmy.dbzer0.com
      link
      fedilink
      3•1 year ago

      ifnt instead of ifn’t

Programmer Humor@programming.dev

!programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
  • 1.97K users / day
  • 4.34K users / week
  • 8.87K users / month
  • 16.9K users / 6 months
  • 23.1K subscribers
  • 1.39K Posts
  • 50.3K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org