Civilloquy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
JPDev@programming.dev to Programmer Humor@programming.dev · 1 年前

ifn't

programming.dev

message-square
106
fedilink
620

ifn't

programming.dev

JPDev@programming.dev to Programmer Humor@programming.dev · 1 年前
message-square
106
fedilink
  • Trailblazing Braille Taser@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    161
    arrow-down
    1
    ·
    1 年前

    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 年前

      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 年前

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

        logUserIn() or die();

        • msage@programming.dev
          link
          fedilink
          arrow-up
          6
          ·
          1 年前

          Or Perl

          • evatronic@lemm.ee
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 年前

            Where do you think PHP stole it from?

            • msage@programming.dev
              link
              fedilink
              arrow-up
              2
              ·
              1 年前

              Bash?

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 年前

        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 年前

          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 年前

        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 年前

        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 年前

        Now what about GZDoom’s GoAwayAndDie();?

    • moody@lemmings.world
      link
      fedilink
      arrow-up
      17
      ·
      1 年前

      It_would_be_a_shame_if(condition)

    • Mesa@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      1 年前

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

    • jadelord@discuss.tchncs.de
      link
      fedilink
      arrow-up
      5
      ·
      1 年前

      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 年前

      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 年前
      do {
        /* something */
      } do hast {
        /* something */
      }
      
      • Trailblazing Braille Taser@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        6
        ·
        1 年前
        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.11K 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