tucson.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
108
link
fedilink
686

ifn't

programming.dev

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

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

      OpenFileOrDie()
      
      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        10
        ·
        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
          2
          ·
          1 year ago

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

      • MonkderZweite@feddit.ch
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        I mean, it makes sense to call ComplainToErrorAndExit just ‘die’, no?

      • Vorthas@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        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.

      • OpenStars@startrek.website
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        1
        ·
        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)

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

        Now what about GZDoom’s GoAwayAndDie();?

    • Strawberry@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      40
      ·
      1 year ago

      this is just a menacing try/catch!

    • moody@lemmings.world
      link
      fedilink
      arrow-up
      22
      ·
      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
      7
      ·
      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.

    • rothaine@beehaw.org
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago
      do {
        /* something */
      } do hast {
        /* something */
      }
      
      • Trailblazing Braille Taser@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        7
        ·
        1 year ago
        do {
          /* something */
        } do hast {
          /* something */
        } do hast mich {
          /* something */
        }
        
    • OpenStars@startrek.website
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      2
      ·
      1 year ago

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

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: [email protected]

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.

  • 617 users / day
  • 4.35K users / week
  • 7.4K users / month
  • 19.5K users / 6 months
  • 1 local subscriber
  • 25.1K subscribers
  • 1.55K Posts
  • 51.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org