Civilloquy
  • Communities
  • Create Post
  • 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
106
fedilink
620

ifn't

programming.dev

JPDev@programming.dev to Programmer Humor@programming.dev · 1 year ago
message-square
106
fedilink
  • Trailblazing Braille Taser@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    161
    arrow-down
    1
    ·
    1 year 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
      43
      ·
      1 year 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
        21
        ·
        1 year ago

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

        logUserIn() or die();

        • msage@programming.dev
          link
          fedilink
          arrow-up
          6
          ·
          1 year ago

          Or Perl

          • evatronic@lemm.ee
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 year ago

            Where do you think PHP stole it from?

            • msage@programming.dev
              link
              fedilink
              arrow-up
              2
              ·
              1 year ago

              Bash?

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 year ago

        Personally, I like to call catched exception variables up, so for a rethrow I can throw up;.

        • TwilightKiddy@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Except rethrowing an exception in C# is just throw;, anything else is a crime against the person who reads your stacktraces.

      • OpenStars@startrek.website
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        It’s funnier when you try to SysCallAndDie() :-P

        (that’s a real thing in perl btw - I guess that function didn’t get the memo)

      • Vorthas@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        One of the modules in a project I’m working on is called VulkanOrDie which always makes me crack up when I see it in the compilation messages.

      • yum13241@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Now what about GZDoom’s GoAwayAndDie();?

    • moody@lemmings.world
      link
      fedilink
      arrow-up
      17
      ·
      1 year ago

      It_would_be_a_shame_if(condition)

    • Mesa@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      The better try-catch. More intuitive if you ask me.

    • jadelord@discuss.tchncs.de
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      It exists, kind of. Python has this construct

      for item in iterable:
          ...
      else:
           ...
      

      which always puzzles me, since it depends on a break statement execution. I always have to look it up when the else block is executed.

    • OpenStars@startrek.website
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      1 year ago

      You just made me a offer I can’t refuse. I go now to sleep with the fishes…

    • rothaine@beehaw.org
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago
      do {
        /* something */
      } do hast {
        /* something */
      }
      
      • Trailblazing Braille Taser@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        6
        ·
        1 year ago
        do {
          /* something */
        } do hast {
          /* something */
        } do hast mich {
          /* something */
        }
        

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.09K users / day
  • 3.11K users / week
  • 6.47K users / month
  • 16.5K users / 6 months
  • 1 local subscriber
  • 24.9K subscribers
  • 1.38K Posts
  • 33.6K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org