The Bard's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
JPDev@programming.dev to Programmer Humor@programming.dev · 2 years ago

ifn't

programming.dev

message-square
12
link
fedilink
13

ifn't

programming.dev

JPDev@programming.dev to Programmer Humor@programming.dev · 2 years ago
message-square
12
link
fedilink
alert-triangle
You must log in or # to comment.
  • Trailblazing Braille Taser@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    I propose a new, more threatening kind of control flow.

    do {
      /* something */
    } or else {
      /* you don't want to find out */
    }
    
    • gex@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      Some C++ style guides suggest the following naming convention for functions that crash on any error

      OpenFileOrDie()
      
      • xmunk@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        2 years ago

        PHP has the always wonderful (and perfectly functional) syntax of

        logUserIn() or die();

        • msage@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          2 years ago

          Or Perl

          • frezik@midwest.social
            link
            fedilink
            arrow-up
            0
            ·
            2 years ago

            Perl also has unless() for the very purpose in OP, which is a more sensible choice.

            Oh, and if you need to reinforce your belief that Perl is a mess, the single-quote character can be used as a package separator instead of “::”. This was set in the 90s when nobody was quite sure of the right syntax for package separators, so it borrowed “::” from C++ and the single quote from Ada (I think).

            That means the ifn't() in OP can be interpreted as calling the t() function on the ifn package.

            The “::” separator is vastly preferred, though. Single quotes run havoc on syntax highlighting text editors (since they can also be used for strings). About the only time I’ve seen it used is a joke module, Acme::don't.

    • rothaine@beehaw.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 years ago
      do {
        /* something */
      } do hast {
        /* something */
      }
      
      • Trailblazing Braille Taser@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        2 years ago
        do {
          /* something */
        } do hast {
          /* something */
        } do hast mich {
          /* something */
        }
        
  • من البحر إلى النهر@lemmy.worldBanned
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    This can’t be for real. I’ll stick with C11 thank you.

    • StarDreamer@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Here you dropped this:

      #define ifnt(x) if (!(x))
      
  • MagicShel@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

    Reduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?

  • Bappity@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 years ago

    cap () {

    }
    nocap () {

    }

    • runner_g@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      nocap(frfr){

      }

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
Visibility: Public
globe

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

  • 1.44K users / day
  • 2.57K users / week
  • 4.22K users / month
  • 9.6K users / 6 months
  • 1 local subscriber
  • 30.3K subscribers
  • 1.55K Posts
  • 27.6K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.14
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org